Have been using HA for about 2 years. Still learning everyday.
Have had presence detection, using cell phones, setup for about 1 1/2 years. It has been working fine. I have several automations run when I and or the wife leave and return to the house. Everything was fine until a week or so ago when HA suddenly stopped recognizing I or the wife or both left or returned home.
I use my cell and my wife’s cell for presence location.
If I go into "Developer tools, “states”, I can manually change the state of the device tracker (home, away) for each of our cell phones and HA reacts correctly.
I literally have made no changes to the HA system or my cell phone. Except for routine updates to our Android phones and HA.
Any help on where I should look for, and troubleshoot this issue would be appreciated.
@dshokouhi
Following the link you provided with the following results:
Location sensors are “enabled” (did not change)
Confirmed HA Companion app has location permissions granted, all the time. (did not change)
GPS is enabled on the cell phone. (did not change)
Battery optimization is off (did not change) (app has unrestricted battery access)
GPS is enabled on cell phone. (did not change)
All location sensors are enabled (did not change)
From the crash log:
12-22 07:43:57.198 25435 25435 D LocBroadcastReceiver: Received location update.
12-22 07:43:57.201 25435 25435 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
12-22 07:43:57.201 25435 25483 D LocBroadcastReceiver: Last Location:
12-22 07:43:57.201 25435 25483 D LocBroadcastReceiver: Coords:(xx.4996601, -xxx.6897642)
12-22 07:43:57.201 25435 25483 D LocBroadcastReceiver: Accuracy: 100.0
12-22 07:43:57.201 25435 25483 D LocBroadcastReceiver: Bearing: 0.0
12-22 07:43:57.203 25435 25483 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
12-22 07:43:57.203 25435 25483 D LocBroadcastReceiver: Received location that is 78 milliseconds old, 1703259837125 compared to 1703259837203 with source fused
Side note: I do not understand this entry:
2-22 07:43:57.201 25435 25435 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
You should be looking at the failed to send errors that are visible in for screenshot. Did you already notice you had some successfully sent? So it’s indeed sending updates just not all the time. You need to look at the logs for the errors to fix
In this set of logs - I found with the key word: error
12-22 07:50:59.211 25435 25483 E SensorReceiver: Error while getting core config to sync sensor status
12-22 07:50:59.211 25435 25483 E SensorReceiver: io.homeassistant.companion.android.common.data.integration.IntegrationException: retrofit2.HttpException: HTTP 503
12-22 07:50:59.211 25435 25483 E SensorReceiver: at io.homeassistant.companion.android.common.data.integration.impl.IntegrationRepositoryImpl.getConfig(IntegrationRepositoryImpl.kt:532)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at io.homeassistant.companion.android.common.data.integration.impl.IntegrationRepositoryImpl$getConfig$1.invokeSuspend(Unknown Source:14)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
12-22 07:50:59.211 25435 25483 E SensorReceiver: Caused by: retrofit2.HttpException: HTTP 503
12-22 07:50:59.211 25435 25483 E SensorReceiver: at retrofit2.KotlinExtensions$await$2$2.onResponse(KotlinExtensions.kt:53)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:161)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
12-22 07:50:59.211 25435 25483 E SensorReceiver: at java.lang.Thread.run(Thread.java:1012)
This appears twice.
Need your help to understand - as this is a bit beyond me.
what is your networking setup like? are you using nabu casa cloud or your own solution? 503 error is something you have to solve on your send. Most likely its related to the networking setup, like maybe you are blocking API calls?
I am not skilled enough to setup any type of API blocking.
So - given the 503 error…something on my side…??? I can fully access HA from my cell (companion app) when I am away from home and when I am at home.
This 503 error is occurring while I am at home. I say this as I do not have logs from when I am away from home.
so - I ventured over to my nabu casa account and verified Remote Control is configured and connected.
I also verified the Remote control app & device is selected in the companion app.
I am about to run an errand. Let me capture the logs when I am away.
Also I looked at my nabu casa account and it states my remote UI is not connected to Home Assistant Cloud. And in fact, I can not control lights, etc in my home.
so - I am sure - first step is to get reconnected. My quick look around does not show how to “reconnect”.
@dshokouhi Well - Nabu Casa support (thanks to you for your direction and the support team), we rebooted the HA Server (hardware and software) and I am now reconnected. Go figure - a simple reboot - lesson learned (again!!) - do the really simple stuff first.) I will be checking presence sensing in a few hours and will see if this reconnection has impacted my situation.
@dshokouhi Just to wrap up and close out this issue - in case anybody else comes across this odd presence-sensing behavior.
Some how, (my) Nabu Casa account became confused with my mobile phone connection or vise versa: my mobile phone said I was connected - but Nabu Casa stated I was disconnected.
By rebooting my HA server (power down…wait for it…power back up)…whamo! Presence sesning came right back online and all works just fine in this area.
Many thanks again to you and Nabu Casa support - we are cooking again!
Problem solved!
Thank you!