Hello,
I try to make an automation that when someone leaves the house AND the rest of the family is not home, a light goes out. Because I use zones, I want to switch off the light when everybody is NOT home but for some reason it’s not working:
- alias: 'Iemand gaat weg'
hide_entity: True
trigger:
- platform: state
entity_id: device_tracker.me, device_tracker.other
from: 'home'
to: 'not_home'
for:
seconds: 20
- platform: state
entity_id: input_boolean.kid1, input_boolean.kid2
from: 'on'
to: 'off'
condition:
condition: and
conditions:
- condition: template
value_template: '{{ states.device_tracker.me != "home" }}'
- condition: template
value_template: '{{ states.device_tracker.other != "home" }}'
- condition: state
entity_id: input_boolean.kid1
state: 'off'
- condition: state
entity_id: input_boolean.kid2
state: 'off'
action:
- service: switch.turn_off
entity_id: switch.light
For some reason when one of the device.trackers is HOME and one of the input_boolean is set from ON to OFF, the light switches OFF.
When I don’t use zones and only home or not_home and work with state it works like a charm:
- condition: state
entity_id: device_tracker.me
state: 'not_home'
Can anyone find what’s wrong?
Thx
Erik