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?