Android Device Tracking

HI All,
Im having an issue getting my Android devices to report locations.

I have My wife’s IOS phone tracking now (after a long struggle) but I cant seam to get any of the household android devices to show.

I have allocated a tracking device ID to each user, and set the devises location sharing as required
but when I talk the device out of the house it is reporting to still be “At home” and not “away” or in a pre determent zone.
my device return is always reporting as home.


the unknows are are when I put the device into airplane mode to test that it is actually reporting.
Android devices are set to allow location at all times with high accuracy reporting.

start here

1 Like

Hay,
I have spent the last couple of hours following this and making sure that all as as should be, but im still not able to get a location away from home (“Away” or at a location)

keep reading those steps for teh logs, that the next step in troubleshooting. Feel free to share here. Just need to mask GPS and URLs.

Thanks,
Im still extremely new to HA and Im finding it to be a very steep learning curve.
I have downloaded the logs but its very extinctive.

I have found in it though, Despite having High accuracy tracking enabled in the companion app, Its reporting false.

look at the logs described in teh step. It tells you what to look for and expect. Make sure to check the logs when you are not at home to see what issue shows up in the logs.

You should see location reports comign in and getting evaluated to be sent or skipped.

it will also give the reason why it is false like was it connected to BT or inside a selected zone etc…

The lgos are very verbose and can be used to follow the entire location decision making process

1 Like

Ill have a look at this when Im at the office tomorrow morning and see what it comes up with

1 Like

I think this is a larger issue… your now the 3rd post reporting such issues. I’m also experiencing this issue.

please also look at the logs after following the steps, they are both designed to help you out and its really the only way to troubleshoot properly.

I have looked at the logs. I didn’t see anything that is related or timestamped at the time of the error. How can I request additional help troubleshooting?

Just post some logs, about 10 minutes to troubleshoot. The app gets updates quite often and also has logic to reset tracking if we detect updates stopped. The app basically requests to Google to send updates on a defined interval and then we wait for updates to come and make a decision on each received report. That’s why it’s important to look at the logs when the issue occurs so we can see why it’s failing. There can be multiple reasons and not every user has the same issue which is why we have so much logging around this.

Do you want the log from the Companion App or the Home Assistant Core?

Companion app, just like the ones described in the link.

