Simple proximity automation not triggering

I am trying to use the proximity integration but upon testing a simple automation, nothing triggers.

I have set up in the people, the device tracker for “pam”. Her iPhone has the home assistant companion app and I have a home zone set up around my house but the automation does not trigger. Hoping someone might be able to help me sort out what isn’t happening.
The sensor in the proximity integration is set to meters, so I have 3200 for the trigger to my iPhone that she is nearing home.

I can see in the proximity integration that she goes, away from, towards and arrived.

alias: pam is nearing home test
description: “”
triggers:

  • alias: Pam 2 miles from home
    entity_id:
    • sensor.home_pam_direction_of_travel
      below: 3200
      enabled: true
      attribute: towards
      trigger: numeric_state
      conditions:
      actions:
  • action: notify.mobile_app_iphone_michelle
    data:
    message: On her way home
    mode: single

When you post code–which you always should, because it helps people help you–please use the Preformatted Text option </> in the editor. It’s hard to tell if you might have an indentation problem, so please repost the code with that.

Have you checked in Development Tools → States that sensor.home_pam_direction_of_travel is actually a number, that it actually reflects the distance of the iPhone from your home (when at home and when not), and that it actually crosses from above 3200 to below 3200 when you expect the automation to trigger?

I think you may be mixing properties from the current version of Proximity with those from the older version when the integration used proximity entities.

There is no attribute named “towards” in the “Direction of Travel” sensor; “towards” is one of the possible states for the sensor… none of which are numeric. You should be triggering off the state of the “Distance” sensor. You can use the state of the “Direction of Travel” sensor in a condition:

triggers:
  - trigger: numeric_state
    below: 3200
    entity_id: sensor.home_pam_distance
conditions:
  - condition: state
    entity_id: sensor.home_pam_direction_of_travel
    state: towards
....

Actually, although I haven’t used the proximity integration, this statement makes me think that you’re using the wrong sensor or the wrong part of the sensor. Do you mean that the state of the sensor is actually “towards,” “arrived,” etc.? If so, you need to find the entity name of a sensor that actually gives you a numeric distance value and use that in your automation.

Ah, that might be the main or even only problem. Didn’t notice that.

Thanks for the feedback. I used to use the old proximity and had no issues with it. I guess I still have the old mindset with it. I will try your suggestion.

Thanks for pointing this out to me. I will be mindful the next time I need to post yaml code here.