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

Thanks for the feedback, it’s appreciated. I have read the thread thoroughly and included all the troubleshooting steps for device tracking and all my settings were set correctly.

When I compare historic data for both the device tracker and geocode location I can see the geocode location is updating but the device tracker is not.

That is not a fair comparison, they use different APIs. If you continue following the troubleshooting steps for the device the next step would be to look at companion app logs and compare it to the example.

Update:

I thought the problem had been solved. I’m not sure if it was disabling Include in Sensor Update or not (I also tried unhiding all HA notifications just in case that somehow affected its persistence in the background), but all day yesterday the location access indicator stayed active, and I was getting the accurate, frequent updates I wanted every time I checked.

However, this morning, the location access icon was gone, and the HA app was behaving very strangely. Normally when this happens, I can pop it into the foreground and it starts pulling location data again, even if it is only for a few minutes. This time, however, even killing and restarting the app did not do this. It wasn’t until I tried going into Manage Sensors and disabling then re-enabling High Accuracy Mode that it started pulling and sending location data again.

without the logs at the time the issue happened its going to be very difficult to troubleshoot

Same thing happened again overnight last night. I also noted that the High Accuracy Location notification from HA was still present. It seems that the HA app thought it was still running High Accuracy even though it was not.

Logs from before I disabled and re-enabled high accuracy mode in the app:

