I have read loads of threads here on similar issues and would so welcome any thoughts from people on how I can make simple leaving and coming back home automation using zones to work… They are not firing at all…
I have HA and my network linked so am using WIFI status as the trigger…
See my code below, I am wondering if there is something going on with the device IDs morphing somehow?
alias: Leaving the House
description: When both Neil & Tanya Away
trigger:
- platform: device
device_id: b3db4a52e21c72e52c6de19198a6194b
domain: device_tracker
entity_id: c2110e77f8e57422b39c20c85d90aced
type: leaves
zone: zone.home
condition:
- condition: device
device_id: e6c0f12b715413fe2c247b7465b2ee8f
domain: device_tracker
entity_id: 8f7ef4a76b4ef54636a21d9e2c59b071
type: is_not_home
- condition: not
conditions:
- condition: zone
entity_id: person.tana
zone: zone.home
action:
- type: turn_off
device_id: 42b58284c7887b31b82308af9dbab0d5
entity_id: dbead8d0944cc46ae9981dce5f3a34e0
domain: switch
- type: turn_off
device_id: eb0c762bf585c20e87aa37324c343022
entity_id: 8fbada8a5decb4e4e7ac4a78d729dd46
domain: switch
- type: turn_off
device_id: f0572961e3e0ff91f128f1d5b2d5f30e
entity_id: d953331b839390adf205eff54f7fcce1
domain: switch
mode: single
No, the state of the device_tracker will be home or not_home. So, the from field should be home, and to should be not_home. And you filled out attribute, which shouldn’t be used.
Thanks for the steer Petro and understand now what you are sayign to do, but cant seem to find which attribute from the device tracker is storing home or away…
Appreciate your continued input as i try to work this out
Thanks again Petro, your inout was so appreciated and have the automations working using state.
To simplify management of members of the automation, i setup a switch group in helpers. In order to swap out individual devices in my automation actions, I was hoping to use the switch group. Tried adding the switch group via a device but not showing up as the group doesn’t have a device ID…
Is there a recommended way to use switch groups in automations?
Was thinking that wasnt the best way to do it… Thanks for confirming…
Is there another way you would recommend to save on updating a group or some collection once and then applying it to all of my automations for the same actions being applied? Eg of my current acitons below in one of my autoations