#Zone Detection - "Not Home"

1 messages · Page 1 of 1 (latest)

fallen mural
#

I'm looking to have an automation trigger events when nobody is "Home".

I am successfully triggering the automation when I leave, then again when my wife leaves, however, the IF that's looking for "Him = Away" and "Her = Away" is never triggering. Usually, we leave the house at different times, and I have "Him = Work" when "Her = Away" (having just left the house). It seems that "Work" != "Away".

Is there a way to do a "not equal" in my IF conditional?
Do I need to create a helper variable "Him is home" and update it every time I enter/exit a zone to set it to "True" if I've entered "Home" else "False"?
Is there a built in way (that I'm not aware of) to somehow equate "Not Home" with "Away". I can, of course, always look at the map to see where my wife is, but it's easier to just look at her badge to see if she's at work, church, or other known location.

What is the recommended course of action to have an automation run once Elvis (and all other known occupants) have left the building?

rigid barn
#

Nobody home... use the state of zone.home 😉

#
- trigger: numeric_state
  entity_id: zone.home
  below: 1
fallen pagoda
#

To make a not equal condition, you wrap a state == home condition under a NOT condition. But using zone.home is good too.

honest grotto
#

A template binary sensor helper with {{ states(‘zone.home')|int(0) > 0 }} has been in my setup for ages now. Works perfectly.

fallen mural
#

Thanks, @rigid barn. I've done a quick edit of my automation to test this now.

fallen mural
honest grotto
#

Yup. that's exactly what I do. Plus, template in one spot versus 20+ automations/scripts, etc... 🙂

fallen mural
#

Hrm... My wife's phone just updated, indicating that she's at work (been there about 30 minutes - that delay is another issue to resolve), but I'm WFH today. The badge on my main dashboard indicates that I'm home, but devtools States indicates that zone.home count = 0.
Any thoughts on why the discrepancy?

rigid barn
#

Check the person for you, see if that tracker is connected to it

fallen mural
#

I think the issue may be that I've got multiple "me"s in the system.
I've currently got two entities for my current phone, I've got several from my UniFi integration finding the phone and me attempting to associate those with my Person.
What's recommended to clean those up?
Do I go delete them all, uninstall the app, then add it back on my phone?

rigid barn
#

Link the right ones to the person entity

red elmBOT
#

Open your Home Assistant instance and show your users

fallen mural
#

Ahhh... I think the issue is that in some places, I'm using the GPS based one and in others I'm using the router based one. Obviously, I'd want to use the GPS based device tracker as that's going to be the one from the Android app and will be more accurate/consistent, since ocassionally, even when we're home, we drop off wifi.
Am I right in my thinking?

red elmBOT
rigid barn
#

Read how it works first