Taras,
I need to turn light (after open door) if time is between sunset and sunrise.
condition:
platform: sun
after: sunset
before: sunrise
The problem is that “sunset” and “sunrise” are UTC time, not CEST time.
So I found the way to convert them in CEST, using
'{{(as_timestamp(state_attr("sun.sun","next_setting"))|timestamp_local)}}'
but it not works with input_datetime
.
So I need to use CEST sunrise and sunset in my condition.
See rows code with “???”
Many Thanks
alias: mc_Ingresso (2)
description: turn on only after sunset and before sunrise
trigger:
- platform: state
entity_id: binary_sensor.sonoff_a480011888
from: 'off'
to: 'on'
for: '00:00:00'
condition:
- condition: time
before: ??? sunrise-time-cest (not utc)
after: ??? sunset-time-cest (not utc)
action:
- service: switch.turn_on
target:
entity_id: switch.sonoff_1000ca80a3
mode: single