High accuracy mode turns on randomly

The goal: have home assistant companion app turn on high accuracy location mode when I’m driving/walking/biking between various locations. I don’t need want it on at home/work/etc, I just want to know between, and I don’t use it for automation triggering at home.

I have the companion app installed on my pixel 4. v. beta-10008-d81913b7-full. HA in docker currently on the 2023.3.6 build.

In the app, I have my sensors update frequency always at 1 min. I have geocoded location on (but not “update sensor with location sensors”). I have background location on, but within I do not have high accuracy mode enabled.

The way I trigger it is w/ tasker. I already have locations set up in tasker for other automations, for example “home”. When I leave home, tasker turns on my lock screen and turns on my vpn. This has never had an issue.

I then added a task that sends a message to my home server with the notify.mobile_app_pixel and the message / command_high_accuracy_mode / data: force_on. (From this great guide). This now also gets triggered when leaving a zone and it correctly turns on my high accuracy mode as expected. Then when I enter one of my zones, it sends a similar message correctly turn high accuracy mode off.

So all is working as expected. Except:

Sometimes I’ll just be sitting at home, or at work, and the high accuracy mode gets enabled. I have tasker notify when it triggers, and it’s not triggering at these random times high accuracy gets turned on.

If I look in the HA companion app settings of “notification history” I can see notification for the “command_high_accuracy_mode” come in when it correctly turns on w/ tasker. But the other random times it comes on there is no notification there. So it doesn’t seem to be turning on from an external trigger.

Here are some logs I’ve tried to catch around the time:

05-22 20:42:50.373 23208 23208 D SensorReceiver: Received intent: android.net.wifi.STATE_CHANGE
05-22 20:42:50.378 23208 23208 D SensorReceiver: Received intent: android.net.wifi.WIFI_STATE_CHANGED
05-22 20:42:50.379 23208 23208 D SensorReceiver: Sensor wifi_state corresponding to received event android.net.wifi.WIFI_STATE_CHANGED is disabled, skipping sensors update
05-22 20:42:50.379 23208 23208 D SensorReceiver: Received intent: android.media.RINGER_MODE_CHANGED
05-22 20:42:50.388 23208 23208 D SensorReceiver: Sensor audio_sensor corresponding to received event android.media.RINGER_MODE_CHANGED is disabled, skipping sensors update
05-22 20:42:50.413 23208 23282 D ServerConnectionInfo: localUrl is: true, usesInternalSsid is: true, usesWifi is: true
05-22 20:42:50.716 23208 23288 I mpanion.androi: Waiting for a blocking GC ClassLinker
05-22 20:42:51.046 23208 23288 I mpanion.androi: WaitForGcToComplete blocked ClassLinker on AddRemoveAppImageSpace for 329.859ms
05-22 20:42:51.076 23208 23290 D HighAccLocService: Try starting high accuracy location service (Interval: 5s)...
05-22 20:42:51.078 23208 23290 D ForegrndServiceLauncher: Start service HighAccuracyLocationService
05-22 20:42:51.080 23208 23208 D SensorReceiver: Received intent: io.homeassistant.companion.android.UPDATE_SENSORS
05-22 20:42:51.090 23208 23287 D ServerConnectionInfo: localUrl is: true, usesInternalSsid is: true, usesWifi is: true
05-22 20:42:51.100 23208 23208 D ForegrndServiceLauncher: Service HighAccuracyLocationService was created. Start service
05-22 20:42:51.100 23208 23208 D HighAccLocService: High accuracy location service created -> onCreate
05-22 20:42:51.103 23208 23208 D HighAccLocService: High accuracy location service (Interval: 5s) started -> onStartCommand
05-22 20:42:51.120 23208 23208 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = true

and another time

