How to create automations from UI based on home status of persons or numeric status of num people home

Hi all,

I have tried absolutely everything and the automations dont fire.

I set if state Beau changes to “away” or even upper case “Away” or even “Home to Away” - does not work. It’s broken AFAIK. Or poor UX. It seems to work seldomly or did in past but not now.

Also numeric attribute if I set Home below 1 it does not fire either. Yet logs show state is changes

alias: Turn Off Home When Away
description: ''
trigger:
  - platform: state
    entity_id:
      - person.beau
    to: away
  - platform: device
    device_id: b2f8ee385b1fb6e1c4e1cd9caba7574e
    domain: device_tracker
    entity_id: device_tracker.pixel_6 #THIS IS THE ONLY TRIGGER THAT ACTUALLY WORKS....
    type: leaves
    zone: zone.home
    enabled: false
  - platform: numeric_state
    entity_id: zone.home
    below: '1'
    attribute: ''
  - platform: state
    entity_id:
      - person.beau
    to: Away
  - platform: state
    entity_id:
      - person.beau
    to: Away
    from: Home
  - platform: state
    entity_id:
      - person.beau
    to: away
    from: home
condition: []
action:
  - service: light.turn_off
    data: {}
    target:
      area_id:
        - 50625645354941a8873f77be238cd62a
        - c65f2ff655564d02a7ce3a6f61f4736c
  - service: switch.turn_off
    data: {}
    target:
      area_id:
        - c65f2ff655564d02a7ce3a6f61f4736c
        - 50625645354941a8873f77be238cd62a
  - service: media_player.media_pause
    data: {}
    target:
      entity_id: media_player.home_group
mode: single

Here it is going away. So the sensors work fine. I found that the only trigger that works is the device tracker for my pixel6.

How can one use the “away” state of persons or the “numeric” state of home? What am I doing wrong? This worked in the past!

This shows what the Ui is saying not necessarily what the actual state is.

Try looking at the actual state in developer tools / states, that way you will be able to see that actual states the are required with the exact syntax.

You are probably looking for ‘not_home’ as apposed to ‘away’

Nope. It never did.

The state you see in the frontend (Lovelace) is a translation of the actual state in the states page.

device trackers are either “home” or “not_home”. They always have been.

Persons are either “home”, “not_home” or if they are in a certain defined zone the state is shown as that zone. They have been that way as long as I can remember.

Numeric state triggers checking the state of a zone should use the actual state. You have it looking at a null attribute ("attribute: '') so that is likely why that isn’t working.

you should use “not_home” instead of “away/Away”. And remove the “attribute” line from the numeric state trigger.

However, remember that a person state can also be in a zone so if you have a zone defined right next to the home zone the person could technically go from being “home” to being in the other zone and never be “not_home”.

In that case it might be better to use the device_tracker the person entity is based on instead of the person entity itself

Or you could possibly use “from: home” for the person entity and that should work too as far as I know.