I cannot figure out why my delay is not working. The light turns on and then turns off immediately.
I originally had this in a single automation, using an or condition, but broke it out into two separate automations hoping that would solve my problem. I still experience the same problem.
My configuration passes the validation check…
- id: back_dooor_triggers_hallway_outside_light_after_sunset
alias: "Back door triggers hallway ouside lightm after sunset"
trigger:
platform: state
entity_id: switch.back_door
condition:
condition: sun
after: sunset
action:
- service: switch.turn_on
entity_id: switch.hallway_outside_light
- delay:
minutes: 10
- service: switch.turn_off
entity_id: switch.hallway_outside_light
- id: back_dooor_triggers_hallway_outside_light_before_sunrise
alias: "Back door triggers hallway ouside light before sunrise"
trigger:
platform: state
entity_id: switch.back_door
condition:
condition: sun
before: sunrise
action:
- service: switch.turn_on
entity_id: switch.hallway_outside_light
- delay:
minutes: 10
- service: switch.turn_off
entity_id: switch.hallway_outside_light