Device Tracker not updateing GPS Location, gecodedlocation does

Noticed a similar issue with tracking. The frequency is sporadic and the accuracy is lacking. Moving about 50m it places me way further into a different zone or most of the time doesn’t detect me in the zone I’m in. I allowed all the permissions and disabled any battery optimization.

Not sure if this is the problem, but seems to fix my issue with “no updates on gps location”, in the new Android update (for me Android 10), the system now ask if the application (HA) it’s going to be using the GPS access all the time or only when using the App, by default it is set to only when using the App, so I changed that to “all time” and that’s it, seems to be working for me.

This is highlighted in the troubleshooting section of the companion docs

Hi folks,

I’m having the same issues on my Mi 9T Pro. Geocoded location updates perfectly (impressive accuracy), but the device tracker (type: gps) seems to want to stay at home. I’ve had a look at all the troubleshooting stuff and have set it up as recommended, but still no joy.

The background GPS-related detection is obviously working fine, both in foreground and background, because the geocoded location is always correct (entity sensor.mi_9t_pro_geocoded_location). It’s just that the GPS coordinates on the device tracker itself (entity device_tracker.mi_9t_pro) never update the latitude and longitude, even though the data is apparently available.

The geocoded sensor is not the same as the location tracking so you can’t compare the way you are attempting to.

try checking these points: https://companion.home-assistant.io/docs/troubleshooting/faqs/#location-is-not-updating-in-android-app

Hi @dshokouhi,

The tips at that link you provided are what I followed already.

My comment is meant to point out that the app is successfully requesting and obtaining the location, as can be seen from the “geocoded” sensor, but is not updating the latitude and longitude in the device tracker entity for some reason.

The geocoded sensor does not work the same as location sensors. Geocoded just asks about the last reported location, the device tracker is the one that subscribes to the events and gets states pushed. Its possible that the location sensors need their settings adjusted to allow for a higher accuracy number. If you have logcat access you can inspect the logic in the logs to see if you need to adjust your number.

Have you tried the start fresh steps just above the location steps? Something may just need to be cleaned up too.

thanks for the link but did not find a solution … why does the geocoded sensor do not work as other location sensors or any sensors … i dont have logcat but maybe you have it dshokouhi?
it seems to be general not limit to particular android phone.

Because its a sensor and not a device tracker.

if you have an issue then you need to get us yoru logcat, another user cant produce your own error log, you are asking about why its not updating and the answers to help you are in there.

its not a general issue, its an issue to do with a users GPS accuracy which is why we made this a setting, not all users have this issue.

1 Like

I’m having the same issue on my Pixel 3XL and my wife’s Oneplus 5T. Both are allowed to access location in the background all the time, battery optimization is disabled, minimum accuracy is set at 200. Both device trackers report the last location was 2 days ago, even though I can see HA is updating sensors when I am using the app, and the geocode location (which I understand is different) updates with high accuracy. The time the sensors updated in the last week, the accuracy was < 25, so I think leaving the min at 200 isn’t hurting it. In short, my phones are accurately placed to within 20m, but I can’t get HA to update the sensor more than once a week. The min update time is at the default 1 minute.

How do I go about troubleshooting? It appears I need to install some sort of logcat app to capture the logs to determine what’s going on in the background. Is that correct?

first update to the latest version then check the troubleshooting section of the docs to check location settings and possibly start fresh.

According to the Play Store my Android app 2021.1.1-full is the latest version, and HA is on 2021.1.4. I followed the troubleshooting steps in the documentation, some of which I very generally referenced in my post. I will try clearing the cache and/or uninstalling the app next. If that fails, what is the next step to determine why the location is updating only every few days or so?

I’m having the same issue. I upgraded from version 2020.12.2 to 2021.1.4. No issue previously. I checked the sql and found that the gps info in device tracker entity is now missing. Not sure why.

Anyone else facing the same issue with version 2021.1 4?

Make sure these in particular: Troubleshooting | Home Assistant Companion Docs

Get us the logs from the device. Follow the steps outlined in the following link and when you do a filter add a tag for LocBroadcast (skip the home assistant search mentioned) and make sure to grab about 15-20 min of logs to look at the decision making process. You will see what I am talking about when you see the log statements.

HA core versions are not the same as the android app version. Check the integration screen for the device to see all attached entities, maybe the name changed and you didn’t expect it?

    Ensure the app has location permissions granted, all the time. - Done
    Ensure that location (GPS) is enabled on your device. - Done
    Turn off battery optimizations for the app. - Done 
    Ensure that all 3 of the Location toggles are enabled in App Configuration > Manage Sensors in the Android app. - Done
    Turn on unrestricted data for the Android app. - Done
    Check that background access setting under App Configuration shows the app has proper access. - Done

All of those were already enabled. I will read the link you posted and respond here with the logs.

EDIT: I meant to point out that I had to restart HA earlier for the first time in awhile. After that restart both phones updated their location, but they haven’t updated since. Is it possible the error is on the server side and not the app side?

I restarted again, and both phones immediately updated. This seems to point to a server-side issue since the clients are already properly configured. I don’t see any location errors in the logs, just the device_tracker components being setup during startup.

Please go back and re-read my entire response, you are not looking at the right logs.

I read your response, and in mine I said I was working on getting you the right logs. In the meantime, since I don’t have the ability to install ADB and enable logcat right this minute, I decided to add additional information that restarting HA immediately updates both phones’ locations. My second reply wasn’t meant to be a reply to you with the correct logs. It’s a reply to myself that I can force location update without touching the app just by restarting HA. Still planning to get the companion logs when I get a chance, maybe tomorrow.

Is it just me or has request location updates stopped working?
Notification Commands | Home Assistant Companion Docs (home-assistant.io)

A few months ago, when I sent that request I could see on the phone that HA was requesting GPS location in the notifications menu.
Now nothing happens, not even the actual GPS update.
It could be my phone, it’s getting so slow it can hardly use Waze anymore. I just want to know if this is just an issue I have or if it actually has stopped working?

Try checking the logs you should see the notification come in then a location update in a few seconds