-
-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pixel 8a only really updates location when app is active and phone screen is on #4679
Comments
I wonder if #4662 helps this situation more. Will need to wait for the 2024.9.5 beta to be approved by Google to get some valid feedback there. If youd like to provide feedback feel free to join the beta in the play store and wait for the specific version mentioned above to be installed. edit: beta version is now live in the play store |
can I work on this issue? |
Did you see my comment above? May already have a fix in place. Do you have any other ideas for fixes? Feel free to submit. Edit: Batching did not correct the issue if you have any ideas please submit a PR so we can review :) |
FYI: Somebody on another forum pointed out they had the same problem, but when they turned on High Accuracy Mode it worked for them. So i tried that and when I turned that on for me i stared getting location updates even when the phone screen was off. |
high accuracy mode actually contains a foreground service which would indeed allow the app to stay active while its going. It also uses GPS directly whereas without high accuracy its using the fused location provider that uses GPS cell and wifi etc... @ChristopheKoeck can you try the fix in teh beta to see if its working for you? |
@dshokouhi I just installed the app. |
Sadly enough, it still doesn't work :( I left work at 1:25pm and got home at 1:29pm, it only updated at 1:35pm because i opened the app. |
interesting that the single accurate location shows up on its own almost an hour later at the end, did you by chance send the Also can you confirm the settings under the single accurate location sensor to see if the option include in sensor updates is not checked? settings > companion app > manage sensors > single accurate location > include in sensor update is off there is also nothing like data saver enabled on the device too? |
yes, i have a motion sensor under my house that triggers a request_location_update, that was one of my attempts to get a quicker location update, but it doesn't work well. i checked and include in sensor update is off. |
i changed the setting you mentioned, i'll see what that does and report back. |
were not concerned with those smaller gaps actually they are to be expected at times. Its teh 30 minutes or longer gaps as we should not see those. We actually had an issue in the past where location updates would stop entirely until we registered for them again (not the same as this one where updates come when the screen turns on, in the previous case they were at a standstill even when the app was open). That check happens about every 15 minutes or so. Should do the evaluation anytime app sensors update. |
to be clear, if i turn the screen on, but not make the companion app the active app, it still takes a while or i might have to open the app to get the update |
Are you seeing other sensor updates during these time gaps? |
you mean any other sensor that's activated in the companion app? |
Do you see the battery level sensor update in the server during the time gap? |
I'll check that and let you know |
yes there are several on device automations based around zone and connected bluetooth device, and you can also control it via the server https://companion.home-assistant.io/docs/core/location#high-accuracy-mode https://companion.home-assistant.io/docs/notifications/notification-commands#high-accuracy-mode another thing you can try doing is to increase/decrease your zone sizes to see if that helps your situation My question regarding the battery level sensor was about before you enabled the other sensors, like when you were experiencing an hour or longer gaps in your tracking history. That was when I was curious to see if it was updating because it woudl tell us if the app were truly asleep or if Google was simply not sending us updates. If the app was truly inactive then you wouldnt see those sensors update either. |
ok, my mistake, i'll turn of the Last Notification sensor again later today when i charge my phone and see what happens |
It looks like other sensors do update with the last notification sensor turned off. |
i'm playing around with turning on/off high accuracy mode via automations, but the phone doesn't seem to get those commands until i turned on the screen |
make sure to add the critical format to speed up delivery of those commands https://companion.home-assistant.io/docs/notifications/critical-notifications#android |
I've added the critical format, but it's still very hit or miss if my phone receives the message. Would it be possible at some point to have an on device automation that turns on High accuracy mode when not connected to wifi? I also noticed when High accuracy mode is turned on, my Pixel 8a has a message on the bottom of my notifications screen that says the Home assistant App is running in the background, when you turn High Accuracy mode off, the message disappears. |
need to see the YAML format to confirm
no this is why we have teh command so users can take their own logic in their own hands, if the app supports all these different methods it will never end.
whats the issue here? sounds like its behaving as expected high accuracy mode uses a foreground service so the app can run in the background without interruption. |
if those commands are not waking the device as they should be then it seems like your device is more aggressive in preventing background apps from running. I am not sure what we can do at this point but I think the focus should be on why the app is not able to run in the background freely |
it's been better since i turned off the adaptive battery setting that was mentioned on the Home Assistant forums.. |
may or may not have found a potential culprit https://issuetracker.google.com/issues/370069681 would you say this issue started after the sept pixel update? |
For me it was happening before September, but the description of the problem looks pretty much the same |
yea play services can also be at fault here which is what we depend on for it to work |
I do confirm (as a Pixel 6a owner) that indeed, position tracking got worse starting september. I think you found a good potential cause! Zones entrance/exit are not detected when the app is in the background. This was never really precise (I never got background updates event when walking between 1 and 3 minutes interval as described in the documentation even with clear sky, phone in my hand but screen off, so good potential accuracy and didn’t see rejections of location update after opening the app diagnosis). But for a month or so, this really degraded up to 30-40 minutes between location updates, while moving location and entering/exiting 2 zones. Of course, I double checked many times the instuctions for troubleshooting location and everything (from data sending to background location, battery savings settings…), so it really sounds like an Android update impacted it. The other sensors are synced even in background though. Thanks for hanging here and being so responsive @dshokouhi! I know all those location issues due to so many different settings and causes are very complex to debug and should be quite repetitive. |
are you guys on the app beta and also updated to android 15 with latest play system updates? the app beta has some location updates and also the OS update could very well impact behavior. im not seeing very long gaps in time still when i periodically check things. |
I don’t use any beta version, here are the info on my setup:
|
Hello guys, I have the same issue but on my Motorola G24 Power with Android 14 (last update from august), Google play version from 1er september 2024. You can see here : The only thing did work (but not really) was the persistent notification. But I can't bring back this, I have allowed all the notifications ! Restarted my phone, the app, etc. Since I have Android 14, the location tracking isn't working very well and all my automation based on the location don't work as they should. Do anyone have a solution for this ? It's starting to be annoying since I have the issue since severals months now |
@Logicsystem360 have you ensured you have all battery optimizations turned off? I think Motorla may have added some extras https://dontkillmyapp.com/motorola the above site may point you i the correct direction to determine if you have the app allowed to run freely in the background. |
Thanks for your answer. The Home assistant app is already "without restriction" in the parameters. I can't find another parameter which can restrict Home asssitant for saving energy |
I've updated to Android 15 and i'm using HA 2024.10.4 and HA Android app 2024.10.4.full Sadly enough for me that's still not quick enough since i can get from work to home in under 5min, so i'm still using high accuracy mode while not connected to wifi to make sure my updates happen every minute while driving. I was thinking of putting a location tag on my quad so when my phone is close to it and connects via bluetooth it would turn on high accuracy mode. Would something like that work? |
I update to Android 15 too, but unfortunately no change. I have 10 minutes travel from work to home and the position update only when I arrive and unlook screen |
Same here, I even bought a Pixel 9 Pro, thinking it would fix the issue with a new phone, so Pixel 7 and Pixel 9 both the same issue (Android 14 and 15 same issue) . I sometimes dont see location updates sent in the log for a long time (maybe 15 minutes), even though the phone is turned on and the app is in forground. Wired. Too bad I am also not ablte to turn on the 'last notification sensor' as the companion app keeps asking me to grant permissions, even though I did add HA to the list and granted all permissions for notifications and allowed a few apps in the list. Hopefully there will be a solution soon. Thanks. |
for your use case i think high accuracy mode may be needed, its a very short amount of time
you have also confirmed any and all battery saving settings from your manufacturer? For this short time interval high accuracy mode may also be helpful
that just means google is not sending the app an update, after about 15 minutes the app will re-register for updates which kicks that off again
all you need to do is grant the HA app the permission in the list, as you say you were able to add some apps to the list that means you were able to turn it on. Unless you mean other apps to the notification permission? what device is that? custom ROM? maybe its not translating the permission properly if the app cannot tell its granted. Either way thats a separate issue from here. ............on the subject of zone changes and geofencing i noticed google has some tips here: https://developer.android.com/develop/sensors-and-location/location/geofencing#Troubleshooting
I personally am in the habit of turning off wifi scanning so i turned it on to try it out. We dont prompt for wifi currently but a good consideration if that is indeed the issue for those with a short drive this is a good consideration for high accuracy mode given the below time intervals given (note: first time I've seen actual time estimates, usually their docs are ambiguous with terms like few or several etc...)
additionally on the same page it has recommended zone radius:
|
Hi guys, I think I found a solution. Now every 5 minutes I got position update. Go to Settings > Position > Localisation services > enable Find WiFi Networks and Find Bluetooth Devices This is a translation because I have Android in Italian language, but I upload all the screen so you can find right menu and options: |
thats exactly what i found and suggested above :) |
Yes, but I found this setting with search function because I came from OnePlus with a android 10 and there these two setting are under WiFi and Bluetooth area. :) |
That’s the settings I already have enabled on my Pixel 6a phone since I started to use HA on it, but this didn’t help with the location issue previously described here. |
Its a Pixel 9 Pro with stock android. Yes I think it is a seperate issue, too many issues around. So I switched to an iPhone 16 now, since I need location updates to run stable, and found the iPhone is doing much better. |
Home Assistant Android app version(s):
2024.7.3-full
Android version(s):
14 system updated to September 5,2024
Device model(s):
Pixel 8a
Home Assistant version:
2024.9.3
Last working Home Assistant release (if known):
not sure
Description of problem, include YAML if issue is related to notifications:
When the app is in the background, or the screen of the phone is turned off location updates happen very random or not, when the app is active and the screen is on i get updates every minute as expected
Companion App Logs:
Screenshot or video of problem:
Left the house at 2:55pm, arrived at work at 3pm, app didn't update until 3:08pm when i opened the app
Here i left the app open and the screen on, i get an update every minute, left work at 1:25pm, got home at 1:29 and received all expected updates
Here i left the app open and screen on while stationary at work. I again get an update every minute as expected.
Here the app is running in the background and screen off. I turned the screen off at 4:22pm and turned the screen back on at 4:52pm
Additional information:
Confirming settings i checked on my Pixel 8a.
The text was updated successfully, but these errors were encountered: