Location not_home vs away

In the iPhone app devices that are not at home are shown as 'away".
On the web frontend they are shown as 'not_home’.

How come the difference?

1 Like

because device_trackers have the ability to be linked with zones. Under the hood, you’ve got home and not_home. But when looking at a device tracker, the states can be ‘home’, ‘away’, ‘friendly_name of any zone’. not_home means ‘everything but “home”’, i.e. ‘away’ and all zone names.

It essentially makes it easier for automating if you only care about being home or not home.

Thanks for the update. Topic closed.

Just to make sure I’m 100% clear on this one because it is causing problems in my automations, you are saying that:

“not_home” means I am not at home, but I could be inside or outside of any other defined zone. Basically, I will be not_home for the entire duration of the time I’m outside of the house

“away” means that I am not in my home zone and I am also not inside any other zone that I have defined. Basically I am somewhere between the zones.

I would suppose that this means that I can be both “not_home” and “away” at the same time, is that correct?

The thing that gets me is that some of my device trackers show up as not_home at the same time that others are showing “away” and we are in the same place… I don’t understand why that would be.

Also, do I have to capitalize “away” in automations? In the UI it shows as capitalized most of the time… Are zones case sensitive?

no, under the hood, its

home or not home.

displayed to the user its

Home, Away, or Zone Name.

Home == home
Away == not_home
Zone Name == not_home

The code is basically:

if home:
  display Home
else:
  if in zone:
    display Zone Name
  else:
    display Away

This purely depends on what type of trigger you are using.

The best rule of thumb is to use ‘home’, ‘not_home’, and case senstative zone name. Do not use ‘Home’, or ‘Away’, because those are mostly for language translation to the user for a pretty user interface.

Okay, so now I think I get it… So not_home is identical to Away, except that you can’t really use Away for automations, it’s just what’s displayed in the UI… The only weird thing is that sometimes I also get not_home displayed in the UI when I show a device tracker in a glance card.

Yes, I think that’s a bug. Person domain has that issue right now as well.

This actually doesn’t appear to be the case. I have an automation that looks for not_home but my last known state is whatever named zone I was in.

Screenshot of the event not firing:

Note the “state: work, wanted_state: not_home”

And the automation itself:

1 Like

Person is not the same as device tracker, this is a thread about device trackers. The thread is also almost 3 years old too.

FYI you should be using a not condition there if you’re trying to capture not_home because it will be not_home or zone name. Right now your condition only grabs not_home.

Makes sense. Based on that code snippet I figured not_home was enough. Or is not_home good enough for decive_tracker but not person_tracker?

Home == home
Away == not_home
Zone Name == not_home

No, device trackers are still the same. person are a bit different because they can pull from multiple device tracker. If you only have one, then it should behave the same way for person.

I do only have one tracker per person, worked as my screenshots above. I’ve switched to not state home for now. For trigger changes like not_home to home I’ll do some testing between device and person trackers.

Where do you put that code?

that’s not actual code, it’s pseudo code I made up to answer the guys question

1 Like

I have the exact same problem, did You found the solution?
I have only one tracker per person.

Not home is not the same as inside a zone. So use a not condition for the state home.

Pulled directly from the docs

condition:
  alias: "Paulus not home AND alarm not disarmed"
  condition: not
  conditions:
    - condition: state
      entity_id: device_tracker.paulus
      state: "home"
1 Like

If it’s simply a matter of tidying up a card’s appearance to add some conformity to person entities displaying in a consistent manner (ie remove the lower case and the underscore, and your card takes templates eg mushroom chips and many others, you could try the following

{{ states('person.your_person_entity').replace('not_home', 'Away').title() }}
which will convert the output to display ‘Away’

or

{{ states('person.your_person_entity').replace('_', ' ').title() }}
to display ‘Not Home’

1 Like

Perfect, thanks petro.
I only recently realised that “away” did not mean away from home if a person was in another zone
Using a “not” condition was the answer for me.

  - condition: not
    conditions:
    - condition: state
      entity_id: person.paula
      state: home
    - condition: state
      entity_id: person.robert_fisher
      state: home
1 Like