I have an automation that turns on the garage light when movement is detected on the Unifi doorbell, but I want it to do so only after sundown (and before sunset). So when it’s dark enough. It works perfectly without the condition, but as soon as I add the sun condition. It does nothing at all.
What am I doing wrong?
Yaml code below:
--> Your trigger spot after sunset and before sunrise
Day 1 - 06:00 - Sunrise
Day 1 - 18:00 - Sunset
--> Your trigger spot after sunset and before sunrise
Day 2 - 06:01 - Sunrise
Day 2 - 17:58 - Sunset
--> Your trigger spot after sunset and before sunrise
HA thinks in just one day
00:00 Start of day
06:00 Sunrise
18:00 Sunset
23:59 End of day
Your after sunset and before sunrise would then be here
00:00 Start of day
--> Your trigger spot before sunrise
06:00 Sunrise
18:00 Sunset
--> Your trigger spot after sunset
23:59 End of day
Since the condition merger is “and” then both will have to be true, but that state is impossible to reach.
Changing the condition merger to “or” will make it possible to be true and that is what you want.
I’ve had the same issue as long as I’ve been on HA and I’ve just found ways to work around it. I understand what other people in here are saying and I’m definitely going to switch to above/below horizon. Thanks for posting this, I learned something.