I want to create a simple automation that switch on lights in my hallway only when:
List item
It’s between 06.30 and 08.00
From 10 min before sunset till 21.30
This is my attempt:
automation:
- alias: Accendi Luce Corridoio se rilevato movimento
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d00015adc7c
to: 'on'
- platform: state
entity_id: binary_sensor.motion_sensor_158d0002b439f9
to: 'on'
condition:
- condition: state
entity_id: light.corridoio
state: 'off'
- condition: and
conditions:
- condition: sun
after: sunset
after_offset: "-00:10:00"
- condition: time
after: '06:29:59'
before: '07:59:59'
- condition: time
before: '22:29:59'
But the automation doesn’t work at all.
If I remove the second condition (06.29 - 07.59) it works.