Location updating doesn't work (very serious problem for my automations)

By any chance are you connected to wifi when it stops working?

I had a number of location issues, but ever since I stopped using wifi at home they went away.

Yes, I am connected to WiFi when it stops working. But I am also connected to WiFi throughout most of the day, since I work from home, and it does not have any problems during that time.

I may as well see what happens if I turn off WiFi over night though, just to rule it out.

Same behavior with WiFi disabled.

Does the same thing happen with other location tracking apps?

Eg life360?

Could be a way to determine if it’s app specific or something else.

I don’t have or use any other location tracking apps, so that is not something that I could test.

I had the idea to flip on a couple of extra sensors last night to see if they showed anything. As additional information - The “Doze Mode” and “App Inactive” sensors stayed in the Off state for the entire night, so that does not appear to be the issue.

I’ve also been checking the Device Tracker each morning to see the Last Update time. So far, it appears to be happening around the same time:

  • 7/17 - 1:33 AM
  • 7/18 - 1:40 AM

Do you have the logs from around this time?

Unfortunately no. Whenever I pull up the app’s logs in the morning (around 7am), they never go back that far. Is there something I can do to pull them from further back?

Yes, setup Logcat Reader this app will show all of the logs on the device. It will require you to use a computer and grant the special USB permissions. Once you get it setup you can dump the logs (remember its all logs on the device from all apps so probably lots of sensitive data) or perform a search. Not sure which way you will find to be easier but you can search by either the time or homeassistant there will be a lot of data present here. The tag LocBroadcastReceiver may be of help too. The thing to remember is that if you find an error you’ll want to clear out the search and focus more on the specific time so we can see errors from other places.

Our internal logcat shows all the logs given to our apps PID and that can change for a number of reasons so that is why it doesn’t go back as far. If the app crashed you should see a Recent Crash tab in our log reader but thats only if the app actually crashed and not just an error. I believe it will show data from last 12 hours so best to check as soon as you notice if it has something.

I looked at Logcat Reader and based on the permissions it wanted, it seemed like I can just throw adb logcat commands at my phone instead, which I’m more comfortable with. Let me know if my understanding is not correct, otherwise I’ll fiddle around a bit and pull the logs down.

Logcat Reader is the easiest way to get the logs. You can also use Android Studio to inspect logcat too. Logcat is always going to give you the logs so you are correct, Android will hold on to logs for a while so anyway you want to retrieve them is fine.

Okay, cool. I use CLIs all day in my work, so I’m perfectly comfortable with that.

Oddly, I did (what should be) a full logcat dump (adb logcat) and it did not go back very far at all. system only went back about a half hour, and main only about 5 minutes. So that didn’t show me anything either.

I was finally able to get a logcat dump that included the time location updates stopped working. I’m not exactly sure what I’m looking for to share here, but here’s an initial attempt.

HA reports that the last location update last night was sent at 11:19:00 PM last night. That lines up with this:

[07-19 23:18:58.442 11945:5495 D/LocBroadcastReceiver] Location update sent successfully

As the last of its kind in the logs. After that, for LocBroadcastReceiver, there’s a bunch of these logs (this is the first) but nothing else:

[07-19 23:19:17.131 11945:12019 D/LocBroadcastReceiver] Forcing of high accuracy mode disabled, because high accuracy mode had to be enabled anyway.

Here are some other lines that seem like they might be relevant:

[07-19 23:18:58.458 19955:20014 I/NotificationPipeline] Processing new notification: 0|io.homeassistant.companion.android|-561227077|null|10289
[07-19 23:18:58.459 3471:3471 D/InterruptionStateProvider] No alerting: filtered notification: 0|io.homeassistant.companion.android|-561227077|null|10289
[07-19 23:18:58.459 19955:20014 W/Notification4Water_NB] NotificationBridgeCallback.onNotificationPosted-Ignored package : [0] io.homeassistant.companion.android
[07-19 23:18:58.459 19931:19969 W/AiAiEcho] SmartspaceNotificationPredictor no parser can handle this notification or notification is invalid
[07-19 23:18:58.460 3471:3471 D/InterruptionStateProvider] No alerting: filtered notification: 0|io.homeassistant.companion.android|-561227077|null|10289
[07-19 23:18:58.461 3471:3471 D/InterruptionStateProvider] No pulsing: notification shouldn't alert: 0|io.homeassistant.companion.android|-561227077|null|10289