07-10 06:55:24.782 20644  6543 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 06:55:24.784 20644  6543 D SensorWorker: Updating all Sensors.
07-10 06:55:24.787 20644 20677 I WM-Processor: Moving WorkSpec (f427fcf9-2b13-4b35-bc00-ccd39089bd50) to the foreground
07-10 06:55:24.800 20644 20644 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
07-10 06:55:24.807 20644  6543 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 06:55:24.878 20644  6544 D LocBroadcastReceiver: Forcing of high accuracy mode disabled, because high accuracy mode had to be enabled anyway.
07-10 06:55:24.888 20644 20644 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = true
07-10 06:55:24.913 20644  6543 D SensorReceiver: Nothing to update
07-10 06:55:24.914 20644 20686 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=f427fcf9-2b13-4b35-bc00-ccd39089bd50, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
07-10 06:55:24.920 20644 20644 I WM-SystemFgDispatcher: Stopping foreground service
07-10 06:58:07.238 20644  6544 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 06:58:07.239 20644 20686 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=196770e3-be07-4875-9bd2-2c818ba24518, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
07-10 07:00:00.032 20644 20644 D SensorReceiver: Received intent: android.media.RINGER_MODE_CHANGED
07-10 07:00:00.032 20644 20644 D SensorReceiver: Sensor audio_sensor corresponding to received event android.media.RINGER_MODE_CHANGED is disabled, skipping sensors update
07-10 07:00:00.036 20644 20644 D SensorReceiver: Received intent: android.app.action.INTERRUPTION_FILTER_CHANGED
07-10 07:00:00.036 20644 20644 D SensorReceiver: Sensor dnd_sensor corresponding to received event android.app.action.INTERRUPTION_FILTER_CHANGED is disabled, skipping sensors update
07-10 07:00:19.460 20644 20644 D SensorReceiver: Received intent: android.intent.action.SCREEN_ON
07-10 07:00:19.465 20644 20644 D SensorReceiver: Sensor is_interactive corresponding to received event android.intent.action.SCREEN_ON is disabled, skipping sensors update
07-10 07:00:19.469 20644 20644 D ButtonWidget: Broadcast received: 
07-10 07:00:19.469 20644 20644 D ButtonWidget: Broadcast action: android.intent.action.SCREEN_ON
07-10 07:00:19.469 20644 20644 D ButtonWidget: AppWidgetId: -1
07-10 07:00:19.495 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:00:19.503 20644 20644 D MediaPlayCtrlsWidget: Broadcast received: 
07-10 07:00:19.503 20644 20644 D MediaPlayCtrlsWidget: Broadcast action: android.intent.action.SCREEN_ON
07-10 07:00:19.503 20644 20644 D MediaPlayCtrlsWidget: AppWidgetId: -1
07-10 07:00:19.506 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:00:19.508 20644  6544 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:00:19.508 20644 20677 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=c7502906-a99b-4549-88dd-6739a282e07c, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
07-10 07:00:19.509 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:16.776 20644 20644 D SensorReceiver: Received intent: android.intent.action.ACTION_POWER_DISCONNECTED
07-10 07:01:16.789 20644  6544 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:16.907 20644  6543 D LocBroadcastReceiver: Forcing of high accuracy mode disabled, because high accuracy mode had to be enabled anyway.
07-10 07:01:16.916 20644 20644 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = true
07-10 07:01:16.946 20644  6544 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:22.858 20644 13867 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:22.923 20644 20644 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = true
07-10 07:01:22.936 20644  6544 D LocBroadcastReceiver: Forcing of high accuracy mode disabled, because high accuracy mode had to be enabled anyway.
07-10 07:01:22.973 20644 13867 D SensorReceiver: Nothing to update
07-10 07:01:24.703 20644 20644 D SensorReceiver: Received intent: android.intent.action.SCREEN_OFF
07-10 07:01:24.703 20644 20644 D SensorReceiver: Sensor is_interactive corresponding to received event android.intent.action.SCREEN_OFF is disabled, skipping sensors update
07-10 07:01:24.705 20644 20644 D ButtonWidget: Broadcast received: 
07-10 07:01:24.705 20644 20644 D ButtonWidget: Broadcast action: android.intent.action.SCREEN_OFF
07-10 07:01:24.705 20644 20644 D ButtonWidget: AppWidgetId: -1
07-10 07:01:24.709 20644 20644 D MediaPlayCtrlsWidget: Broadcast received: 
07-10 07:01:24.709 20644 20644 D MediaPlayCtrlsWidget: Broadcast action: android.intent.action.SCREEN_OFF
07-10 07:01:24.709 20644 20644 D MediaPlayCtrlsWidget: AppWidgetId: -1
07-10 07:01:24.737 20644 13867 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:24.738 20644 20677 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=c335e3bc-1d16-463c-a2a1-f1e88bbea3be, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
07-10 07:01:26.639 20644 20644 D SensorReceiver: Received intent: android.intent.action.SCREEN_ON
07-10 07:01:26.640 20644 20644 D SensorReceiver: Sensor is_interactive corresponding to received event android.intent.action.SCREEN_ON is disabled, skipping sensors update
07-10 07:01:26.641 20644 20644 D ButtonWidget: Broadcast received: 
07-10 07:01:26.641 20644 20644 D ButtonWidget: Broadcast action: android.intent.action.SCREEN_ON
07-10 07:01:26.641 20644 20644 D ButtonWidget: AppWidgetId: -1
07-10 07:01:26.655 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:26.655 20644 20644 D MediaPlayCtrlsWidget: Broadcast received: 
07-10 07:01:26.655 20644 20644 D MediaPlayCtrlsWidget: Broadcast action: android.intent.action.SCREEN_ON
07-10 07:01:26.655 20644 20644 D MediaPlayCtrlsWidget: AppWidgetId: -1
07-10 07:01:26.664 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:26.667 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:26.668 20644 13867 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:26.669 20644 20686 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=8e514b2a-90f4-49ee-95c5-ad8076d596e7, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
07-10 07:01:34.828 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:34.828 20644 20644 D UrlRepository: Using external URL
07-10 07:01:34.828 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:34.880 20644  6544 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:35.098 20644 20644 I System.out: recordForce value 5
07-10 07:01:35.098 20644 20644 D WebviewActivity: Current webview package com.google.android.webview and version 103.0.5060.71
07-10 07:01:35.276 20644 25699 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:35.277 20644  6543 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:35.277 20644 25699 D SensorWorker: Updating all Sensors.
07-10 07:01:35.278 20644 20687 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=eb4cfd20-6162-4f9d-a5c8-080b051711fa, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
07-10 07:01:35.282 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:35.282 20644 20644 D UrlRepository: Using external URL
07-10 07:01:35.285 20644 20687 I WM-Processor: Moving WorkSpec (4d7cda4b-48a7-4031-918f-ec6bf888f6c6) to the foreground
07-10 07:01:35.290 20644 25699 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:35.303 20644 20644 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
07-10 07:01:35.329 20644 13867 D LocBroadcastReceiver: Forcing of high accuracy mode disabled, because high accuracy mode had to be enabled anyway.
07-10 07:01:35.350 20644 25699 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:35.602 20644 20644 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = true
07-10 07:01:35.823 20644 20971 D WebviewActivity: External bus {"type":"config/get","id":1}
07-10 07:01:35.823 20644 20644 D WebviewActivity: externalBus({"id":1,"type":"result","success":true,"result":{"hasSettingsScreen":true,"canWriteTag":true,"hasExoPlayer":true}});
07-10 07:01:35.839 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:35.839 20644 20644 D UrlRepository: Using external URL
07-10 07:01:35.841 20644 20644 D WebviewActivity: Callback null
07-10 07:01:35.843 20644 20644 E WebviewActivity: Cannot set status bar color 0. Skipping coloring...
07-10 07:01:35.843 20644 20644 E WebviewActivity: Cannot set navigation bar color 0. Skipping coloring...
07-10 07:01:36.474 20644 20971 D WebviewActivity: External bus {"type":"connection-status","payload":{"event":"connected"},"id":2}
07-10 07:01:36.475 20644 20644 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:36.526 20644 20685 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=4d7cda4b-48a7-4031-918f-ec6bf888f6c6, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
07-10 07:01:36.527 20644 20644 I WM-SystemFgDispatcher: Stopping foreground service
07-10 07:01:36.769 20644 20971 D WebviewActivity: External bus {"type":"theme-update","id":3}
07-10 07:01:36.777 20644 20644 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
07-10 07:01:36.777 20644 20644 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
07-10 07:01:36.777 20644 25699 D WebViewPresenterImpl: Try getting color from webview color "#101e24".
07-10 07:01:36.778 20644 25699 I WebViewPresenterImpl: Found color -15720924.
07-10 07:01:36.778 20644  6543 D WebViewPresenterImpl: Try getting color from webview color "#111111".
07-10 07:01:36.778 20644  6543 I WebViewPresenterImpl: Found color -15658735.
07-10 07:01:45.173 20644 20971 D WebviewActivity: External bus {"type":"config_screen/show","id":4}
07-10 07:01:45.211 20644 20644 D UrlRepository: Using external URL
07-10 07:01:45.211 20644 20644 D UrlRepository: Using external URL
07-10 07:01:45.215 20644 20644 D UrlRepository: Using external URL
07-10 07:01:45.215 20644 20644 D UrlRepository: Using external URL
07-10 07:01:45.299 20644  6543 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:45.300 20644  6543 D SensorWorker: Updating all Sensors.
07-10 07:01:45.304 20644 20677 I WM-Processor: Moving WorkSpec (feccc2e9-43a0-490b-863f-c07ee00d8953) to the foreground
07-10 07:01:45.310 20644  6543 D UrlRepository: localUrl is: false and usesInternalSsid is: true
07-10 07:01:45.328 20644 20644 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
07-10 07:01:45.353 20644 20644 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = true
07-10 07:01:45.361 20644 25699 D LocBroadcastReceiver: Forcing of high accuracy mode disabled, because high accuracy mode had to be enabled anyway.
07-10 07:01:45.374 20644  6543 D SensorReceiver: Nothing to update
07-10 07:01:45.374 20644 20685 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=feccc2e9-43a0-490b-863f-c07ee00d8953, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
07-10 07:01:45.377 20644 20644 I WM-SystemFgDispatcher: Stopping foreground service
07-10 07:01:51.626 20644  6543 D LogcatReader: Read logcat for pid 20644

