Proximity advice and help me please

Hello

I’m struggling to get proximity to work. I think I have it setup correctly but them when I drive to work, the automation doesn’t trigger. Am I doing something wrong or am I missing the point of proximity? It can be used when travelling towards a zone, in this case home… so I could setup another called work etc?

Do I need to exclude all zones not used by the one setup?

Config file

proximity:
  home:
    devices:
      device_tracker.mark
    tolerance: 50
    unit_of_measurement: km

automation

alias: Mark on his way to work
trigger:
  - platform: numeric_state
    entity_id: proximity.home
    value_template: '{{ states.proximity.home.state | float }}'
    above: 10

condition:
  condition: and
  conditions:
  - condition: template
    value_template: '{{ states.proximity.home.attributes.dir_of_travel == "away_from"  and (states.proximity.home.state | float) >= 10}}'
  - condition: state
    entity_id: device_tracker.mark
    state: 'not_home'
action:
   - service: notify.notify_mark
     data:
       title: "going to work"
       message: "you are on your way to work"

Cheers
Mark

just in case anyone else has issues… I was trying to be too smart and now it works… working code below.

alias: Mark on his way home
trigger:
  - platform: numeric_state
    entity_id: proximity.home
    below: 0.4

condition:
  condition: and
  conditions:
  - condition: template
    value_template: '{{ states.proximity.home.attributes.dir_of_travel == "towards" }}'
  - condition: state
    entity_id: device_tracker.mark
    state: 'not_home'
action:
   - service: notify.notify_mark
     data:
       title: "going HOME"
       message: "almost HOME!!"
2 Likes

Did you still need to put the proximity bit in the config yaml file?

Your solution only seems to have the automation.yaml part?

Yes, TeeHee, knew i had looked at this before.