--------- beginning of main
09-12 20:50:42.155 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: true, expireMillis: 1694573418918, currentMillis: 1694573442155)
09-12 20:50:42.199 19611 19611 D LocBroadcastReceiver: Received location update.
09-12 20:50:42.201 19611 19611 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
09-12 20:50:42.201 19611 10829 D LocBroadcastReceiver: Last Location:
09-12 20:50:42.201 19611 10829 D LocBroadcastReceiver: Coords:(39.4219232, -104.7791542)
09-12 20:50:42.201 19611 10829 D LocBroadcastReceiver: Accuracy: 53.846397
09-12 20:50:42.201 19611 10829 D LocBroadcastReceiver: Bearing: 0.0
09-12 20:50:42.202 19611 10829 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
09-12 20:50:42.202 19611 10829 D LocBroadcastReceiver: Received location that is 49 milliseconds old, 1694573442153 compared to 1694573442202 with source fused
09-12 20:50:42.202 19611 10829 D LocBroadcastReceiver: Duplicate location received, not sending to HA
09-12 20:50:42.218 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: true, expireMillis: 1694573418918, currentMillis: 1694573442218)
09-12 20:50:42.218 19611 19611 D IntegrationRepository: setAppActive(): true
09-12 20:50:44.904 19611 19611 D SensorReceiver: Received intent: android.intent.action.SCREEN_OFF
09-12 20:50:44.905 19611 19611 D SensorReceiver: Sensor is_interactive corresponding to received event android.intent.action.SCREEN_OFF is disabled, skipping sensors update
09-12 20:50:44.908 19611 19611 D ButtonWidget: Broadcast received:
09-12 20:50:44.908 19611 19611 D ButtonWidget: Broadcast action: android.intent.action.SCREEN_OFF
09-12 20:50:44.908 19611 19611 D ButtonWidget: AppWidgetId: -1
09-12 20:50:44.910 19611 19611 D MediaPlayCtrlsWidget: Broadcast received:
09-12 20:50:44.910 19611 19611 D MediaPlayCtrlsWidget: Broadcast action: android.intent.action.SCREEN_OFF
09-12 20:50:44.910 19611 19611 D MediaPlayCtrlsWidget: AppWidgetId: -1
09-12 20:50:44.919 19611 10829 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:50:44.919 19611 19647 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=cc2060b3-d467-4603-8524-c68839855f18, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
09-12 20:50:45.838 19611 19611 D IntegrationRepository: setAppActive(): false
09-12 20:58:43.891 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1694573446838, currentMillis: 1694573923891)
09-12 20:58:43.988 19611 19611 D IntegrationRepository: setAppActive(): false
09-12 20:58:43.996 19611 19611 D LocBroadcastReceiver: Received location update.
09-12 20:58:43.997 19611 19611 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
09-12 20:58:43.997 19611 10829 D LocBroadcastReceiver: Last Location:
09-12 20:58:43.997 19611 10829 D LocBroadcastReceiver: Coords:(39.4219232, -104.7791542)
09-12 20:58:43.997 19611 10829 D LocBroadcastReceiver: Accuracy: 100.0
09-12 20:58:43.997 19611 10829 D LocBroadcastReceiver: Bearing: 0.0
09-12 20:58:43.997 19611 10829 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
09-12 20:58:43.997 19611 10829 D LocBroadcastReceiver: Received location that is 99 milliseconds old, 1694573923898 compared to 1694573923997 with source fused
09-12 20:58:43.997 19611 10829 D LocBroadcastReceiver: Duplicate location received, not sending to HA
09-12 20:58:44.013 19611 19611 D SensorReceiver: Received intent: android.intent.action.SCREEN_ON
09-12 20:58:44.013 19611 19611 D SensorReceiver: Sensor is_interactive corresponding to received event android.intent.action.SCREEN_ON is disabled, skipping sensors update
09-12 20:58:44.016 19611 19611 D ButtonWidget: Broadcast received:
09-12 20:58:44.016 19611 19611 D ButtonWidget: Broadcast action: android.intent.action.SCREEN_ON
09-12 20:58:44.016 19611 19611 D ButtonWidget: AppWidgetId: -1
09-12 20:58:44.019 19611 10829 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:44.020 19611 19637 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=d50b3ed4-330e-41c3-b819-e4a4d2735bdc, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
09-12 20:58:44.026 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:44.028 19611 19611 D MediaPlayCtrlsWidget: Broadcast received:
09-12 20:58:44.028 19611 19611 D MediaPlayCtrlsWidget: Broadcast action: android.intent.action.SCREEN_ON
09-12 20:58:44.028 19611 19611 D MediaPlayCtrlsWidget: AppWidgetId: -1
09-12 20:58:44.029 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:44.031 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:44.854 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1694573446838, currentMillis: 1694573924854)
09-12 20:58:45.220 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1694573446838, currentMillis: 1694573925220)
09-12 20:58:45.220 19611 19611 D IntegrationRepository: setAppActive(): true
09-12 20:58:54.437 19611 19611 D IntegrationRepository: setAppActive(): false
09-12 20:58:54.450 19611 19611 D WebviewActivity: Matter commissioning status changed to NOT_STARTED
09-12 20:58:54.451 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.452 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.452 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1694573935437, currentMillis: 1694573934452)
09-12 20:58:54.546 19611 19638 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.548 19611 19637 I WM-Processor: Moving WorkSpec (c219db9b-2e74-4139-b2d7-f42192faf5b7) to the foreground
09-12 20:58:54.558 19611 10829 D SensorWorker: Updating all Sensors in foreground.
09-12 20:58:54.558 19611 19637 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=eca5ff61-a60d-4f51-8795-d1b4ed420b27, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
09-12 20:58:54.558 19611 10829 D LastUpdate: Last update is SensorWorker
09-12 20:58:54.559 19611 19796 D WebviewActivity: External bus {“type”:“haptic”,“payload”:{“hapticType”:“failure”},“id”:5}
09-12 20:58:54.562 19611 10829 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.565 19611 19611 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
09-12 20:58:54.565 19611 19611 D WebviewActivity: Processing haptic tag for failure
09-12 20:58:54.602 19611 19796 D WebviewActivity: External bus {“type”:“connection-status”,“payload”:{“event”:“disconnected”},“id”:6}
09-12 20:58:54.606 19611 10829 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.607 19611 10829 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.610 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.610 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1694573935437, currentMillis: 1694573934610)
09-12 20:58:54.620 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.620 19611 19611 D ServerConnectionInfo: Using cloud / remote UI URL
09-12 20:58:54.620 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.620 19611 19611 D ServerConnectionInfo: Using cloud / remote UI URL
09-12 20:58:54.621 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.621 19611 19611 D ServerConnectionInfo: Using cloud / remote UI URL
09-12 20:58:54.621 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:54.621 19611 19611 D ServerConnectionInfo: Using cloud / remote UI URL
09-12 20:58:54.626 19611 19611 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
09-12 20:58:54.631 19611 19611 D LocBroadcastReceiver: Got single accurate location update: Location[fused 39.421923,-104.779154 hAcc=100.0 et=+4h54m22s275ms alt=1854.5 vAcc=100.0]
09-12 20:58:54.631 19611 19611 D LocBroadcastReceiver: Location accurate enough, all done with high accuracy.
09-12 20:58:54.632 19611 19611 D LocBroadcastReceiver: Last Location:
09-12 20:58:54.632 19611 19611 D LocBroadcastReceiver: Coords:(39.4219232, -104.7791542)
09-12 20:58:54.632 19611 19611 D LocBroadcastReceiver: Accuracy: 100.0
09-12 20:58:54.632 19611 19611 D LocBroadcastReceiver: Bearing: 0.0
09-12 20:58:54.632 19611 19611 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
09-12 20:58:54.632 19611 19611 D LocBroadcastReceiver: Received location that is 9782 milliseconds old, 1694573924850 compared to 1694573934632 with source fused
09-12 20:58:54.632 19611 19611 D LocBroadcastReceiver: Duplicate location received, not sending to HA
09-12 20:58:54.710 19611 28468 D TrafficStats: tagSocket(241) with statsTag=0xffffffff, statsUid=-1
09-12 20:58:54.710 19611 28458 D TrafficStats: tagSocket(257) with statsTag=0xffffffff, statsUid=-1
09-12 20:58:55.510 19611 19796 D WebviewActivity: External bus {“type”:“connection-status”,“payload”:{“event”:“connected”},“id”:7}
09-12 20:58:55.512 19611 19611 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:55.583 19611 10829 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:55.846 19611 10829 I SensorReceiver: Sensor updates and sync completed
09-12 20:58:55.846 19611 19637 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=c219db9b-2e74-4139-b2d7-f42192faf5b7, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
09-12 20:58:55.849 19611 19611 I WM-SystemFgDispatcher: Stopping foreground service
09-12 20:58:55.909 19611 19611 D LocBroadcastReceiver: Got single accurate location update: Location[fused 39.421927,-104.779153 hAcc=11.492 et=+4h54m33s5ms alt=1854.5 vAcc=1.3092893]
09-12 20:58:55.909 19611 19611 D LocBroadcastReceiver: Location accurate enough, all done with high accuracy.
09-12 20:58:55.910 19611 19611 D LocBroadcastReceiver: Last Location:
09-12 20:58:55.910 19611 19611 D LocBroadcastReceiver: Coords:(39.4219274, -104.7791533)
09-12 20:58:55.910 19611 19611 D LocBroadcastReceiver: Accuracy: 11.492
09-12 20:58:55.910 19611 19611 D LocBroadcastReceiver: Bearing: 0.0
09-12 20:58:55.911 19611 19611 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
09-12 20:58:55.911 19611 19611 D LocBroadcastReceiver: Received location that is 331 milliseconds old, 1694573935580 compared to 1694573935911 with source fused
09-12 20:58:55.913 19611 22075 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:55.931 19611 19796 D WebviewActivity: External bus {“type”:“theme-update”,“id”:8}
09-12 20:58:55.941 19611 19611 D WebviewActivity: Color from webview is “#101e24-SPACER-#111111
09-12 20:58:55.941 19611 19611 D WebviewActivity: Color from webview is “#101e24-SPACER-#111111
09-12 20:58:55.941 19611 22075 D WebViewPresenterImpl: Try getting color from webview color “#101e24”.
09-12 20:58:55.942 19611 22075 I WebViewPresenterImpl: Found color -15720924.
09-12 20:58:55.942 19611 22075 D WebViewPresenterImpl: Try getting color from webview color “#111111”.
09-12 20:58:55.942 19611 22075 I WebViewPresenterImpl: Found color -15658735.
09-12 20:58:56.066 19611 22075 D LocBroadcastReceiver: Location update sent successfully for 4 as exact
09-12 20:58:57.928 19611 19796 D WebviewActivity: External bus {“type”:“config_screen/show”,“id”:9}
09-12 20:58:57.939 19611 19611 D IntegrationRepository: setAppActive(): false
09-12 20:58:57.940 19611 19611 D IntegrationRepository: setAppActive(): false
09-12 20:58:57.957 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1694573935437, currentMillis: 1694573937957)
09-12 20:58:57.995 19611 19611 D SensorReceiver: Received intent: io.homeassistant.companion.android.UPDATE_SENSORS
09-12 20:58:57.996 19611 19611 D LastUpdate: Last update is io.homeassistant.companion.android.UPDATE_SENSORS
09-12 20:58:57.999 19611 22075 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:58.000 19611 10829 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:58.018 19611 19611 D SettingsWearDetection: API unavailable for discovering nodes (no Wear)
09-12 20:58:58.029 19611 19611 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
09-12 20:58:58.029 19611 19611 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
09-12 20:58:58.039 19611 22075 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:58.039 19611 22075 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:58.053 19611 28458 D TrafficStats: tagSocket(222) with statsTag=0xffffffff, statsUid=-1
09-12 20:58:58.108 19611 19611 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1694573935437, currentMillis: 1694573938108)
09-12 20:58:58.108 19611 19611 D IntegrationRepository: setAppActive(): true
09-12 20:58:58.226 19611 22075 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-12 20:58:58.375 19611 22075 I SensorReceiver: Sensor updates and sync completed
09-12 20:59:04.592 19611 22075 D LogcatReader: Read logcat for pid 19611