I also captured logs immediately after I disabled/re-enabled. Let me know if you want me to post those.

looks like Google just stopped sending the app updates, nothing the app can do then because all we do is send a request to Google and they send back the updates. We depend on Google sending us the updates so we can send location updates to HA.

That makes sense, but also doesn’t. Why did it start working as expected, immediately, when I disabled/re-enabled High Accuracy Mode in the HA app? Why was that the only thing I could do that made it start working again? Why would Google just decide to stop sending location updates? Why did everything function as expected all day long yesterday, then suddenly stop overnight at some point?

I am having the same issue as Mdoliver, the app accurately shows my location, but it is not being updated correctly in Home Assistant. This started with the newest update 2022.7.3 both on my Samsung Galaxy S20 and my wife’s Pixel 6 Before the 2022.7.0 update things worked perfectly, I have changed no settings within the companion app or my phone.

This has now happened every night. HA stops reporting location data at some point overnight, and will never start again on its own until I disable/re-enable the location sensor manually.

These are all questions better asked to Google. From the apps standpoint all we do is make a request and wait for updates, we don’t have any other control other than that.

Looking at Googles online issue tracker seems our app is not alone in the symptoms: Google Issue Tracker

Check all the points mentioned above, there is 1 troubleshooting section you’ll need to start with. Also HA core does not have any impact on google services location tracking, what you are seeing is a placebo effect in that regard.

