Life360 + entity.person + conditional card: not_home only works if not moving

I have a conditional card that shows a map of where I am when I am not home. That is, the rule is “If my person.jerad entity is not_home, show the map of where I am.”

card:
  aspect_ratio: 969
  dark_mode: false
  default_zoom: 14
  entities:
    - person.jerad
  title: Dad
  type: map
conditions:
  - entity: person.jerad
    state: not_home
type: conditional

There’s one for my wife, too. We use Life360 as our presence detection. When we are not moving or not driving, it works fine; when we are home, it works, too, in that it doesn’t display the map. But whenever Life360 shows us a “moving” or “driving,” the map is not visible. It’s as if those two conditions are not the same as “not_home.”

Any thoughts as to why this is happening? Is it an error in the logic, or am I doing something wrong?

Best regards,

Jerad

They aren’t. home, not_home, moving and driving are four distinct states.

What I’d suggest is using state_not: home instead of state: not_home.

2 Likes

Perfect. Thank you.

1 Like

BTW, if you ever add zones to HA then the state of your device_tracker and person entities will also change to the name of the zone if you enter one. Another reason not to use not_home. :slightly_smiling_face:

great card! using Bing up to now to do this, but this seems so much nicer and more flexible.

only thing I would love to change is the size of the map ( a bit smalle would do), is that possible?
btw what aspect ratio are you using, seems different from what is prescribed here: Map card - Home Assistant ?

16x10 works great as a map ratio, IMO.

Here’s my final code:

cards:
  - card:
      aspect_ratio: 16x10
      dark_mode: false
      default_zoom: 14
      entities:
        - person.jerad
      title: Jerad
      type: map
    conditions:
      - entity: person.jerad
        state_not: home
    type: conditional
  - card:
      aspect_ratio: 16x10
      dark_mode: false
      default_zoom: 14
      entities:
        - person.shannon
      title: Shannon
      type: map
    conditions:
      - entity: person.shannon
        state_not: home
    type: conditional
  - card:
      entities:
        - person.jerad
        - person.shannon
      type: glance
    conditions:
      - entity: binary_sensor.someone_gone
        state: 'on'
    type: conditional
type: vertical-stack

For clarification, I have the following set:

input_boolean.guest_mode: an input_boolean in case we have people over at the house but we are gone, e.g., grandparents watching the kiddos

binary_sensor.someone_gone: a binary sensor that is ON if at least one person is not home (state_not: home). This is used to control when lights come on and go off (in addition to a “turn on indoor lights” sensor.

binary_sensor.someone_home: a binary sensor for when someone is home. It’s also true if Guest_Mode is on.

With this config, the maps will only display the map of the person who is not home. If both people are home, then the maps are hidden. The glance card is added to show the Life 360 state (moving, driving, away, home) and only appears if one person is away.

My only concern is if someone breaks into my house, they now know where we are and how much time will pass before we can be home. I have some ideas to work around that, but that’s not a high priority at this point.

I have this displayed on a 10" tablet in the living room. I also have a condition that will show the camera inside the garage if one of the garage doors is open.

In the picture I included, I zoomed in on the maps to avoid giving away location data. The zoom level in my code seems to work really well.

Thank you for this tip. I have added several zones now, and it greatly improves the usefulness of the person status.