Hereās how I do it. This works for two people but if you have more, just keep adding entities as triggers/conditions. There is probably a more elegant way to handle multiple people, but this works and Iāve never had a problem. The key for the ālast personā is the triggers have to be conditioned with every person/device tracker you want to monitor to be NOT home.
You need to figure out a bulletproof way of determining when each individual is away from the home. There are some ways to do it regarding using the personās cell phone but it is more reliable with android than iphone and that is not bulletproof (canāt get iphone location when it is asleep, person might leave the phone at home). Figure out a way of determiing for sure for each person, when they are not home. Once you have that as a person entioty in home assistant (you add people manually to start with, then that is altered by what I was specifying before). Then , you can make a group helper in homs assistant that you would use in your automation (if true etc). A group helper returns true if all items in the group are of the same value (home or away, on or off, etc.). Itās not the perfect answer for you but that is reality as far as I see it, hope that helps you get started. Iāve been looking for some kind of foolproof GPS gizmo to put on my and my wifes keychain to resolve the issue myself but have yet to even find anything (as we NEVER leave the home without our keys)!
Iāve been using these two automations and two iPhones for nearly 5 years. Never had a problem with the GPS tracking, except because our house/neighborhood was so new that GPS reporting was a little off until more WiFi access points were around us to provide better triangulation. These are probably two of my more robust automations. We take our keys with us because theyāre on the same ring as the car keys, but I canāt tell you the last time I actually used a key to enter my house, except when we were building the house and just moved and I hadnāt yet setup HA again. I have automations based on the alarm status and when it is armed, the garage door locks up, when it is disarmed, the garage door unlocks and we walk right in.
Thanks, we also uses iPhones an the HA Companion App. After using squirtbrnrs script i see you only have to use comma seperation in the visuell editor.
The zone.home state is a value indicating the number of people in that zone. If you want to trigger an automation to run when the last person leaves, try:
trigger:
- platform: state
entity_id:
- zone.home
to: "0"
If you want to trigger something when the first person comes home, try:
trigger:
- platform: state
entity_id:
- zone.home
from: "0"
One of the advantages to this is that you donāt have to remember to add entities if you add people to the zone.
Iām having a bit of bother with this⦠well, I think I am⦠let me try to explain.
first here is my automation
- id: '1744057021494'
alias: Open Blind after sunrise and 10am if nobody home
description: ''
triggers:
- trigger: sun
event: sunrise
offset: 00:30:00
id: sunrise
- trigger: time
at: '10:00:00'
id: 10am
conditions:
- condition: trigger
id:
- sunrise
- 10am
- condition: numeric_state
entity_id: zone.home
below: 1
attribute: persons
actions:
- action: esphome.blind_stair_control_servo
data:
level: -12
mode: single
My problem is that there are two of us in the house, but zone.home only shows a numerical value of 1 even if both of us are home, also if either one of us leave then is shoes a value of 0. Am I missing something?
what I want to achieve is if both of us are out then the blind will open as long as it is after 10am and after sunrise, Ideally Iād like it to be triggered at 10am, 30 mins after sunrise and when the last person leaves the house (just in case we have forgotten to open the blind). is this possible? or would I be better making 3 different automations?
Perfect thank you! a small important detail that I overlooked, I only had one person set up which is why it only counted one. sorted that and itās all working perfectly.
using the ābelow: 1ā count will only work if you do not have any kiosk or in my case kids ipads. I had forgotten about this and could not get it to trigger, then looked at my zone.home stats and saw 2 of them.
we use a kiosk mode tablet on the wall and kids ipads so they can go hog wild on playing with their color light bulbs and ceiling fan⦠so those devices never leave the house.
true⦠that can be done.
But Iāve got young kids and they love the challenge of misplacing devices. Yeah, I could use Find my iPhone/iPad for apple devices instead of HA.