Comments (9)
Based on the returned DPS values this does not appear to be an RGBTW light, only a white light with color temperature support (TW light). Can you confirm that this is true or not?
from tuya-mqtt.
It is a RGBTW light and a week ago I even could set the color via Openhab. It's this lamp: https://www.amazon.de/gp/product/B08BFPGWZ1/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
This is the testing sitemap I build. It worked so far but now I ran into this bug.
from tuya-mqtt.
OK, maybe it's simply not sending color value because it's in white mode (there's no DPS 24 value being returned by the device), could you try putting it in color mode with the app and then restarting tuya-mqtt to see if that tickles it back to working? If it does, then I think I understand what is happening here, but I've not seen another device behave this way so I'll have to think how to fix it.
from tuya-mqtt.
First of all, thank you for your time and help!
Your guess was right. When the lamp is set to a color, the tuya-mqtt is not crashing. I could use the testing sitemap. Here is the log:
tuya-mqtt:info Connection established to MQTT server +0ms
tuya-mqtt:tuyapi Search for device id xxx +0ms
tuya-mqtt:tuyapi Found device id xxx +1ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +34ms
tuya-mqtt:tuyapi Connected to device Stehlampe (xxx, xxx, 9d8fa31a826050a9) +984ms
tuya-mqtt:device-detect Attempting to detect light capabilites and DPS values... +0ms
tuya-mqtt:device-detect Querying DPS 2 for white/color mode setting... +0ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +31ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +14ms
tuya-mqtt:device-detect Detected likely Tuya color bulb at DPS 20-24, checking more details... +44ms
tuya-mqtt:device-detect Attempting to detect if bulb supports color temperature... +0ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +11ms
tuya-mqtt:device-detect Detected likely color temerature support +11ms
tuya-mqtt:device-detect Attempting to detect Tuya color format used by device... +1ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +13ms
tuya-mqtt:device-detect Detected Tuya color format HSB +12ms
tuya-mqtt:discovery Home Assistant config topic: homeassistant/light/xxx/config +0ms
tuya-mqtt:discovery {
tuya-mqtt:discovery name: 'Stehlampe',
tuya-mqtt:discovery state_topic: 'tuya/stehlampe/state',
tuya-mqtt:discovery command_topic: 'tuya/stehlampe/command',
tuya-mqtt:discovery brightness_state_topic: 'tuya/stehlampe/color_brightness_state',
tuya-mqtt:discovery brightness_command_topic: 'tuya/stehlampe/color_brightness_command',
tuya-mqtt:discovery brightness_scale: 100,
tuya-mqtt:discovery hs_state_topic: 'tuya/stehlampe/hs_state',
tuya-mqtt:discovery hs_command_topic: 'tuya/stehlampe/hs_command',
tuya-mqtt:discovery white_value_state_topic: 'tuya/stehlampe/white_brightness_state',
tuya-mqtt:discovery white_value_command_topic: 'tuya/stehlampe/white_brightness_command',
tuya-mqtt:discovery white_value_scale: 100,
tuya-mqtt:discovery availability_topic: 'tuya/stehlampe/status',
tuya-mqtt:discovery payload_available: 'online',
tuya-mqtt:discovery payload_not_available: 'offline',
tuya-mqtt:discovery unique_id: 'xxx',
tuya-mqtt:discovery device: {
tuya-mqtt:discovery ids: [ 'xxx' ],
tuya-mqtt:discovery name: 'Stehlampe',
tuya-mqtt:discovery mf: 'Tuya',
tuya-mqtt:discovery mdl: 'RGBTW Light'
tuya-mqtt:discovery },
tuya-mqtt:discovery color_temp_state_topic: 'tuya/stehlampe/color_temp_state',
tuya-mqtt:discovery color_temp_command_topic: 'tuya/stehlampe/color_temp_command',
tuya-mqtt:discovery min_mireds: 154,
tuya-mqtt:discovery max_mireds: 400
tuya-mqtt:discovery } +1ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +1s
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +12ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +15ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +11ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +20ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +12ms
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +12ms
tuya-mqtt:state tuya/stehlampe/state ON +0ms
tuya-mqtt:state tuya/stehlampe/white_brightness_state 97 +4ms
tuya-mqtt:state tuya/stehlampe/hs_state 120,100 +1ms
tuya-mqtt:state tuya/stehlampe/color_brightness_state 52 +1ms
tuya-mqtt:state tuya/stehlampe/hsb_state 120,100,52 +0ms
tuya-mqtt:state tuya/stehlampe/mode_state colour +0ms
tuya-mqtt:state tuya/stehlampe/color_temp_state 346 +1ms
tuya-mqtt:state MQTT DPS JSON: tuya/stehlampe/dps/state -> {"20":true,"21":"colour","22":970,"23":220,"24":"xxx","26":0} +0ms
tuya-mqtt:state MQTT DPS20: tuya/stehlampe/dps/20/state -> true +1ms
tuya-mqtt:state MQTT DPS21: tuya/stehlampe/dps/21/state -> colour +0ms
tuya-mqtt:state MQTT DPS22: tuya/stehlampe/dps/22/state -> 970 +0ms
tuya-mqtt:state MQTT DPS23: tuya/stehlampe/dps/23/state -> 220 +0ms
tuya-mqtt:state MQTT DPS24: tuya/stehlampe/dps/24/state -> xxx +0ms
tuya-mqtt:state MQTT DPS26: tuya/stehlampe/dps/26/state -> 0 +0ms
tuya-mqtt:command Received MQTT message -> {"topic":"tuya/stehlampe/command","message":"OFF"} +0ms
tuya-mqtt:command Received MQTT command message is a text string +0ms
tuya-mqtt:command Device xxx received command topic: command, message: off +0ms
tuya-mqtt:tuyapi Set device xxx -> {"dps":20,"set":false} +38s
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":false} +113ms
tuya-mqtt:state tuya/stehlampe/state OFF +38s
tuya-mqtt:state MQTT DPS JSON: tuya/stehlampe/dps/state -> {"20":false} +1ms
tuya-mqtt:state MQTT DPS20: tuya/stehlampe/dps/20/state -> false +0ms
tuya-mqtt:command Received MQTT message -> {"topic":"tuya/stehlampe/command","message":"ON"} +2s
tuya-mqtt:command Received MQTT command message is a text string +2s
tuya-mqtt:command Device xxx received command topic: command, message: on +0ms
tuya-mqtt:tuyapi Set device xxx -> {"dps":20,"set":true} +2s
tuya-mqtt:tuyapi Received JSON data from device xxx -> {"20":true} +120ms
tuya-mqtt:state tuya/stehlampe/state ON +2s
tuya-mqtt:state MQTT DPS JSON: tuya/stehlampe/dps/state -> {"20":true} +0ms
tuya-mqtt:state MQTT DPS20: tuya/stehlampe/dps/20/state -> true +1ms
from tuya-mqtt.
OK, at least that gives me something to go on. I'll have to think of a way to fix this, but the fact that the device just doesn't return any DPS 24 value just because it's in white mode is certainly unexpected. That means that the autodetection of the color type will always fail if the bulb is in white mode when tuya-mqtt starts, so I'll have to implement something in the detection logic so that, if it gets not value here, it just assumes a format based on the mode switch DPS # and then initializes a base DPS 24 value even if no value is returned when queried.
Shouldn't be too hard but, unfortunately, time has not been on my side with this project lately, and I have a number of outstanding issues to address. I'll try to see if I can code up something for this in the next few days.
from tuya-mqtt.
Thank you for this. Take your time and let me know if I can help in any way!
from tuya-mqtt.
I pushed 3.0.2 with some enhanced logic to attempt to deal with this issue when the light is in white mode and avoid the undefined property. I'd appreciate it if you could give it a spin when you get a chance and let me know if it works for you since I can't easily test this as none of my devices behave this way.
from tuya-mqtt.
Hey tsightler, thank you so much for your work. I switched to OH 3 in the meantime, so I had to setup the whole ting again but after some troubles I can control the lamp via OH. Is there a way that I can thank you with a coffee or something?
from tuya-mqtt.
Thanks for letting me know, I'll close this now. No need for further thank me but, if you feel like it, I always encourage people to contribute to a charity or some cause which you believe in or offer any simple, kind gesture to others who might need it after what has been a difficult year for many people across the world.
from tuya-mqtt.
Related Issues (20)
- Problem installing on Synology RS914 HOT 32
- Home Assistant integration how? HOT 2
- tuya-mqtt publishes states only when app is opened. HOT 22
- What mqtt broker HOT 3
- Disconnected from device and never connects again ... HOT 6
- Samples for nodejs script HOT 9
- New Maintainer Needed HOT 4
- Not sure when you went into Maintenance mode HOT 3
- Command Syntax for friendly topics HOT 3
- Setting switch state of a smart switch (custom template) HOT 11
- zombe state reconnecting issue? HOT 1
- Switch w/ Energy: DPS values reported only once at tuya-mqtt startup HOT 3
- Sudenly wrong responses from tuya device HOT 1
- tuya-mqtt not working (OpenHab) HOT 7
- Tuya bulb stopped working from tuya-cli, tuja-mqtt HOT 9
- Devices behind zigbee gateway available with tuya-cli but not tuya-mqtt HOT 1
- Different names after service restart HOT 9
- tuya-mqtt crushing HOT 1
- hsb type not suported in generic template HOT 1
- Support Smart Switch TYWB 4ch-RF HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tuya-mqtt.