Hi
Could someone please help me with an complex automation (Christmas lights)?
The external sockets should switch on when someone is at home and the Helper ChristmasMode is OFF.
But if the helper is ON and the sun has set and someone is present then the sockets should switch on until mm:hh (helper)
Not Present @ home = SWICH OFF
Present @ home & (Helper ChristmasMode) = OFF, = SWITCH ON
Present @ home & (Helper ChristmasMode) = ON, = SWTICH OFF
Present @ home & (Helper ChristmasMode) = ON, AND SUNSET, = SWITCH ON
What do I have to use as a ls trigger?
How do you prevent that after the set “helpe mm:hh” and or a change to Helper, Zone, Sun doesn’t turn the light on again unintentionally.
alias: Christmaslights
description:
trigger:
- platform: sun
event: sunset
offset: 0
- platform: zone
entity_id: device_tracker.iphone13a
zone: zone.home
event: enter
- platform: zone
entity_id: device_tracker.iphone13b
zone: zone.home
event: enter
- platform: state
entity_id:
- input_boolean.ChristmasMode
to: "on"
from: "off"
condition:
- condition: and
conditions:
- condition: or
conditions:
- condition: zone
entity_id: device_tracker.iphone13a
zone: zone.home
- condition: zone
entity_id: device_tracker.iphone13b
zone: zone.home
- condition: sun
after: sunset
- condition: state
entity_id: input_boolean.ChristmasMode
state: "on"
action:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.0015dbe332b6a9_2
- switch.0015dbe332b6a9_6
- wait_for_trigger:
- platform: time
at: input_datetime.christmaslights_off_at
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.0015dbe332b6a9_2
- switch.0015dbe332b6a9_6
mode: single
Thanks