Hi …
Goal is to have sensors that turn on garden lights when some comes home after 22:30 and until sunrise next morning.
‘light_trigger_havegang_group’ is a group with a couple of PIR sensors and door sensor. This group works fine.
Lights are controlled by a shelly 2.5 switch - works fine.
Below script gets stuck in the sunrise condition… and sI e why, as now when I test, before midnight the sun has risen (this morning)…
If I disable the sunrise check - everthing works…
So, how do I do this ? - can it be done in one automation ? or should I make two, one runs from 22:30 until 23:59:59 and another from 00:00:00 until sunrise ?
/Joern
alias: Havegang - Tænder lys efter 2230 ved sensor
description: Automation som tænder og slukker lyset i havegangen
triggers:
- trigger: state
entity_id:
- binary_sensor.light_trigger_havegang_group
to: "on"
id: SensorsTriggered
conditions:
- condition: time
after: “22:30:00"
- condition: sun
before: sunrise
enabled: true
actions:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.shellyswitch25_c45bbe5f33eb_channel_1
- delay:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.shellyswitch25_c45bbe5f33eb_channel_1
mode: restart