The above log is after a reboot of HA. I was able to duplicate the issue at 20:58.

The only two 'FAILURE" messages I see are related to a log entry for hapic feedback… which I do get a vibration on the phone when the error is presented:

09-12 20:58:54.559 19611 19796 D WebviewActivity: External bus {“type”:“haptic”,“payload”:{“hapticType”:“failure”},“id”:5}

09-12 20:58:54.602 19611 19796 D WebviewActivity: External bus {“type”:“connection-status”,“payload”:{“event”:“disconnected”},“id”:6}

There are a few of these which means that an update was sent beforehand, if location has not changed for 15 minutes we skip those updates and this is the log message you should expect to see.

Now interestingly enough the next update we see from anything is 8 minutes later. There should be some more logging in between that. However we are completely dependent on Google for location updates there and if they dont send an update we cant do anything there.

It does not appear location tracking stopped here as we can see an update come in and still be considered a duplicate. We have seen issues in the past where location updates stop completely and we check every 15 minutes to see if we need to restart tracking. This is not hte case here.

looks like it was able to send a location update after all.

There are no location errors here and the ones you see are actually responses from the HA frontend telling the app to process haptic feedback so its not comign from the app.

If you have configured multiple servers in the app double check that your server is enabled for the sensor when you checked 4 step from the troubleshooting link.

I do also see multiple single accurate location requests do you by chance have the “include in sensors update” option enabled for the single accurate location sensor? Its one of the sensors mentioned in step 4 of the link. If you have it enabled try to disable it as it could be interfering with location updates.

so the location updates that you see are from after the error… meaning that once the phone is woken up, the error is presented and immediately the location is updated after. I believe the error is actually from when the phone is sleeping and when HA app should be running as a background service.

your symptoms and logs sound like the app does not have proper access to run in the background. Depending on your device you may have to change more settings than just the background tile mentioned in step 6. Samsung devices for example like to add additional settings you need to change like power savings etc…

dontkillmyapp.com has some good tips here

So after confirming all companion app settings and person.device selections. We are still non closer to reporting away from home.