Devicetracking via Owntracks - need advice please

Hi community

I am trying to setup device tracking via Owntracks on iOS including iBeacons. I could set it up but it is yet not fully working as expected.

What I have done so far:

Home Assistant

  • Created a zone in zones.yaml called home in HassOS 4.16, radius 30 meters
  • included zones.yaml in my config.yaml
  • assigned device_tracker ID from Owntracks to persons
  • set owntracks waypoints to false in config.yaml

Owntracks

  • created a region called -home
  • added UUID of my iBeacons to the region
  • circular region -1 which sends location updates to HASS
  • location updates via webhook (not MQTT)

what is working so far

  • Owntracks sees the iBeacons
  • Owntracks recognizes entry/leaves of region
  • HASS recognizes location of the device_trackers

what is not working
If I leave my home Owntracks recognizes it, but HASS doesnt seem to update reliably. sometimes it gets the location update, sometimes I am still at home, but I left the home region and Owntracks confirms that in the history.

As of my understanding HASS should consider me as not_home as soon as Owntracks sends the update that I left the region, right? The region in HASS has a radius of 30 meters, the region in Owntracks less.

Am I doing something wrong or do I have to change some settings? I spent hours to find a solution, but now I am stuck at this point. Hopefully my post can help other people having the same problem/issue.

Many thanks for your help

Kind regards from snowy Switzerland

Andreas

hi @lighthouse - wondering if you ever resolved this…?

I think I’m trying to solve a similar problem. Super high level, I just need events when my phone enters and leaves an ibeacon’s radius – regardless of where that ibeacon is.

Thanks!

yeah, actually I solved the problem :wink: I use personal automations within the Apple Home app on iOS. I created an automation which switches an input.boolean on if I enter the house and vice-versa.

I must say it works very reliable and can be done in minutes! additionally it doesnt drain your battery and you dont have to maintain beacons etc.

give it a try if you use an iOS-device

I found the owntracks HA plugin to be a bit cumbersome. It starts getting weird when it creates a zone that moves, and then my other device trackers have a status of that zone instead of other more important zones like “Home”, etc…

Turns out the Owntracks app just sends webhooks, and you can capture those in HA without the plugin.

You basically set up the Owntracks app the same way you’d do with the HA plugin, the difference is you have to make up your own Webhook ID.

enable some logging so you can see the actualy webhook path that’s being hit:

logger: #add some logging so you can see the exact webhook and event string that is being sent by the owntracks app
  default: info
  logs:
    homeassistant.components.owntracks: debug
    homeassistant.components.webhook: debug

- id: '1655667831291'
  alias: Webhook - Stuff
  description: ''
  trigger:
  - platform: webhook
    webhook_id: SOMEIDHERE #set your webhook ID here.
  condition: []
  action:
  - service: system_log.write
    data:
      level: info
      message: '{{ trigger.json }}'
  - if:
    - condition: template
      value_template: '{{ trigger.json.topic == "owntracks/jsharpe-owntracks/iphone/event" # this event topic is customizeable based on your config settings in Owntracks.  Use the logs you enabled to get the exact string.
        }}'
    then:
    - if:
      - condition: template
        value_template: '{{ trigger.json.event == "enter" }}'
      then:
      - service: input_boolean.turn_on
        data: {}
        target:
          entity_id: input_boolean.some_boolean #toggle some boolean if you just entered. 
      else:
      - service: input_boolean.turn_off #otherwise, turn it off.
        data: {}
        target:
          entity_id: input_boolean.some_boolean