Hello,
I’ve searched the forums and am just getting confused, I’d really appreciate a clear simple answer.
All I want to do is switch off all lights when the last person leaves the house.
I used to have this set up perfectly using state change group.all_devices from home to not_home. After an update quite a while ago, it stopped working.
We have person A and person B each with a phone using the HA Companion app for presence detection.
The nearest topic I could find was https://community.home-assistant.io/t/howto-use-multiple-device-tracker-to-turn-off-item/93623
but it doesn’t seem to work (the syntax which i copy exactly from the above topic is getting mangled by the UI configurator (it keeps changing the quotations marks in the template even when use the Edit in YAML function (See below for what it changes it to). At the bottom of that topic they suggest using groups (as I used to) but I literally cannot find how to create groups anymore using the UI.
alias: Turn off the lights when I leave home
description: ‘’
trigger:
- platform: zone
entity_id: person.A
zone: zone.home
event: leave - platform: zone
entity_id: person.B
zone: zone.home
event: leave
condition: - condition: and
conditions:- condition: template
value_template: ‘{{ states(’‘person.A’’) != ‘‘home’’ }}’ - condition: template
value_template: ‘{{ states(’‘person.B’’) != ‘‘home’’ }}’
action:
- condition: template
- domain: light
entity_id: light.living_room_main
device_id: 144d336355384ce2a13e57a5c0d1fbd6
type: turn_off
mode: single
Any help much appreciated.