-
Might be related to #481 but not sure. I have a currently unsupported light that I'm trying to build a YAML file to support. While I can change the color of the light without issue using a hex schema, I can't control the brightness using an integer like nearly every other light that is supported with this integration today. Looking at the debug logs on the Tuya Cloud side, it looks like anytime that the brightness is changed, instead of it changing the DPS for brightness (which is available for this device, but apparently not used for a r/w perspective), it changes the DPS for the Light Color. In the example here, at 20:58:55 I set the color to a value, and the brightness percentage to 52%. Then at 20:59:05, I kept the color identical and simply changed the brightness to 82%, and you can see that instead of a brightness DPS changing, the Light Color DPS changes. I tried using the following based on other working examples, but the DPS ID of 6 clearly won't work properly here.
and this is the DPS for the brightness:
While it is delayed by 30 min or so, it does look like every now and then it will report the brightness from the device itself in a report event. DPS mappings for reference: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
This is interesting. It appears that the id of 6 isn't useful on this device at all. If you go into the native light bulb controls in home assistant, you can set a color no problem, but then when you go to the brightness slider it will not work. Way around this? Call it in a service, and this seems to work. I'd still like to see if there's a way that I can get the normal HA Light controls to work without needing to call it from a service, but I'm not sure how that would be possible. This works to change color AND set brightness in the same service call:
This works to change color ONLY:
This does NOT work to change only the brightness:
|
Beta Was this translation helpful? Give feedback.
-
With this code, I get the color mode to work very reliably. In the above post I had dps 5 set to force: true which caused problems. Now it's no longer an issue.
But there's a problem - I don't have a white mode available to me for a color mode, only an effect. If I set dps 4 to color_mode, the device won't properly set the brightness. |
Beta Was this translation helpful? Give feedback.
all set here. color_mode is what is needed, I had another issue that was causing things to not behave properly.