Open jant90 opened 2 years ago
I was having the same issue and it was because the Brightness Lower Value defaults to 29. I selected the light in my integrations, hit configure, then submit. That took me to the config flow where I was able to change the Brightness Lower Value to 10 and that took care of it.
It's not an issue with how I've configured my Tuya lights, I've already properly determined the boundary values for these bulbs and set them accordingly in the Tuya integration in HA.
Actually I now think the issue is a combination of Tuya and how HA core deals with brightness percent. When I dim the light using brightness percent to 1% I can't get to the true lowest brightness value of Tuya bulbs. But when using brightness value (which has a range of 0-255) and setting the bulb to 1 I can get it to dim further.
I'm seeing this same issue. When I try to set my Tuya bulbs to the lowest brightness through HA (1%), it actually gets set to 22 or 23%. But I'm able to reduce it down to 1% in the Tuya app.
@flippedcracker it's a bit annoying that it's not possible to do from the GUI but I did find a workaround to dim the light to their lowest values.
In Home Assistant, instead of using a brightness percentage (brightness_pct
) of 1%, set the brightness (brightness
) to 1 (which has a scale from 0-255). However, the GUI uses the brightness percentage by default which has a scale from 0-100% and it's not possible to dim below 1%. A brightness percentage of 1% is actually a brightness of 3 on the 0-255 scale.
You can test it with your bulbs by going to Developer Tools > Services and call the the Light: Turn on service with a value of 1, or in YAML:
service: light.turn_on
data:
brightness: 1
target:
entity_id: light.tuya_bulb
When you do this you will notice the GUI reports the light to be on, but at 0% brightness.
@jant90 I'm controlling my lights using node-red, and when using brightness_pct, I would get 22-23% actual brightness (confirming in the Tuya Smart app). If I switched to just brightness, and use a value of 1, I would an actual brightness of either 13 or 17%. I will try using the Dev Tools and setting it in there and seeing where it ends up. Thanks.
@flippedcracker I think you need to look at the border values for brightness you configured when adding the lights to the localtuya integration (so maybe remove and add them again). You may have set the bottom value for brightness too high and now HA won't go below that value you configured, even when setting brightness to 1.
The problem
I've added a few tunable white Tuya lightbulbs to Home Assistant using the LocalTuya integration. While I can control them just fine I can't dim them to their lowest value. When I set their brightness to 1% in HA they actually stay stuck at 2.2%.
Through the Tuya Smart app and the Tuya API Explorer I can see that the boundaries for brightness are 10 (=1%) and 1000 (=100%) and using the Tuya Smart app I can set the brightness to 1% just fine (= a
bright_value_v2
of 10 in the API Explorer) but when I set the brightness to 1% in HA thebright_value_v2
of the light is actually set to 22 (or 2.2%). When I change the brightness from that 2.2% to 1% using the Tuya Smart I can actually see the light dim further so currently it's impossible to reach the lowest brightness of these light through HA. Setting the light to 50% brightness in HA results in abright_value_v2
of 507 on the bulb (where it should be 500). So something in the scaling seems off.I want to note that the color temperature has a similar scale with boundary values of 0 (= warmest temp of 1800K) and 1000 (= coolest temp of 3000K for these specific bulbs) and this can be controlled perfectly fine in HA. Using the color temperature slider I can reach the boundary values of 0 and 1000 as expected.
Environment
Steps to reproduce
bright_value_v2
in Tuya API Explorer, also visible in Tuya Smart app).bright_value_v2
in Tuya API Explorer or Tuya Smart app (in my case it's 22 while it should be 10).bright_value_v2
is at 22, use the Tuya Smart app to dim the light further to 1% and see the actual light get dimmer (this brightness setting can't be set through HA).bright_value_v2
in Tuya API Explorer or Tuya Smart app (in my case it's 507 while it should be 500).temp_value_v2
ranging from 0-1000 and is working perfectly fine in HA.Configuration
configuration.yaml
orconfig_flow
I used config flow and the lights can be controlled just fine.
DP dump
Provide Home Assistant taceback/logs
Additional information
set_dp
service I can manually set the brightness to the lowest value like this: