Hi,
As you can see here, I am trying to fix an automation that is suppose to function as follows:
Next sunset - 15 minutes, > 9/1 and daylight savings time is on OR
At Sunset
Is this the correct way to go about it? I noticed if I remove the == states(‘sensor.time’), then it would be true which is how it was prior and I had mixed results.
Thanks!
- platform: template
value_template: >-
{{ ((as_timestamp(states.sun.sun.attributes.next_setting) - 15*60) |float| timestamp_custom('%H:%M') == states('sensor.time') and (now().month, now().day) >= (9,1) and is_state('binary_sensor.daylight_savings_time', 'on')) or
((as_timestamp(states.sun.sun.attributes.next_setting)) |float| timestamp_custom('%H:%M') == states('sensor.time')) }}
2 posts - 2 participants