Android 14 - Sensor updates

After updating to Android 14 my automations that rely on phone sensor changes have become degraded.

I used to be able to put my phone on charge wirelessly at night and it would kick off all the automations to turn off the lights/arm the alarm etc. However now it takes ages to update. If I have the app open and put it on to charge then it’s instant. If the app is not running (as in not “open”) then it takes longer than a minute. These used to be instant sensors.

Is there a fix/workaround or do I now have to remember to open the companion app, leave it open and then put my phone on to charge?

Thanks in advance.

does the companion app have background access? Android 14 made some changes to background apps so you really want battery optimizations disabled if you havent already.

FWIW my pixel 7 pro is on Android 14 and all sensors continue to update as expected

It has unrestricted battery use and the tick showing background access, is there some extra setting now?

no just needs to be set to unrestricted, try restarting your phone maybe?

I’ll try anything :slight_smile:

Reboot it is! I’ll let you know if it helps.

1 Like

this is the behavior change I was referencing earlier, however I do not htink you are hitting it as the app should never be in a cached state if battery optimizations are unrestricted

https://developer.android.com/about/versions/14/behavior-changes-all#pending-broadcasts-queued

you can confirm the app state by looking at the state of the App Importance sensor. You should expect to see the state switch from foreground to foreground_service like this

1 Like

Hi.
I have the exact same issue and just checked my App Importance state: Mine states “Foreground” when the app is open.
But how do we fix the app going into “foreground_service” if the prevents the sensors to på updated straight away?

make sure the app has proper permission to run in the background, turn off battery optimizations and anything else that may have been added. Samsung users need to look out for features like power saving etc… in addition to battery optimization.

On my Pixel 8 Pro I found a “hidden” setting. It is called “Adaptive Battery” in English I believe and you can find it under the “Battery Saver” setting. Pretty hard to find :confused:


my pixel 8 pro has adaptive battery enabled and I do not encounter this issue, it might be something else.

Checking in with the exact same problems on my Pixel 8 Pro. My pixel 6 pro did not have these issues. I have confirmed that battery is unrestriced for Home Assissant. My wife’s Samsung that is still running Android 13 behaves as I expect.

The only way I am able to get instant state changes when the App is not in the foreground is to enable persistant connection in the Server section in the app. However, this absolutely kills my battery.

Has anyone been able to resolve this without a persistent connection?

I have exactly the same problem with my new Pixel 8. I really don’t understand (sometimes 10s, sometimes 15minutes to have an update (smartphone plugged in, or Zone detection actualisation can take more than 2 hours…)

No problem at all before with my old Pixel 3a, and no problem on my girlfriend’s phone (Pixel 7 on android 14).

I have a pixel 8 pro with no issues related to sensor updates they show up as and when expected, these symptoms sound like you guys do not have battery optimizations turned off for the app

I think it’s ok on my side (no restriction)

you may have a different issue like an error or the app crashing please check companion app logs when the issue occurs to see if there is an error.

Settings > companion app > troubleshooting > show and share logs

Thank you I was able to find that the sensor for GPS was turned off.

Look in Settings > companion app > manage sensors > geolocation >

It was set to disable enabled and location update right away.

geocoded location is not to be used for location tracking its just a sensor with a pretty name, if you have issues with location tracking (which has nothing to do with this thread) follow these steps:

https://companion.home-assistant.io/docs/troubleshooting/faqs/#device-tracker-is-not-updating-in-android-app

For HomeAssitant I’m still at home (but it’s not the case. I am at more than 100km from my house).

There are a lot of fail, it seems home assistant companion can not send my position… I really don’t understand. Everything works well some days ago and I changed nothing at all.

You need to look at the logs for the failure to see why it’s failing.

See my post here, which contains a log of the HA companion app when the same issue occurred.