Hi
I have an automation working for a door sensor that turns on the lights when the door is opened after sunset and turns them off after the door has been closed for 20 minutes.
The problem is that if the door is opened and closed again before the delay is complete the lights turn off as soon as the door is closed.
Automation is as below
-
alias: Entrance Light Off When Dark
trigger:
platform: state
entity_id: sensor.garagehouse_door
from: ‘Open’
to: ‘Closed’
condition:- condition: state
entity_id: input_boolean.garagehousedoor
state: ‘on’
action:
- delay: ‘00:20:00’
- service: switch.turn_off
entity_id: switch.front_door_3 - service: light.turn_off
entity_id: light.garage_main - service: input_boolean.turn_off
entity_id: input_boolean.garagehousedoor
- condition: state
Many Thanks
Jman