If you reload the automations, restart HA, or anything causes your automations to be interrupted/restarted/etc then the automations won’t finish. You’re a lot better off splitting those into separate on and off automations, like this:
alias: Buiten - Spots Aan
trigger:
- platform: sun
event: sunset
offset: '-00:15:00'
- platform: time
at: '06:30:00'
condition:
- {{ (trigger.platform == event and now().hour < 22) or (trigger.platform == time and is_state('sun.sun','below_horizon')) }}
action:
- type: turn_on
device_id: df8f88ebdcf7ad803e2baeff62c2f0e3
entity_id: light.buiten_spots
domain: light
brightness_pct: 35
mode: single
alias: Buiten - Spots Uit
trigger:
- platform: sun
event: sunrise
offset: '00:15:00'
- platform: time
at: '22:00:00'
action:
- type: turn_off
device_id: df8f88ebdcf7ad803e2baeff62c2f0e3
entity_id: light.buiten_spots
domain: light
mode: single
I’d generally recommend sun elevation over a fixed time offset, since the light level is very different across the year if you used fixed offsets.
Thnx for the reply, is the condition a tempate?
like this:
condition: template
value_template: >-
{{ (trigger.platform == event and now().hour < 22) or (trigger.platform ==
time and is_state('sun.sun','below_horizon')) }}