Android companion app's location sensor not working, with no errors

Hi. I’m trying to set up the companion app for Home Assistant on my Nokia 6.1 phone. It’s running Lineage OS with MicroG. I’ve installed the Home Assistant app (2021.10.0-full) from the Google Play store (via the Aurora Store) and told it to send location updates to my Home Assistant (OS, core-2021.11.5) setup.

I’ve checked through all the troubleshooting steps - location is enabled, the app has access to location in the background, battery optimisation is off, the app is allowed to run in the background, and the background location, location zone, and single accurate sensors are enabled. But looking in the app location requests in the permissions section of my phone’s settings, it doesn’t show that the companion app is requesting any location updates at all.

Looking in the logs, after I tried reinstalling the app I got some log messages from LocBroadcastReceiver saying that it registered zones (which have disappeared now), but it hasn’t logged any more messages after that.

Here’s the logs if it is helpful:

--------- beginning of main
11-26 21:08:33.534 14256 14256 W mpanion.androi: JIT profile information will not be recorded: profile file does not exist.
11-26 21:08:33.535 14256 14256 I chatty  : uid=10255(io.homeassistant.companion.android) identical 1 line
11-26 21:08:33.535 14256 14256 W mpanion.androi: JIT profile information will not be recorded: profile file does not exist.
11-26 21:08:33.548 14256 14256 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
11-26 21:08:33.550 14256 14256 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
11-26 21:08:33.585 14256 14256 I FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
11-26 21:08:33.599 14256 14280 W DynamiteModule: Failed to retrieve remote module version.
11-26 21:08:33.609 14256 14280 D ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
11-26 21:08:33.612 14256 14256 I FirebaseInitProvider: FirebaseApp initialization successful
11-26 21:08:33.617 14256 14280 W mpanion.androi: ClassLoaderContext classpath size mismatch. expected=1, found=0 (PCL[/system/framework/org.lineageos.platform.jar*3190854725] | PCL[])
11-26 21:08:33.619 14256 14256 D WM-WrkMgrInitializer: Initializing WorkManager with default configuration.
11-26 21:08:33.636 14256 14280 W DynamiteModule: IDynamite loader version < 2, falling back to getModuleVersion2
11-26 21:08:33.638 14256 14280 W GmsDynamiteLoaderImpl: No such module known: com.google.android.gms.measurement.dynamite
11-26 21:08:33.638 14256 14280 D GmsDynamiteLoaderImpl: unimplemented Method: getModuleVersion for com.google.android.gms.measurement.dynamite
11-26 21:08:33.638 14256 14256 I TetheringManager: registerTetheringEventCallback:io.homeassistant.companion.android
11-26 21:08:33.638 14256 14280 I DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:51 and remote module com.google.android.gms.measurement.dynamite:0
11-26 21:08:33.638 14256 14280 I DynamiteModule: Selected local version of com.google.android.gms.measurement.dynamite
11-26 21:08:33.640 14256 14280 W DynamiteModule: IDynamite loader version < 2, falling back to getModuleVersion2
11-26 21:08:33.640 14256 14280 W GmsDynamiteLoaderImpl: No such module known: com.google.android.gms.measurement.dynamite
11-26 21:08:33.640 14256 14280 D GmsDynamiteLoaderImpl: unimplemented Method: getModuleVersion for com.google.android.gms.measurement.dynamite
11-26 21:08:33.654 14256 14256 D Sentry  : io.sentry.auto-init read: false
11-26 21:08:33.655 14256 14256 I Sentry  : Retrieving auto-init from AndroidManifest.xml
11-26 21:08:33.691 14256 14288 I FA      : App measurement initialized, version: 42004
11-26 21:08:33.691 14256 14288 I FA      : To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
11-26 21:08:33.691 14256 14288 I FA      : To enable faster debug mode event logging run:
11-26 21:08:33.691 14256 14288 I FA      :   adb shell setprop debug.firebase.analytics.app io.homeassistant.companion.android
11-26 21:08:33.712 14256 14256 W pool-15-thread-: type=1400 audit(0.0:63): avc: denied { read } for name="version" dev="proc" ino=4026532092 scontext=u:r:untrusted_app:s0:c255,c256,c512,c768 tcontext=u:object_r:proc_version:s0 tclass=file permissive=0 app=io.homeassistant.companion.android
11-26 21:08:33.867 14256 14288 I FA      : Tag Manager is not found and thus will not be used
11-26 21:08:33.891 14256 14256 D SensorReceiver: Sensor audio_sensor corresponding to received event android.media.RINGER_MODE_CHANGED is disabled, skipping sensors update
11-26 21:08:33.904 14256 14256 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:33.904 14256 14256 D UrlRepository: Using internal URL
11-26 21:08:33.907 14256 14256 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:33.922 14256 14297 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:33.943 14256 14309 I AdrenoGLES: QUALCOMM build                   : f2ab992, I401605978b
11-26 21:08:33.943 14256 14309 I AdrenoGLES: Build Date                       : 09/28/19
11-26 21:08:33.943 14256 14309 I AdrenoGLES: OpenGL ES Shader Compiler Version: EV031.27.05.01
11-26 21:08:33.943 14256 14309 I AdrenoGLES: Local Branch                     : 
11-26 21:08:33.943 14256 14309 I AdrenoGLES: Remote Branch                    : 
11-26 21:08:33.943 14256 14309 I AdrenoGLES: Remote Branch                    : 
11-26 21:08:33.943 14256 14309 I AdrenoGLES: Reconstruct Branch               : 
11-26 21:08:33.944 14256 14309 I AdrenoGLES: Build Config                     : S L 8.0.11 AArch64
11-26 21:08:33.963 14256 14309 I AdrenoGLES: PFP: 0x005ff112, ME: 0x005ff066
11-26 21:08:33.989 14256 14309 I Gralloc4: mapper 4.x is not supported
11-26 21:08:33.990 14256 14309 W Gralloc3: mapper 3.x is not supported
11-26 21:08:34.070 14256 14256 I WebViewFactory: Loading com.android.webview version 91.0.4472.101 (code 447210103)
11-26 21:08:34.098 14256 14295 D LocBroadcastReceiver: Registering for zone based location updates
11-26 21:08:34.112 14256 14295 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:34.168 14256 14332 I cr_VariationsUtils: Failed reading seed file "/data/user/0/io.homeassistant.companion.android/app_webview/variations_seed_new"
11-26 21:08:34.201 14256 14256 I cr_LibraryLoader: Loaded native library version number "91.0.4472.101"
11-26 21:08:34.202 14256 14256 W mpanion.androi: Accessing hidden field Ljava/util/Collections$SynchronizedCollection;->mutex:Ljava/lang/Object; (greylist-max-o, reflection, denied)
11-26 21:08:34.203 14256 14256 W mpanion.androi: Accessing hidden method Ljava/util/Collections$SynchronizedSet;-><init>(Ljava/util/Set;Ljava/lang/Object;)V (greylist-max-o, reflection, denied)
11-26 21:08:34.203 14256 14256 W mpanion.androi: Accessing hidden method Ljava/util/Collections$SynchronizedCollection;-><init>(Ljava/util/Collection;Ljava/lang/Object;)V (greylist-max-o, reflection, denied)
11-26 21:08:34.208 14256 14256 I cr_CachingUmaRecorder: Flushed 6 samples from 6 histograms.
11-26 21:08:34.220 14256 14296 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:34.226 14256 14256 I cr_VariationsUtils: Loaded seed with age 3205s
11-26 21:08:34.485 14256 14256 D RenderScript HIDL Adaptation: IRenderScriptDevice::getService()
11-26 21:08:34.502 14256 14256 D RenderScript HIDL Adaptation: IRenderScriptDevice::getService() returned 0x6e056c4cb0
11-26 21:08:34.502 14256 14256 D RenderScript HIDL Adaptation: HIDL successfully loaded.
11-26 21:08:34.528 14256 14371 V RenderScript: Successfully loaded runtime: libRSDriver_adreno.so
11-26 21:08:34.531 14256 14256 D mpanion.androi: Successfully queried cache dir: /data/user_de/0/io.homeassistant.companion.android/code_cache
11-26 21:08:34.531 14256 14256 D RenderScript: Setting cache dir: /data/user_de/0/io.homeassistant.companion.android/code_cache
11-26 21:08:34.557 14256 14256 D WebviewActivity: Current webview package com.android.webview and version 91.0.4472.101
11-26 21:08:34.654 14256 14326 D SensorWorker: Updating all Sensors.
11-26 21:08:34.660 14256 14298 I WM-Processor: Moving WorkSpec (3a007734-c060-4907-8e1b-07ec187edbd3) to the foreground
11-26 21:08:34.776 14256 14256 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
11-26 21:08:34.829 14256 14256 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:34.829 14256 14256 D UrlRepository: Using internal URL
11-26 21:08:34.923 14256 14297 D LocBroadcastReceiver: Registering for location updates.
11-26 21:08:35.133 14256 14326 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:35.628 14256 14271 I mpanion.androi: Background young concurrent copying GC freed 279675(14MB) AllocSpace objects, 60(1932KB) LOS objects, 84% free, 9068KB/56MB, paused 1.317ms total 156.305ms
11-26 21:08:35.986 14256 14404 D WebviewActivity: External bus {"type":"connection-status","payload":{"event":"connected"},"id":1}
11-26 21:08:35.990 14256 14256 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:36.064 14256 14384 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=3a007734-c060-4907-8e1b-07ec187edbd3, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
11-26 21:08:36.165 14256 14256 I WM-SystemFgDispatcher: Stopping foreground service
11-26 21:08:37.226 14256 14404 D WebviewActivity: External bus {"type":"config/get","id":2}
11-26 21:08:37.228 14256 14256 D WebviewActivity: externalBus({"id":2,"type":"result","success":true,"result":{"hasSettingsScreen":true,"canWriteTag":true,"hasExoPlayer":true}});
11-26 21:08:37.325 14256 14256 D WebviewActivity: Callback null
11-26 21:08:37.331 14256 14295 D WebViewPresenterImpl: Try getting status bar/navigation bar color from webviews color ""rgba(63, 36, 75, 0.4)""
11-26 21:08:37.331 14256 14295 D WebViewPresenterImpl: Color from webview is "rgba(63, 36, 75, 0.4)"
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: Could not get status bar/navigation bar color from webview. Try getting status bar/navigation bar color from HA
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: java.lang.IllegalArgumentException: Unknown color
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at android.graphics.Color.parseColor(Color.java:1400)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl.parseColorWithRgb(WebViewPresenterImpl.kt:222)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl.access$parseColorWithRgb(WebViewPresenterImpl.kt:24)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl$getStatusBarAndNavigationBarColor$2.invokeSuspend(WebViewPresenterImpl.kt:180)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
11-26 21:08:37.332 14256 14295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
11-26 21:08:37.332 14256 14295 D WebViewPresenterImpl: Try getting status bar/navigation bar color from HA
11-26 21:08:37.336 14256 14295 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:37.370 14256 14295 D WebViewPresenterImpl: Color from HA is "rgba(63, 36, 75, 0.4)"
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: Could not get status bar/navigation bar color from HA.
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: java.lang.IllegalArgumentException: Unknown color
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at android.graphics.Color.parseColor(Color.java:1400)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl.parseColorWithRgb(WebViewPresenterImpl.kt:222)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl.access$parseColorWithRgb(WebViewPresenterImpl.kt:24)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl$getStatusBarAndNavigationBarColor$2$1.invokeSuspend(WebViewPresenterImpl.kt:196)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl$getStatusBarAndNavigationBarColor$2.invokeSuspend(WebViewPresenterImpl.kt:191)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
11-26 21:08:37.370 14256 14295 E WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
11-26 21:08:37.772 14256 14256 I chromium: [INFO:CONSOLE(1)] "Uncaught (in promise) #<Object>", source: http://192.168.132.110:8123/frontend_latest/core.2fe29b5a.js (1)
11-26 21:08:39.299 14256 14256 W Choreographer: Frame time is 0.082214996 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
11-26 21:08:42.003 14256 14404 D WebviewActivity: External bus {"type":"config_screen/show","id":3}
11-26 21:08:42.106 14256 14256 D UrlRepository: Using external URL
11-26 21:08:42.107 14256 14256 D UrlRepository: Using external URL
11-26 21:08:42.110 14256 14256 D UrlRepository: Using internal URL
11-26 21:08:42.111 14256 14256 D UrlRepository: Using internal URL
11-26 21:08:42.129 14256 14256 D UrlRepository: localUrl is: true and usesInternalSsid is: true
11-26 21:08:42.398 14256 14295 D SensorWorker: Updating all Sensors.
11-26 21:08:42.401 14256 14384 I WM-Processor: Moving WorkSpec (562729bf-cf2a-4b8a-bd9b-e4dcc33661f0) to the foreground
11-26 21:08:42.525 14256 14256 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
11-26 21:08:42.673 14256 14295 D SensorReceiver: Nothing to update
11-26 21:08:42.675 14256 14287 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=562729bf-cf2a-4b8a-bd9b-e4dcc33661f0, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
11-26 21:08:42.678 14256 14256 I WM-SystemFgDispatcher: Stopping foreground service
11-26 21:08:48.271 14256 14256 W Choreographer: Frame time is 0.144149 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
11-26 21:08:49.456 14256 14326 D LogcatReader: Read logcat for pid 14256

I dont believe microg has enough of the google service APIs to give location updates. You can try to install and open google maps to see if that will kick start things. Otherwise try a full version of gapps?

I’ve been using HERE Maps which gets location updates fine, but that is probably a different API seeing as it is constant updates.

I just tried installing Google Maps and it gave a notification saying that I needed to update Google Play Services, other than that it seems to work fine though.

Looking at the logs now, whenever I open Google Maps I get a LocBroadcastReceiver: Received location update message, though I don’t seem to get one when I open the app without Google Maps open (I get a “Registering for location updates” message, but nothing else). My location is also still “Unknown” in Home Assistant.

Unfortunately if it requires the full gapps I’ll probably just have to pass on getting it working, as I’m trying to keep my phone Google free.

If you’re not getting location updates from Google then yes it will need full version.