#Android: issue with location data in background mode

1 messages · Page 1 of 1 (latest)

terse raptor
#

Recently I started noticing that my device location info does not seem to be getting updated in the background. If I unlock my phone it gets updated.

I have confirmed background data access is enabled as well as background battery setting.

The one thing I changed recently was to move from physical to an esim. I would assume that should not have any impact given that background data is enabled.

I also updated the frequency of how often sensors update from 15m to 1m and that did not help either.

HA: 2024.9
App: 2024.7.3
Android: 14 + September patch.

#

I confirmed that the actual location gets updated when I unlock by comparing the time when the sensor was updated.

So the issue is not the notification getting delayed. Notification is instant.

brave stag
#

what device is this on? most likely you have more settings to turn off. Samsung for example adds things like power saving that need to be disabled

terse raptor
#

Google Pixel 7 Pro

#

Also confirmed HA has precise location enabled and has location access all the time as well.

brave stag
terse raptor
#

Ok, so settings are in place and location history in troubleshooting shows data. It seems to be every 15m. I did change the sensor frequency update to be "fast always" so I assume that does not apply to background location sensor?

brave stag
#

sensor update frequency does not impact device tracker, also if you are stationary updates will only be sent once every 15 minutes

#

are you seeing a bunch of duplicate reports followed by a successful report?

terse raptor
#

Ya was out on a walk at that time

brave stag
#

what does the data in locatin hisstory show then?

terse raptor
#

Ya was about to get it

#

So around 7:47ish is when I unlocked the device and 8:05 is when it got the next update.

#

So 7:47 i got notified I am not home and 8:05 that I am home.

#

May be this is how it has always worked and I have been doom scrolling on my phone on walks 😂

brave stag
#

well i can see it had 2 reports sent and a 5 minute gap from 749 to 805

#

teh gap basically means google did not notify teh app it has a location update

#

but the good news y ou can see all those successful reports

terse raptor
#

gap is 15 mins tho right not 5?

brave stag
#

oh rihgt yes 15 minutes

#

so there are times where google may stop sending the app updates

#

we detect that every 15 minues and restart location tracking

terse raptor
#

also when I enable high accuracy location sensor it is much faster, i auto enable it when it connects to my car BT.

#

may be I need to add a zone to that as well.

brave stag
#

unfortuantely theres not much we can do if google does not give us reports

#

yea high accuracy mode will indeed fix the issue for you as it requets active GPS updates

#

so it may use more battery but the location reports are more accurate

terse raptor
#

Tho it will take 15m to get into that zone 😂

brave stag
#

by default location tracking uses google services which is a combination of GPS, wifi and cell tower

terse raptor
#

So I am like do I even really need to lol

#

thanks for the help. I am all set here.

brave stag
#

whats interesting in your histry is that the zone reports show old location

#

but that can just be because we got a valid background report at the same time

#

another thing you can try is to adjust zone radius

#

that may help in getting more timely updates as you enter/exit a zone

terse raptor
#

Ya right now I only have a zone for home or not.

#

I think Ill add a zone for high accuracy update

brave stag
terse raptor
#

Yup that's what my next plan was. I see that option in the sensor.

tall relic
#

I have the same issue too. Used to work fine and thought it might be related to having to factory reset my phone recently but thats seems like a coincidence. Whatever I try sensor wise makes no difference. It only seems to update location if I unlock the phone and open the home assistant app.

brave stag
tall relic
#

Pixel 6, yes everything is as required in troubleshooting guide. Previously i had automations that would start as soon as entered my home zone but now thats no longer the case.

brave stag
#

what does your location tracking history look like?

tall relic
#

I was probably in latest zone 15 mins before 20:28 update and that update only happened because I unlocked my phone and opened the home assistant app.

brave stag
#

and you confirmed the background access tile in companion app settings?

tall relic
#

if you mean tick beside background access then yes

#

I see android 14 mentioned on the forum by someone on the forum with similar issue but im still on android 13

brave stag
#

so there is a known where at times google may stop sending hte app updates, we do a check on that every 15 minutes to see if were still getting updates since we should be getting update about eveyr few minutes

#

the gaps in the history graph are gaps when google does not update the app

#

your screen coming on can be when we perform our check to see if updaes stopped so we cna request them again, the companion app logs would show when that happens

tall relic
#

Mine at this stage just seems to have completely given up trying to update location outside of opening app. I had travelled today but would have had 4g signal but didn't open app till I returned home after 5pm.

brave stag
tall relic
#

Nope data saver is not enabled. I'm dumfounded as to what is causing it, must be related to when I had to factory reset my phone a month or so ago. I was travelling during those not accurate enough updates and outside of any zones I have setup.

brave stag
#

are you leaving the app open in the background or closing it?

#

trying to htink of what would cause an 8 hour gap

#

that soudns like maybe the app was closed or it crashed

#

also during that time frame, were your sensors getitng updates?

tall relic
#

App would be left open in background as I would press home button to get back phone home screen to open another app. Not doing anything different to what I would have done when location updates did work. When you say 'were your sensors getting updates' can you clarify what you mean, cheers.

brave stag
tall relic
#

If I check battery level it looks fine with updates throughout the day and no gaps

brave stag
#

ok so that tells us the app was not killed and we just simply didnt get an update from google at the time 🤔

#

and you double checked location permissions that its set to precise and all the time?

#

lets try and fix the accuracy issue and see if that helps the situation....those skipped reports how high was the number in history?

tall relic
#

Yes permissions look fine, allow all the time and precise enabled. By skipped do you mean the not accurate ones or duplicates?

#

Highest duplicate value is 100 and highest not accurate is 2799

brave stag
brave stag
#

keep an eye out if you see it happen frequently, IIRC users in very rural areas may see higher accuracy numbers than others

tall relic
#

yes the background not accurate with 2799 seems accurate enough as i was travelling and went through that location around that time

brave stag