Device tracker showing stationary when actually going towards to the Home

Recently I created some automation to open a gate when coming home, it sometimes works, and sometimes it doesn’t. When the gate is not opened the automation trace says that the travel_direction was stationary instead of towards but actually when looking at the history it looks like towards.

Here are the graphs of recent journey from the history (aligned one below another to showcase what happened):

  • Direction of Travel to Home (below graph) is just my template_sensor that picks the value from the proximity sensor (top graph) and it looks like that in the config:
  - sensor:
    - name: "Direction of Travel to Home"
      state: "{{ state_attr('proximity.home', 'dir_of_travel') }}"
  • proximity is just a copy and paste from the docs
      - device_tracker.pixel_6
    tolerance: 50
    unit_of_measurement: m

To me, it looks that from 12:17:48 to 12:18:24 it’s actually stationary but the rest should be towards, however it’s not.

Do you have any idea how can I adjust this to make this direction of travel more precise?

I don’t want to hack it to exclude stationary and keep last status that is not stationary in my template sensor value because that could cause some false openings.

I’ll try with smaller tolerance on proximity sensor :crossed_fingers:

changing tolerance to 20 worked like a charm. Thanks for rubber ducking :duck: :slight_smile: