Since going from iOS 10.x to 11.x the state location tracking has become super flakey

it actually fired my “i’m home” automation in the middle of the night, turning on all my lights. i had to disable that automation, and checking my logs, it would have fired 6 more times during the night.

- alias: 'Stone Away'
  trigger:
    platform: zone
    entity_id: device_tracker.stones_ios
    zone: zone.home
    event: leave
  action:
    service: script.away

- alias: 'Stone Home'
  trigger:
    platform: zone
    entity_id: device_tracker.stones_ios
    zone: zone.home
    event: enter
  action:
    service: script.arrive

sorry meant to say zone tracking is flakey.

I experienced similar issues. Mine just wouldn’t update my location unless I forced an update in the iOS app using the blue arrow in the lower left corner. Sometimes it would work on it’s own, sometimes it would work once then never again until I reset the app, other times it would only work when I entered a zone and never worked when I exited. After resetting, rebooting, reinstalling the iOS app a few times I kinda gave up and just left it alone and it surprisingly started working. I upgraded my phone and HA at the same time (to 0.54) so I don’t know what caused it, but I ended up reverting back to 0.53.1 of HA and it settled down a couple of days later. Currently zone tracking works about 90% of the time for me.

side note:

i often VPN into my home network from my work computer to mess around with HA. but when i would restart HA it would always assume i was home and turn everything on. so i created an automation to check my location on restart. it HAS NEVER failed to work. always reports correctly. and i dunno what makes this one work 100% and the other is flakey.

- alias: 'Location on Restart'
  trigger:
    platform: homeassistant
    event: start
  condition:
    condition: or
    conditions:
      - condition: zone
        entity_id: device_tracker.stones_ios
        zone: zone.away
      - condition: zone
        entity_id: device_tracker.stones_ios
        zone: zone.work
  action:
    service: script.away

so the more i think about it, it’s likely the zone trigger that’s flakey. what other trigger should i be using?

I had an issue with this in the past, I would show as home but periodically bounce out of my home zone and it would cause issues.

Two things I did…

First is create a generic IP camera with my location. See the bottom of the link below for how to set one up. This is very helpful to see where HA thinks you are. If it is just a little bit off making the zone bigger works, if its way off something else is needed.

Second is to use multiple device trackers. Combine the icloud/ios and wifi or bluetooth. Write an automation to make sure they are all home/not home before taking the action.

how good is owntracks? it’s iOS app has an MQTT publisher, i could push my locations to my broker. granted i’d have to open a port in my firewall, but i can do that.

Owntracks works really well for me. I gave up on the ios tracking feature and have it disabled. I’d say 98-99% reliable. If you are on the edge of a zone you might get some bouncing, but this is kind of expected. Every once in a while I beat the geo-fence detector and open my home door before it thinks I’m home and set off the alarm. This is pretty rare though.

do you still use zones?

Yep. I have all my zones set up in HA and then important ones (have automations) on the phone inside Owntracks. The ones stored in Owntracks trigger the geo-fencing.

The Owntracks zones can be pushed to HA but not the other way around…

I was running into the same issue and went with what I think is the best solution yet. I am using Homebridge to utilize the native Apple Home app to turn on and off an input_boolean when I leave or arrive at different locations. I followed the thread here for inspiration:

I’ve only had this in place a few days now, but it has been 100% reliable thus far. I was never able to obtain that level of reliability when utilizing any other device tracker. This might work for you too assuming you don’t mind setting up Homebridge as well.

thanks. ima try owntracks for a while and see how it goes. but if it frustrates me, then i’ll go your homekit way.

I tried weeks the iOS app and it never worked reliably, no matter what. Finally I switched to OwnTracks and the MQTT plugin in Hassio (disabling the built in broker), set up a home zone with 500m radius and since then it has been 100% reliable with 2 iPhones (me and wife)

I had nothing but problems with IOS location tracking, and it appears that Robbie isn’t making any changes. I switched back to Owntracks.

Guess I’m not the only one having problems with IOS. Guess I too will go back to OwnTracks

I thought I had the IOS device tracker pretty stable, I do not use zone triggers rather I use State triggers.

Just like the suggested by @silvrr but I would send an IOS message with a map to show me where it thought my device was. I also only take highly accurate updates and my device must be in the not_home state for at least 5 minutes before it can trigger away automations.

so far owntracks and state triggers seem to work best. zone triggers didn’t work for shit.

okay after some trial and error here’s what i’ve found work the best for me. ymmv.

like i said above, state triggers on automations and using owntracks publishing to my private broker [with a port opened in my firewall. i used a super high 6xxxx port that NAT translates to 1883 for my pi IP]

two HA zones, home and work. setup the same zones in owntracks. [add as many as you want]

even with all that working it would sometimes kick on all my lights in the middle of the night. the real key seems to be using the MAC address for the BT on the owntracks iphone listed in known_devices, not the wifi MAC.

so now it seems to work reliably.

config:

device_tracker:
  - platform: owntracks
    max_gps_accuracy: 200
    waypoints: True
    waypoint_whitelist:
      - stone

zone:
  name: Home
  latitude: xxxx
  longitude: xxxx
  radius: 200

zone 2:
  name: Work
  latitude: xxxx
  longitude: xxxx
  radius: 200

auto:

- alias: 'Stone Home'
  trigger:
    platform: state
    entity_id: device_tracker.stone_iphone_owntracks
    from: 'not_home'
    to: 'home'
  action:
    service: script.arrive

- alias: 'Stone Away'
  trigger:
    platform: state
    entity_id: device_tracker.stone_iphone_owntracks
    from: 'home'
    to: 'not_home'
  action:
    service: script.away

known:

stone_iphone_owntracks:
  # mac: xx.xx.xx.xx.xx.xx  #wifi
  mac: BT_xx.xx.xx.xx.xx.xx  #BT
  hide_if_away: false
  name: "Stone"
  track: yes
  picture: "/local/stone.jpg"
  vendor:

As a note, on the last update on ‘owntracks’ it says ios11 location fixes. If that required a fix, the HA app might need similar too.