05-22 18:26:25.145  3929  3929 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
05-22 18:26:25.162  3929  4039 D LocBroadcastReceiver: High accuracy mode parameters changed. Enable high accuracy mode.
05-22 18:26:25.162  3929  4039 D LocBroadcastReceiver: Cannot remove background location requests. Location provider is not set.
05-22 18:26:25.166  3929  3986 D HighAccLocService: Try starting high accuracy location service (Interval: 5s)...
05-22 18:26:25.170  3929  3986 D ForegrndServiceLauncher: Start service HighAccuracyLocationService
05-22 18:26:25.173  3929  3929 D SensorReceiver: Received intent: io.homeassistant.companion.android.UPDATE_SENSORS
05-22 18:26:25.182  3929  4038 D ServerConnectionInfo: localUrl is: true, usesInternalSsid is: true, usesWifi is: true
05-22 18:26:25.187  3929  4039 D HighAccLocService: Try starting high accuracy location service (Interval: 5s)...
05-22 18:26:25.188  3929  3929 D ForegrndServiceLauncher: Service HighAccuracyLocationService was created. Start service
05-22 18:26:25.188  3929  3929 D HighAccLocService: High accuracy location service created -> onCreate
05-22 18:26:25.188  3929  4039 W ForegrndServiceLauncher: Cannot start service HighAccuracyLocationService. Service is not running...
05-22 18:26:25.194  3929  3929 D HighAccLocService: High accuracy location service (Interval: 5s) started -> onStartCommand
05-22 18:26:25.196  3929  3929 D SensorReceiver: Received intent: io.homeassistant.companion.android.UPDATE_SENSORS
05-22 18:26:25.200  3929  4055 D ServerConnectionInfo: localUrl is: true, usesInternalSsid is: true, usesWifi is: true
05-22 18:26:25.205  3929  4057 D ServerConnectionInfo: localUrl is: true, usesInternalSsid is: true, usesWifi is: true
05-22 18:26:25.208  3929  3993 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=1ad91e46-bfbfbf-4c29-a173-86adf2a748fa, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
05-22 18:26:25.230  3929  3929 D LocBroadcastReceiver: Received location update.
05-22 18:26:25.234  3929  3944 I mpanion.androi: Background young concurrent copying GC freed 614414(28MB) AllocSpace objects, 28(1176KB) LOS objects, 94% free, 5366KB/101MB, paused 7.002ms total 290.453ms
05-22 18:26:25.235  3929  3929 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = true

I can’t see anything that I’m capable of identifying as why it’s triggering on. This happens 2-3 times a day and I haven’t noticed any clear pattern, although it feels it might occur more often within 2 hours of arriving at a location after being turned off by tasker. For example, it’s never turned on overnight when I’m sleeping.

I have no zones enabled on the companion app, and the only zone on HA is the default home zone.

Any ideas what I’m doing wrong/missing?

Any luck figuring this out? I just got a new phone (S23 ultra) and am having the same issue with high accuracy randomly being turned on by HA. The only automation that I have to turn it on/off is disabled so I’m not sure what else could be causing it.

My S23 ultra won’t let me turn it on anymore and defaults to “false”! :frowning:

what are your settings for the background location sensor?

Hi everyone! I have a similar problem! I’m using the app with a Xiaomi phone. If I check the app are using location, I see home assistant is keeping checking for it. These are my settings and I attach the screenshot from the location track of my phone. Is it normal?




Let me know if you can understand it in Spanish! Thanks!

theres more settings at the bottom of this screen, do you have it configured to turn on/off with a connected BT device? It looks like under zone selection there is nothing there right?

if that is correct then look to see if you have a notification command turning high accuracy mode on and off because its either automated in settings here or automated by the user via notification command from the server.

this is just showing location request at the expected background interval, this does not mean high accuracy mode is on like this issue describes. Things look normal for you.

Thank you for your fast reply!
I’m attaching you the second part, sorry my fault I didn’t see it!



I think I don’t have anything related with Bluetooth!

I don’t get your sentence “this is just showing location request at the expected background interval, this does not mean high accuracy mode is on like this issue describes. Things look normal for you.”
If the app is asking every few minutes for location, doesn’t it mean that it is using the phone location, as Google maps do for instance? I don’t get why is asking for location all the time, without a fixed interval of time, since sometime is every 2 minutes, sometimes every 5 minutes; all these location request has been sent even though I’m at home, connected with home WiFi. Can you please help me understand it? Thanks again!

first of all you are completely off topic here, happy to help but please understand your questions have nothing to do with the topic you replied to.

the app is making a request to Google to send us frequent updates, that is how location tracking workings.

https://companion.home-assistant.io/docs/core/location#android-location-sensors

this all happens in the background, you are not meant to really see this but yes we make a request for 1-3 minutes and we wait for google to send us updates, read the link above for more techincal detals.

yes they happen all the time in the background, it wont stop reporting.

1 Like