Closed juacas closed 7 months ago
This is a known loop and that's why it's not recommended to use the internal luminance for that, but rather the external (outdoors) luminance levels that are not affected by lighting.
"Don't turn off when is not dark." can be emulated by setting "When should lights be controlled" to occupancy
only and not for state
.
Can you share your template? That should've worked
Thanks for replying so fast!
My template is: {{ (states('light.luzcocina_light') == "off") and (states('binary_sensor.kitchen_is_dark') == 'on' ) }}
But it produces an event race and the light goes on/off very fast for a few seconds until it stabilizes. Then the faked state is "dark" while the light is "on". I know this is a dirty workaround... that doesn't work in real world.
It is a pity not to be able to take advantage of the actual sensor to control the room light. Please consider my proposal that the dark state be optionally used only to turn on the light.
Try using the state_attr
last_changed
to help stabilize the flipping. You can add a condition where N seconds must have passed. Also use our #support channel on Discord if you need more help with your template.
Please consider my proposal that the dark state be optionally used only to turn on the light.
Please add a Feature Request on the Discussions tab
Describe the bug If an area has a light sensor to calculate the "dark state" and the lights turn on, then the dark state goes to "off" and lights are turned off, the dark state goes to "on" and the cycle starts again.
To Reproduce Steps to reproduce the behavior:
Expected behavior Not to consider the dark state to turn off the lights when the sensor is in the same room. Maybe with a checkbox in config flow to select "Use "dark state" only for turning on the lights." or "Don't turn off when is not dark."
PD: I tried as a workaround defining a template sensor for darkness with the logic: "is dark and ligth is off" but it didn't work.
Regards.