Battery/wifi works, device tracker not

i have a oneplus 6t, all is working fine here
my gf has a motorola android, wifi and battery sensor are working perfectly
but the device tracker (location), seems after about 1-2 days, it just doesnt update anymore
battery/wiif still updating

location is offcourse enabled, battery optimalization is off
i try to send the reques_location service from with a notification, that doesnt help either…

what helps, is to manually open the application again
then it works again for 1-2 days

what could be wrong? why is battery/wifi working, and location not updating anymore?

Sounds like the Android Doze feature is hitting you.
You might be able to work around this with an adb command: adb shell dumpsys deviceidle whitelist +<package_name>

You need root for that?

Nope, just enable USB Debugging on the phone, connect your USB to the computer and execute :slight_smile:

I think there’s an addon available for adb too.

ok, can try, but whats the package name ? :slight_smile:

Should be io.homeassistant.companion.android I think.

so this command :

adb shell dumpsys deviceidle whitelist +io.homeassistant.companion.android

That looks correct

ok, tnx i can try

I would also check app standby to see if the app is exempted from it.

1 Like

Hmm, just checked… It’s still Android 8.1

I believe “exempted” doesn’t exist on that Android version :wink:

There is no app that has the exempted state… I can only enable the “do not optimize” feature, that was already enabled…

Do you have other suggestions,besides that adb command? Didn’t do yet…

But it’s still strange that wifi/battery updates are working, but location not?

What accuracy is location set to on the device? High Accuracy?

Yep configured to high, app permissions also set…
Also in HA app background location enabled

If it works for 1-2 days then it sounds like the process is still getting killed somewhere. Only other thing I can think of to check are these points listed here: https://companion.home-assistant.io/docs/troubleshooting/faqs/#location-is-not-updating-in-android-app

Ok, thnx for tip…
Have enabled now also unrestricted data for the HA app, although don’t that’s the issue…
I will wait again some days… Then i try that adb command… but not sure if it will help, don’t think doze already existed on Android 8…

I think this should help some cases where data may be prevented in the background.

Doze and app standby existed from Android 6.0 and on: Optimize for Doze and App Standby  |  App quality  |  Android Developers