I can not understand the behaviour of the following automation:
- id: garage_stairs_on_if_entered_after_dark
alias: "Turn on Garage stairs if front door opens after dark"
trigger:
- platform: state
entity_id: binary_sensor.front_door
to: 'on'
condition:
- condition: state
entity_id: sun.sun
state: "below_horizon"
action:
- service: homeassistant.turn_on
entity_id: switch.garage_stairs
- delay: 00:05:00
- service: homeassistant.turn_off
entity_id: switch.garage_stairs
It behaves properly the first time: once the door opens, the lights would turn on.
BUT- if the same door opens once more within the delay of 5 minutes as specified - the light turns off and stay off…
What is happening and how to make sure it stays on and the timer will just restart… what am I missing?
I have a similar automation. I added an additional condition to check if the light is off. THat way the automation only runs if the door is opened and the light is off.
THere might be a better way but it works for me. I’m still new to HA.