Location never gets updated if a location update times out
iOS device model, version and app version
Model Name: iPhone Xs Software Version: 13.6 App version: 2020.4.1 (1)
Home Assistant Core Version
0.113.3
Describe the bug I've recently started having trouble with my location getting stuck on away. From reviewing the event logs in the app, it appears that what happens occasionally is the following
- iOS triggers a significant location change
- The app tries to send the location
- The update times out (I'm guessing this is happening as I'm entering my parking garage or getting on the elevator)
- The app tries to re-send the location update but it fails because the update is now too old
- No more updates are attempted
Here are the raw events, in chronological order:
Event 1 from 2:29:17 PM: Didn't update: The operation couldn't be completed. (Shared.OneShotError error1.)
{
"error" : "outOfTime",
"event" : "ZoneManagerEvent(locationChange([<redacted> +\/- 2500.00m (speed 6.59 mps \/ course 155.20) @ 8\/12\/20, 2:29:05 PM <TZ redacted>]))",
"start_ssid" : "none"
}
Event 2 from 2:31:06 PM: Didn't update: The operation couldn't be completed. (Shared.OneShotError error1.)
{
"error" : "outOfTime",
"start_ssid" : "none",
"event" : "ZoneManagerEvent(region(CLCircularRegion (identifier:'zone.home', center:<redacted>, radius:100.00m), inside), zone.home)"
}
Event 3 from 2:36:43 PM: Didn't update: location update from the past
{
"start_ssid" : "none",
"error" : "locationUpdateTooOld",
"event" : "ZoneManagerEvent(locationChange([<redacted> +\/- 2500.00m (speed 6.59 mps \/ course 155.20) @ 8\/12\/20, 2:29:05 PM <TZ redacted>]))"
}
After that it stops trying to send updates for that significant location change
To Reproduce
Interrupt your network connection while the phone is trying to send a significant location update and then restore the network connection
Expected behavior
If an update failed it should not be marked as "too old" when the update is retried
Screenshots
Additional context
The event that's too old wouldn't pass quality threshold - which is why the original location event timed out. You're likely stuck in an annoying iOS background location issue where >=2500m accuracy is the only accuracy the system will return until you restart the device.
Experience the same locationUpdateTooOld bug.
Restarting my iOS device makes the location update experience in the app more accurate only the errors in the log in the eventlog are still being populated.
{
"error" : "locationUpdateTooOld",
"start_ssid" : "redacted",
"event" : "ZoneManagerEvent(locationChange([<redacted> +/- 65.00m (speed -1.00 mps / course -1.00) @ 21-08-2020 02:29:22 Midden-Europese zomertijd]))"
}
iOS device model, version and app version
Model Name: iPhone X Software Version: 13.6 App version: 2020.5.2 (1)
Home Assistant Core Version
0.114.3
I'm seeing the same issue on 13.6.1. I suspect it's failing as my phone switches between WiFi and 4G? Although it was solid before iOS 13.5, and worked after the location fixes for that version until 13.6. I also tend to have my phone on airplane mode overnight, and when I started it and went for a walk this morning the last location update was from the previous night.
"error": "locationUpdateTooOld" with 65m accuracy
I'm seeing this same issue with the "outOfTime" OneShotError. Unfortunately it seems to happen every time I leave the house and I never get marked away. Manual location updates whether on wifi or LTE work fine, and entering the home zone seems to work, so I can only imagine it's the transition from wifi to LTE as I leave.
I did notice that Siri was also having connections issues as I left the house and asked for navigation directions, so maybe it's an issue with iOS 13.6 that is causing the transition to be less graceful? I also use CarPlay too. I may have to try taking a walk around the neighborhood tomorrow to see if I see the same issue.
same issue still happen with ios13.7, can anyone kindly check this?
I'm also having this issue. iOS 13.6.1. I restarted my phone and still seeing lots of "Didn't update: location update from the past" in my logs. Location accuracy is +/- 65m.
Since updating to iOS 13.7 I do not seem to be having this issue any longer. I've left the house both on foot and by car a couple of times, and have left the home zone and been marked away as expected.
is location update need access hass from outside? my hass is in local network(192.xxx), tried duckdns things but failed seems port is closed.is that the problem?
(I'm going to be extremely verbose here because I think this issue is easy to accidentally discover when searching for location update issues.)
There's 2 issues mentioned above that I'd like to address:
-
"too old" logs on startup. This is a red herring - iOS delivers to the app a very old location on startup, which we ignore so that we don't waste battery trying to pull a location fix if we don't think you've moved. If we're told about a recent location change or region change, we'll still perform a location update, even if this log happens. #816 is tracking removing the log.
-
"out of time" errors when updating location. This is due to accuracy: if we detect extremely poor (>2500m) accuracy location updates, we choose to ignore them and not update the location. If you're seeing 65m for some of the locations, that's likely a Wi-Fi value -- and if it's a 'too old' value, it is almost certainly timestamp-wise too old to be used at that time.
The poor accuracy location updates are a systemic issue in the iOS 13.4+ location delivery systems. Restarting the phone clears this up when it's happening, and we've noted it happening in more than just the HA app. If iOS 13.7 resolves this, I encourage upgrading and seeing if it resolves location issues you're having.
At the time of writing this, 2020.5.2 is the latest app on the App Store and it has one known location issue that 2020.6 (likely being released in 1-2 weeks) resolves which is entering/exiting a zone where the GPS accuracy puts you slightly (centimeters to meters) outside or inside of the zone when it is incorrect. This one should show up as a successful location update that puts you right on the border. You can try this fix out via joining the TestFlight.
If you are still experiencing location issues, the above did not address your specific problems, and you definitely have external access, please open a new issue so we can work through it. The original poster here did a great job of including logs, which helped narrow down the issue to the iOS background bug; great logs from a new issue can also help address it faster.
You can also get help by joining the Discord which is a great way to get synchronous information about location data -- it often requires doing things like latitude/longitude distance math based on timestamps, and that's potentially personal information that you may not want to live forever in a GitHub issue.