I managed to solve my problem by simply reinstalling the app completely.
For what it’s worth, I’m seeing this issue on both my and my wife’s phones.
With the last occurrence, I was sat at my desk at work, with Google Maps confirming my location here, and HA showing that I was still at home. This time, force-closing all of my apps meant that HA updated with my correct location.
This is having a detrimental effect on a lot of my automations. I’ve investigated the settings above and I believe everything’s set right.
Luke
Same issue this morning. Restarting the HA app didn’t make any difference. It appears that turning location off and on again allowed a refresh of my position to reach the HA app. I didn’t change anything else.
This doesn’t sound right at all. A restart of the app should be a force stop and start, swiping away from recents is not the same thing here if thats what was done. If you experience location not starting from a cold start (force stop > start) then please grab the logs after starting the app and share them. That is a separate issue from what is described in this thread.
To everyone else we have merged in the proposed change into the beta. This beta has not been pushed to the play store yet but for those who want to report a new issue will need to make sure they are on at least Beta 2556. You can grab the APK off github. If you continue to experience location issues please be ready with logs and file a new issue on github. We will probably be pushing the latest beta to the play store in the next day but there is a delay to when its available.
If you are worried about encountering other issues in the beta build just file an issue, we prioritize fixing beta issues.
Our fix is more a workaround until Google can fix the issue. We will be keeping track of updates and as part of our sensor updates we will check to see if too much time has passed since the last update to restart things.
I there… after the latest beta update with the workaround it seems to me that the HA app is regularly receiving location broadcasts from google. In my case though, I have problem with the data received. See this log:
[08-04 20:25:52.730 4648:4648 W/LocBroadcastReceiver]
Location accuracy didn't meet requirements, disregarding: Location[fused 45******,10****** hAcc=1636 et=+12h37m34s287ms alt=134.31178850764584 vel=0.0 bear=90.0 vAcc=3 sAcc=??? bAcc=??? {Bundle[mParcelledData.dataSize=52]}]
So, I thought that it could be something related to the Google Play Services app being killed by android or something, as opening google maps fixed the wrong data. I’ve now double checked the permissions of the GPS app , to be sure it’s not killed by an energy saving app and checked correct location permissions. I will keep the logs controlled to report back if that solved it for good.
This is not an error, this is app logic. We don’t send location updates if accuracy does not meet the requirements.
Edit: the reported accuracy in this report as shown in the logs is 1636
the default accuracy is 200
you should first confirm the GPS coordinates in the log are correct and if it is you should consider changing the accuracy setting
This does not point to any problem, you are just seeing our decision making process if we should send a location update. Accuracy is important because at times we can get a very inaccurate report so we need to filter them out.
The good thing here is location updates are happening and continuing (I hope).
Dear @dshokouhi I really appreciate your support. I think I’ve come down to a final isolation of the problem and I’d like to report back anche check if there a possible solution in HA App or not.
I’ve now completely understood the HA App logic and I understand all the situations where the loc update gets discarded.
It seems that my problem resides in the fact that google service is broacasting very inaccurate location while I’m moving either on a car or even with my bicycle. The log in my previous message was recorded while on my bicycle. This can only be fixed opening Google Maps or enabling High Accuracy in HA App.
I ask: is there any parameter to be passed to the LocationRequest function in order to get a more accurate location while moving?
I’ve checked online and I’ve seen various topics on this matter (ie: android - FusedLocationProviderClient returns inaccurate locations - Stack Overflow)
Anything I could do ?
Thank you
Please note that I’ve also found the following in the logs, HA App version : beta2578-cc689460-full
[08-06 11:26:33.414 26944:11135 E/LocBroadcastReceiver]
Could not update location.
kotlin.UninitializedPropertyAccessException: lateinit property sensorDao has not been initialized
at io.homeassistant.companion.android.common.sensors.SensorReceiverBase.getSensorDao(SensorReceiverBase.kt:57)
at io.homeassistant.companion.android.common.sensors.SensorReceiverBase.updateSensor(SensorReceiverBase.kt:340)
at io.homeassistant.companion.android.common.sensors.SensorReceiverBase$updateSensor$1.invokeSuspend(Unknown Source:19)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Just wanted to chime in on my issues with location updating.
My wife and I have phones on difference versions of android, and set them up with the HA companion app to turn on High Accuracy mode when entering our Home Zone, to trigger automations as we pull into the driveway of our house.
This was working great until about a month ago. It seems that High Accuracy Mode is NEVER turned on when entering our Home Zone.
I suspect this is an issue with the companion app as it has had changes to this part of the code. I say this, because I setup SmartThings for location tracking, and it properly works when nearing our home, so this app is working as it should be.
Use high accuracy mode
Please open a new issue on GitHub making sure to fill out the issue template
We need to see the logs to see what’s going on
no longer necessary, PR to fix this issue is here: Fix sensorDao not initialized error after geocoded update by dshokouhi · Pull Request #2772 · home-assistant/android · GitHub
seem to have been an edge case, thanks for reporting
Edit: this error is unrelated to location tracking, its part of a change to ensure the geocoded sensor is kept up to date with location updates that we send to HA. This error occurs after we have sent HA with a location update for the device tracker.
@dshokouhi
So I went out and came back home to grab log of what is happening.
One of the odd things I see is that it states I’m not in zone.home_expanded, which I don’t have in HA, and I checked the settings, and zone.home is selected (only one to select).
(I tried posting my log file here, but it is rejected due to the size of it.)
Sounds like you set the trigger range. The expanded zone are app created. Set it to 0 to disable that behavior.
Yes, I did as the normal range still would not trigger high accuracy mode. So regardless of the range, it never detects the location to trigger high accuracy, which used to work perfectly (but not with the last update of the app).
I’ve only lately began changing and toggling options to get it to work like it used too, but no go
We need to see the logs to determine what is going on. Feel free to file an issue on GitHub making sure to fill out the issue template completely.
Edit: may also want to give the zone constraints a read: https://companion.home-assistant.io/docs/core/location#zones-constraint
I’ve finally understood that it’s the lack of WIFI networks that provoke the location inaccuracy while driving … I live in the country side, so the only way to calculate location is through mobile network → location of repeater antenna… Android won’t enable GPS, but with high accuracy mode…
I will create a node red automation to enable High Accuracy once every 5 minutes, for 5 seconds, while far from home, and if connected to car or garmin edge bluetooth, and enable continuously while near home, to let my automations to trigger the various scenes…
This closes my issue. thank you to all.
I take the inaccurate reports did not have valid or good enough coordinates?
Correct. From 200mt to even 2km accuracy ( I guess the distance from the GSM repeater…)
Any reason to not let Android control high accuracy? It’s not like it uses a ton of battery…
what you mean? leave high accuracy on all the time?