Hello everyone,
I wonder if someone can help me, I’m setting up a home assistant automation to turn on a light when a door is opened. I’m using an Xiaomi aquara window/door sensor to trigger the automation. After spending ages before I found that I wanted “on” and “off” as values rather than “open” & “closed” I got the basics working OK. The trigger which does work is:
entity_id: binary_sensor.window_door_sensor
from: ‘off’
platform: state
to: ‘on’
However, I want to only trigger the event during darkness hours, rather than having the light turned on every time I open the door. This is where things go wrong, I can’t get the conditional element to work.
This (and variations thereof) is what I’ve tried as a condition:
after: sunset
before: sunrise
condition: sun
However, when I save this I get a notification about an invalid config in an automation. Needless to say, the automation is not running when I add that condition. I’ve also tried using time as a condition, but without success.
Anyone have any great ideas?
1 post - 1 participant