home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.14k stars 605 forks source link

I have problems with the tracker not constantly updating the GPS data even though the settings are correct. #4423

Open merlino1975 opened 1 month ago

merlino1975 commented 1 month ago

Home Assistant Android app version(s): 2024 4 .1 full

Android version(s): 13

Device model(s): note 20 samsung

Home Assistant version: the last

Last working Home Assistant release (if known):

Description of problem, include YAML if issue is related to notifications: I have problems with the tracker not constantly updating the GPS data even though the settings are correct.

I first tried uninstalling the home assistant companion application. then I reinstalled it and reconfigured it and the tracker worked fine. then the battery died so the phone turned off. I turned it back on and it hasn’t worked properly since then. I went to look in the log for duplicate positions sent, etc. and I saw that while before it gave a lot of gps data sent. after restarting the smartphone it started giving a lot of lines of duplicate locations, not accurate.

What do you think it could be? a problem with my smartphone? or other? Has anyone had the same thing happen? have you solved it?

Companion App Logs:

Screenshot or video of problem:

Additional information:

jpelgrom commented 1 month ago

Hi 👋

When the tracker is "not constantly updating", what kind of delay are you seeing? By default the app is trying to preserve battery, so it doesn't request location too often and may skip updates if they are the same as the last one. Locations marked as duplicate are expected to some extent.

If a lot of updates are skipped because they are not accurate, and the location looks correct (or close enough) to you, you can increase the minimum accuracy in Settings > Companion app > Manage sensors > Background location. In location history, when tapping on a row you can see the accuracy. For example if a lot of updates have an accuracy of ~250m and you want them to be included, increase the minimum accuracy to something like 275m (default: 200m).

merlino1975 commented 1 month ago

HI, I'm checking the logs: I have a lot of failed updates "background position - not precise enough" but the value sometimes varies from over 500 to even 1300 this afternoon for example, on the way home I looked at the register and while on previous trips it gave me an update every minute, now up to 10 minutes have passed from one update to the next. the only thing I did was clear the app cache.

so I don't know if changing the value you say could solve the problem.

what worries me is the fact that I'm sure that if I uninstalled the application and then reinstalled it and reconfigured it, it would be fine until my smartphone turns off for some reason.

It's a test that I've already replicated several times. and the result is always the same.

so I don't think it's an app configuration problem. because if I uninstall it and reinstall it it works perfectly

at most it could be a smartphone configuration error either an app bug or an android bug.

otherwise I don't understand how this type of test result is possible

Thanks for replying and I hope you can help me again Thank you

jpelgrom commented 1 month ago

I have a lot of failed updates "background position - not precise enough" but the value sometimes varies from over 500 to even 1300

Which sounds reasonable as locations that should be ignored - that is quite a large range.

this afternoon for example, on the way home I looked at the register and while on previous trips it gave me an update every minute, now up to 10 minutes have passed from one update to the next.

The rate of updates is ultimately something the system decides. Up to 10 minutes doesn't sound wrong for background updates. If you have other apps open using location (for example navigation), updates will come in more frequently.

I'm not sure clearing app cache is related. You could be seeing the system slowing down updates because it is in the background now - check battery saving settings for the app. Updates could also stop for a while immediately after clearing cache (as you're effectively killing the app running in the background), but they should resume when opened or on the next sensor update.

merlino1975 commented 1 month ago

I have a lot of failed updates "background position - not precise enough" but the value sometimes varies from over 500 to even 1300

Which sounds reasonable as locations that should be ignored - that is quite a large range. okey..but if I unistall and reinstall app...until device is on the bad position are 0....if device reboot.... start to give a lot of bad position...

this afternoon for example, on the way home I looked at the register and while on previous trips it gave me an update every minute, now up to 10 minutes have passed from one update to the next.

The rate of updates is ultimately something the system decides. Up to 10 minutes doesn't sound wrong for background updates. If you have other apps open using location (for example navigation), updates will come in more frequently.

A 10 minuts updates are very large ....how is possibile to keep a good and real position? no...I don't thinks is normal...really? so is unusable if is possible only this configuration.

I'm not sure clearing app cache is related. You could be seeing the system slowing down updates because it is in the background now - check battery saving settings for the app. Updates could also stop for a while immediately after clearing cache (as you're effectively killing the app running in the background), but they should resume when opened or on the next sensor update.

may be.....but yesterday i installed life360 ...I would like to try this tracker on home assisntat.... From yesterday to today, however, as long as there is a side effect. After installing life360 the Home Assistant tracker started updating me every minute and with an accuracy almost close to 0 for the entire journey and every minute. even with the device in the background. How is it possible? It makes me think the application isn't able to manage the device's GPS sensor well. I don't know if it only affects my model or all Androids. in any case, what can it mean if the home assistant app works correctly once installed. If I turn off the phone and turn it back on again it doesn't work fine anymore and if I install an external geolocation app does it work fine again?

dshokouhi commented 1 month ago

A 10 minuts updates are very large ....how is possibile to keep a good and real position? no...I don't thinks is normal...really? so is unusable if is possible only this configuration.

if you are seeing 10 minute gaps in the logs then that means Google is not sending the app our requested location updates. You should see updates come every 1-3 minutes but theres no guarantee there. We make a best effort to restart location tracking if we dont see updates for 15 minutes.

may be.....but yesterday i installed life360 ...I would like to try this tracker on home assisntat.... From yesterday to today, however, as long as there is a side effect. After installing life360 the Home Assistant tracker started updating me every minute and with an accuracy almost close to 0 for the entire journey and every minute. even with the device in the background. How is it possible?

life360 makes a GPS request, the app makes a balanced request in the favor of battery life. if you want GPS use high accuracy mode as described in the docs:

https://companion.home-assistant.io/docs/core/location#high-accuracy-mode

the app will continue to get passive updates so anytime life360 gets location updates, so do we.

merlino1975 commented 1 month ago

so I am forced to also have life360 installed to be able to use the tracker correctly. Yes, I have already seen the documentation about the high precision sensor. Sensor that I use and govern using nodered. But to be able to control it I need a tracker that, when not in high precision mode, still updates the position correctly every minute. I decided to use nodered by creating a high precision sensor switch because for my needs it works better with this configuration rather than using the home assistant companion one. What I don't understand is why it is necessary to also have life360 installed and home assistant companion cannot, or is not able to, have a clean signal like that of life360. So right now I have 2 energy consumers. home assistant and life360 tracker. Not very good for my battery power economy. I could also just switch to life360 but it doesn't have the high precision sensor which is very comfortable and precise.