I have this automation to lighten the lights at 1 o’clock in the night and to turn off at sunrise with an offset, but it is not working as expected:
- alias: Accendi Luce Camera Letto Notte
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d0001a92ca1
to: 'on'
condition:
condition: or
conditions:
- condition: time
after: 01:00:00
- condition: sun
before: 'sunrise'
before_offset: "-00:45:00"
action:
- service: light.turn_on
entity_id:
- light.yeelight_3
- light.yeelight_4
data:
transition: 15
color_name: green
- delay: 00:00:45
- service: light.turn_off
entity_id:
- light.yeelight_3
- light.yeelight_4
I know in this way the automation is triggered for all the day from 1 o’clock in the night to the next sunrise. How to make it working as i want?