Owntracks location triggers and the iPhone

I’m trying to get location tracking working reliably on my iPhone and I’d like to check my configuration with the folks here. I’ve tried a few different options:

  • Only use Hass zones and let Owntracks regularly report location automatically

    It seemed like this was working when I left my house, but it failed to trigger when I was coming home. As soon as I manually sent a location from the Owntracks app, it immediately realized I was in my garage :). It seems like relying on the heuristics that iOS uses to report location based on movement over time aren’t precise enough for what I want to do.

  • Owntracks regions + Hass zones with different radii

    This seems to be promising in that OT registers directly with iOS to do region tracking and seems to be more precise than relying on OT to report its location quickly and regularly. This also seemed to work okay at first, but I found that the recommendation to make the Hass zone slightly smaller than the OT region led to false “away” triggers, and I just basically got a lot of false triggers when the iPhone was asleep and would wake up. I couldn’t figure out how to modify my configuration to filter the noise, so I moved to #3:

  • Owntracks regions + Hass zones with the same radii

    This also seemed to work at first, but the problem that I ran into last night was that the iPhone would go to sleep, wake up and suddenly report a location a mile away. That triggered my “away” automation. Then the phone would come to its senses and see that it was in my house, report that location, which would trigger the “home” automation. This was all with the max_gps_accuracy set to 65m, so somehow the far away location was still triggering “away”.

    I surmised that it had something to do with the “consider_home” parameter, which treats a disappearance of the phone for x time as “not home”. I extended that from the default of 3mins to 60mins, and sure enough, the iPhone woke up every hour to report “away”, followed shortly thereafter by “home”.

My strategy tonight is to stick with just OT regions and adjust the “consider_home” parameter to something gigantic like 99 hours to prevent the periodic wakeups and bad readings. Does that reasonable? I’d prefer to just disable “consider_home”, but it doesn’t look like that’s possible without modifying the device_tracker component.

Incidentally, I was using Locative with my ISY994 and it was nearly flawless, but I like the additional telemetry that Owntracks provides (battery level, etc.) and I’d like to use something that’s actually maintained.

With the last option, I did have a false “away” trigger during the day yesterday with a location that was about a mile away. Looking at my configuration.yaml, I realized that I had “max_gps_accuracy” tag here:

  - platform: owntracks
    consider_home: '99:00:00'
    max_gps_accuracy: 65
  - platform: locative
    consider_home: '99:00:00'

Which is incorrect. It belongs in the separate owntracks section:

  max_gps_accuracy: 65

After fixing that, I now see logs indicating that less accurate location reports are being properly rejected. The next weird thing was that I still got an “enter” trigger with an GPS accuracy of 200m, well beyond the 65m that I requested. I looked at the code for the Owntracks component and I see that it checks the accuracy when exiting a zone, but not when entering a zone. This makes sense to me because false “away” triggers are far more annoying than false “enter” triggers, and I wouldn’t want to miss an “enter” trigger due to low GPS accuracy. Based on the code, the max_gps_accuracy value only applies in the following cases:

  • When getting an unsolicited location post
  • When Owntracks reports that the phone is exiting a zone

I’ll continue to monitor, but I hope this is of some use to someone.