Are secondary known locations also considered "Away" for Person Entities on automations?

I want to trigger an automation when me and my wife are not home. All good there, but I have a doubt now.

In the person entity states I see this options

The thing is, I have a couple of other known locations, for example right now I am at my in-laws so HA shows this:

But there is no “Oma und Opa” in the states above. Is everything “Not Home” considered “Away” ?

I don’t think so, the state of the person entity will be the friendly name of the Zone they are in.

If your goal is to trigger when everyone has left, the better option is to use a Numeric state trigger based on the zone.home entity:

alias: The last person has left the house
trigger: numeric_state
entity_id: zone.home
below: 1
alias: A person has arrived at the previously empty home
trigger: numeric_state
entity_id: zone.home
above: 0

User created Zones are made available in Zone triggers, which have been designed for triggering on entering or exiting a zone.

1 Like

Person state is home and away based on home zone. And as Drew says automate home/away as a numeric state of zone home. <=0 is vacant.

The problem with the zone.home approach is that besides me and my wife, I also have a couple of devices attached to a “Family” Person, and my kids.

I could take into consideration the family devices using <=extra_devices but with my kids no. That would just work if no one is home.

triggers:
  - trigger: template
    value_template: >-
      {{not is_state('person.dad','home') and not is_state('person.mom','home')}}
1 Like

There are a number of ways to do it…

triggers:
  - trigger: state
    from: home
    entity_id:
      - person.a
      - person.b
conditions:
  - not:
      - condition: state
        state: home
        entity_id:
          - person.a
          - person.b

I would probably use a template similar to what @Ildar_Gabdullin showed above, but put it in a binary sensor… there are plenty of things you might want to condition on having at least one parent present in the house, so it makes sense to create a reusable entity.

FWIW, instead of using a “Family” person for devices that are communal, you might consider creating a user that is not attached to a person.

2 Likes

Using a template binary sensor is a really good idea! Thanks. You are right with the communal devices btw. But sometimes I also want to check where one of those devices was forgotten in.

There’s plenty of ways to do that with a template sensor. Breaking them off that communal person fixes soooo many other things you’re having to do workarounds for…

For all of those devices I have an area and a label but they never get assigned to a person because exactly what you’re fighting…

Can you track where they are at without attach them to a person?

You just use the device_tracker entity.

1 Like

Will check it. You are most certainly right.