alias: Pool Filterpumpe
description: ''
trigger:
- id: 'on'
platform: sun
event: sunrise
offset: '04:00:00'
- id: 'off'
platform: sun
event: sunset
offset: '-02:00:00'
action:
- service: 'switch.turn_{{ trigger.id }}'
target:
entity_id: switch.pumpe_relays_1
mode: single
Because although it triggers exactly 2 hours before sunset, it evaluates the Sun Condition several microseconds later, when the time is no longer 2 hours before sunset (it’s approximately 1 hour, 59 minutes, 59 seconds and several milliseconds before sunset).
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.