GMS getting restarted/sigkilled right after the last location update seems suspicious:

[07-19 23:18:59.096 10192:16612 I/RestartUtil] Restarting.
[07-19 23:18:59.096 10192:16612 I/Process] Sending signal. PID: 10192 SIG: 9
[07-19 23:18:59.213 1803:6410 I/ActivityManager] Process com.google.android.gms.persistent (pid 10192) has died: fg  FGS

With a bunch of logs like this following:

[07-19 23:18:59.223 1803:6410 W/ActivityManager] Scheduling restart of crashed service com.google.android.gms/.nearby.messages.service.NearbyMessagesService in 14608ms for start-requested
1 Like

So this means that the app no longer received an update from Google, we print a log line the moment that happens.

The rest of the logs are out of our apps control, its possible just a google play services issue that hasnt hit all users or is just an edge case as I don’t see anybody commenting on the issue saying they see the same bug. Granted I don’t suspect many users use high accuracy mode for as long as you are, that mode was really made to be used for a short period of time to track zone movement or when not at home.

Have you tried testing not using high accuracy mode at night time to see if the same thing happens?

I definitely agree that there’s some kind of edge case going on here. My wife’s Pixel 3 has High Accuracy on 24/7 and has never at any point had the issues I am having. Clearly something is different, but I don’t know what or how to find out.

That makes sense, as in, it wouldn’t make much sense to have it be on when you’re just sitting at home. I’ve been experimenting with it because up until I started using it, I could never get any geofencing based triggers to work properly and in a timely manner (I’ve had so many problems with the timing of triggering a garage door open when I arrive home, for example). I’d be perfectly content to only have it on when I leave home, but I could only find settings to turn it on when entering a zone as opposed to leaving one.

I have not, and I can see what happens with it, but I don’t think it would matter much since as far as I can tell it’s specific to high accuracy mode breaking.

one thing you can check is if the same Google Play services version is used on both devices

You can actually automate high accuracy mode based on other thigns that trigger in your home, even the phones own wifi sensor. You can try having it turn on when your phone disconnects from home wifi, that sensor updates as soon as it detects a state change. You can also automate it to turn on when connected to cars BT but I am sure you saw that option already.

That seems like it’s worth a try. Thanks for the suggestion. That’d make use of this?

Yeah, I saw that, but I can’t use it because my car is old AF and doesn’t have bluetooth in it :smile:

yup that is correct

I’ve been experimenting with that option for a few days now, and while I thought it would solve my problems, overall it doesn’t.

The part where it turns on and off High Accuracy works, sure, and in a way that prevents the issue with drops in the middle of the night because it’s not on 24/7 anymore. But the original problem I was trying to solve by having it on all the time - poor accuracy and unreliable timing of geolocation based automation - isn’t solved anymore.

I’ve set up automations with zone triggers for our phones - When we leave the Home zone, High Accuracy is turned on. When we enter, it’s turned off. Technically this works, but it works with poor timing. Sometimes the “Leave Home zone” doesn’t get triggered until a mile down the road. Sometimes it doesn’t trigger until another explicitly defined zone (ie, not just “Away”) is entered. It’s not timely or consistent, and other triggers aren’t an option (Bluetooth) or also don’t trigger fast enough (WiFi). So I’m back to needing High Accuracy to be on all the time, and my problem is right back where it started.

For what it’s worth, I’m also experiencing a similar issue. I can’t recall exactly when it started, but if I had to guess it was a week or so ago. Perhaps when my phone (Samsung S21) automatically updated. I can’t tell for sure because for the first few days I chalked it up to luck- every now and then my phone won’t get a chance to update the location between me leaving the house and getting home with some of the poor signal areas around here.

What I find interesting is that the device_tracker entity is not updating, while the geocoded_location one does.


Notice how the device tracker location has not changed at all


While the geocoded location has updated a bunch (sometimes it hops between my house and a neighbor, but it’s correctly sensing my location within ~150 feet)

I did notice I had the single accurate location sensor enabled, and have just disabled it. We will see if that fixes my issue this afternoon. I’m quite puzzled as to why a seemingly standard sensor would totally break the basic location zone sensor.

1 Like