You can probably get by with force stopping the app and re-opening it, that also causes location to re-register. You may need to wait a few minutes for the first update to show up.

Are you just seeing location updates stop or are you seeing zone movement stop as well? For example if you have been in the same location overnight, after you leave that zone do you see updates showing you leaving the zone? Zone updates are a different API from background location, both of which still depend on Google to supply updates after the app makes a request.

I don’t know. I’ll have to test it tomorrow and report back (assuming it happens again overnight tonight).

I had the chance to test this out today. I didn’t disable/re-enable high accuracy mode beforehand, and left it in whatever state it got itself into overnight. It appears that I’m still seeing zone tracking continue even though high accuracy location does not. Here’s what I observed:

I have the standard Home zone that HA sets up, and a wider area around it called “Almost Home”. When I left my house today, it picked up when I left the Home zone, and when I left the Almost Home zone (it left my location stuck on the outer edge of Almost Home at the point I exited it when it set me to Away, though). I also have an automation that I’ve been testing that is supposed to trigger when I go from Almost Home to Home, and that fired off right as I pulled into my driveway (as I would want/expect it to). But, there’s no other location history.

So in our beta we have a few location fixes, some already merged and some in progress. During code review we came to find that the same intent was used for both High Accuracy and background location updates. I am not entirely sure on why its stopping the way it is but since you are able to reproduce this pretty easily would you mind testing the debug full version APK from: Minor location update fixes · home-assistant/android@40e2424 · GitHub

This will install side by side the production and you can give the device a new name to separate them. The icon will also be red so its easy to distinguish between them.

I don’t know if it will solve the problem but it would be good to make sure it doesn’t make things worse for you.

Good to know that geofencing is working as that uses its own custom intent so I have some hope in the debug APK.

1 Like

Yeah, I can give that APK a try. I should be able to get it set up later today and see what happens with it overnight.

1 Like

It doesn’t look like I can actually download anything from that link.

I think you need to be signed into GitHub to see the download links at the bottom

Looks like that was it. Kind of obnoxious but whatever. I’ll get it set up today so I can test it overnight/tomorrow.

1 Like

Same behavior with that debug APK.

1 Like

Thanks for check that out. At this point please file an issue on github and include the logs that you have gathered so far. Lets see if other team members are able to make sense of the situation here. Make sure to be as descriptive as possible and also fill out the issue template.

Done!

1 Like