I have set up an automation that should run when both I and my wife leave home.
I want the automation to run if both of us leave home. If just I leave home and the wife is at home, the automation does not run.
It worked once, then stopped working.
It seems to think my wife (Delores) is home, even though we have both left.
It depends on a lot of configurations. Home location, GPS, nmap, apps used to send current location of each device, … more details are needed.
It may take some minutes to update, like 10 minutes or so.
Are you sure that “is_not_home” is an actual state for that device tracker? I would try using “away” instead. Another option is to create a Group named “Anyone” and add both person.david and person.delores to that group. Then check to see if “Anyone” is home.
Each Zone has a state attribute that contains the number of persons currently in that zone. Go to Developer Tools - States and type in “Home” and you’ll see the State attribute as well as the persons currently in the zone.
@mightybosstone ah - ok. I see the code, but “how do I create” this in the actual yaml files: The configuration file?
I am not comfortable doing the coding outside the visual editor - I can, but right now I need some very specific direction on how to enter / format the code.
It does appear that the developers have no intention of migrating the person group functionality over to the new Helpers method, and the old .yaml method is supposed to be retired at some point. So you might be safer to just use the zone count method that rossk suggested.
Technically, your code will only trigger when you leave home, if your wife is already not at home. If she leaves home and you’re not currently home it won’t trigger. If you both leave at the same time your phone could flip to not home before hers. You would need a second trigger from her leaving when you’re not home for that to work. I’m not much help with the actual automation code as I use Node Red for 99% of my automations.
Blockquote
Technically, your code will only trigger when you leave home, if your wife is already not at home. If she leaves home and you’re not currently home it won’t trigger. If you both leave at the same time your phone could flip to not home before hers.
Blockquote
I am not sure how to do the second trigger concept other than to just add the additional trigger in the same automation:
Dave leave home
Delores leave home
but as I understand, the triggers are an “or” function. At any rate, until I get smart enough on Node Red, which seems to be a good skill to have, I work through the visual editor and “simple yaml code”.
Now having said that I will follow your advice and work the suggestion from @rossk .
If you need both be away, then it should be is_not_home for both.
For the app to report HA that the device left home area.
It won’t happen at the same time, even if you are side by side with your wife.
It will execute once for each trigger.
If your device triggers the automation first (like 8 minutes after you left home area), then it will detect as your wife is still home and won’t do anything.
Then your wife’s device triggers later (like 14 minutes later she left home area), and then it will execute the automation because both conditions were satisfied this time.