I’ve got a current issue with a light switch and some LED bulbs where when the light is turned down past a certain threshold, the LEDs are off, but the switch is still on. I would like to fix this by using Home Assistant to create an automation where when the lights are below a certain threshold, Home Assistant turns the lights back up to the lowest identified brightness setting where the lights are still visible. I would rather do this than turn the switch off, because the brightness setting appears to be persistent, and when the light is turned back on, it’s still at the lower setting.
This is what I currently have, but it’s not really doing anything. I’m trying to find the right event to latch on to for whenever the brightness is changed.
I don’t think that would work because that will only trigger when the light goes from off to on. (Same issue with the trigger in the OP.) But I think the OP wants it to trigger whenever the light level changes, even if it was already on.
This will be evaluated whenever either the state or any of the attributes of light.wink_dining_room change, and will be true (and cause the automation to fire) if the light is on and the brightness is below 15%. (Note that brightness goes from 0 to 255, hence the need to multiply it by 15%, or 0.15.)
FWIW, my suggestion above replaces the trigger and conditions in your new automation. Either way is fine; it’s more of a style thing.
Although, there still are two bugs in your last automation…
First, the brightness of a light is a value between 0 and 255. If you test against 15, then you’re actually testing against 5.9% (i.e., 15/255), not 15%. You should be using a value of 38.25 (which is 15% of 255.)
Second, the numeric_state condition is trying to check the state of light.wink_dining_room, but the state will be ‘on’ or ‘off’, not the brightness level – that is in an attribute. You at least need to change that condition to:
This is what I get for trying to write configurations when I’m away from home and can’t immediately test it. Here’s what I’ve currently got. I’ll check when I get home to see if this is working right. Thanks for your help.