android icon indicating copy to clipboard operation
android copied to clipboard

Since 2023.6.0 - Massive battery drain on idle!

Open initd0 opened this issue 2 years ago • 21 comments

Home Assistant Android app version(s): 2023.6.0-FULL

Android version(s): 10

Device model(s): Oneplus 6T

Home Assistant version: 2023.6.2

Last working Home Assistant release (if known): 2023.6.2

Description of problem, include YAML if issue is related to notifications:

Companion App Logs:


Screenshot or video of problem:

Additional information: Since i updated to 2023.6.0-FULL, from 2023.3.0-FULL, i started getting extreme battery drain even when phone is sitting idle. eg. Home Assistant App shows almost 50% battery usage within 2-3hrs. Battery usage monitor says i was USING the app for 3hrs, meanwhile my phone was just sitting on the desk, locked.

  • This never happened on 2023.3.0-FULL.
  • To solve the problem i had to roll back to 2023.3.0-FULL
  • I also have another instance on 2023.3.0-minimal and never had an issue on that version either, and im glad F-droid didnt prompt me to update that one yet.
  • No changes were made to any of my home-assistant app settings nor notifications, nor battery usage, all i did was just update the app like i always do.

Im sorry i dont have more information. I just wanted to report this issue. Im just assuming here, but It seems you might have made changes that does not affect users that are on Android 11 and higher, because i havent found any issues relating to this new release about battery drain. This seems to affect users like me since im on Android 10.

I hope you can review this new version and see what is using up so much battery in the background.

initd0 avatar Jun 18 '23 23:06 initd0

Thanks for the report.

The app can show up as 'active' in Android's battery usage details because of sensors etc., it doesn't mean it is always using a lot of battery.

Even if you haven't changed anything, have you checked the list of common battery drain causes? It might help figure out where we could look for power usage changes.

Are you still experiencing the issue after a few hours?

It seems you might have made changes that does not affect users that are on Android 11 and higher

I don't think there are any Android >=11 or Android <= 10 changes in the latest release, any specific reason you're calling out this version?

jpelgrom avatar Jun 19 '23 17:06 jpelgrom

I noticed it too. On 2023.05 battery usage by HA companion app was below 5%. Now it's 10-20%. I use persistent notifications but before upgrade it didn't cause noticeable power drain.

teklabania avatar Jun 26 '23 21:06 teklabania

I have noticed this as well. Before, Home Assistant Companion app, only account for a small amount of the battery drain (maybe 10%) and my battery would last all day, finishing the day at somewhere around 30-50% (depending on usage) now since update 2023.6.0 it won't even last to lunch and LG battery usage shows HA using around 50% of the battery every charge cycle.

I haven't changed any of my Home Assistant Companion App setting since the upgrade.

Additional Info: ATT LG Velvet 5G Android 13

mecj5 avatar Jul 03 '23 18:07 mecj5

I have the same problem. Massive battery drain (over 40% in 8 hours overnight, not moving). Also on an LG Velvet 5G (but on Android 11)

mknjc avatar Jul 24 '23 18:07 mknjc

I'm currently on version 2023.7.3 and battery drain on mobile is not an issue for me any longer.

teklabania avatar Jul 24 '23 20:07 teklabania

I started getting a ton of battery drain a day or two ago as well. Currently on 2023.7.5. Pixel 6 Pro using the Android 14 beta, build number UPB4.230623.007. The Android "Battery Usage" page says Home Assistant is using around 30-40%, even with something like 2 minutes of screen time and 4 hours of background.

dselzle avatar Aug 09 '23 14:08 dselzle

For those experiencing the issue please check these steps:

https://companion.home-assistant.io/docs/troubleshooting/faqs#android-app-battery-drain

These features are identified as battery intensive so we should make sure to check them, regardless of previous behavior.

dshokouhi avatar Aug 09 '23 17:08 dshokouhi

For those experiencing the issue please check these steps:

https://companion.home-assistant.io/docs/troubleshooting/faqs#android-app-battery-drain

These features are identified as battery intensive so we should make sure to check them, regardless of previous behavior.

I've followed all those steps and am still getting a ton of battery drain.

dselzle avatar Aug 28 '23 00:08 dselzle

For those experiencing the issue please check these steps: https://companion.home-assistant.io/docs/troubleshooting/faqs#android-app-battery-drain These features are identified as battery intensive so we should make sure to check them, regardless of previous behavior.

I've followed all those steps and am still getting a ton of battery drain.

can you let us know what sensors you have enabled, if your server is remotely accessible and any other feature you use?

Do you see high data usage too?

dshokouhi avatar Aug 28 '23 16:08 dshokouhi

For those experiencing the issue please check these steps: https://companion.home-assistant.io/docs/troubleshooting/faqs#android-app-battery-drain These features are identified as battery intensive so we should make sure to check them, regardless of previous behavior.

I've followed all those steps and am still getting a ton of battery drain.

can you let us know what sensors you have enabled, if your server is remotely accessible and any other feature you use?

Do you see high data usage too?

  • Battery drain is sporadic, it seems like it will drain heavily for a few days and then be fine for a week or two, then start draining again. Haven't found any pattern/correlation.
  • Server is remotely accessible via Nabu Casa
  • Data usage looks normal to me, Android tells me it's averaging 100-200 MB per month (mobile + wifi) for the last four or five months, all foreground
  • Persistent connection: "Never"
  • Sensor update frequency: "Normal"
  • Sensors:
    • Next alarm
    • Music active
    • Battery level
    • Battery state
    • Charger type
    • Is charging
    • Bluetooth connection
    • Do Not Disturb sensor
    • Device locked
    • Active notification count
    • Last notification (2 apps whitelisted)
    • Media session
    • Phone state

dselzle avatar Aug 28 '23 16:08 dselzle

  • Battery drain is sporadic, it seems like it will drain heavily for a few days and then be fine for a week or two, then start draining again. Haven't found any pattern/correlation.

interesting that is not consistent. When the issue occurs do you see any of the sensors reporting like crazy? Like maybe bluetooth connection? If you had a device that kept connecting and disconnecting that has the potential of causing a lot of updates and drain. I have seen troublesome devices disconnect and reconnect just about once a second and the app will send each and every update.

dshokouhi avatar Aug 28 '23 16:08 dshokouhi

  • Battery drain is sporadic, it seems like it will drain heavily for a few days and then be fine for a week or two, then start draining again. Haven't found any pattern/correlation.

interesting that is not consistent. When the issue occurs do you see any of the sensors reporting like crazy? Like maybe bluetooth connection? If you had a device that kept connecting and disconnecting that has the potential of causing a lot of updates and drain. I have seen troublesome devices disconnect and reconnect just about once a second and the app will send each and every update.

I was seeing a ton of drain yesterday, but there were only 4 changes to the bluetooth connection state all day, so it wasn't that. I'm not seeing any weird reporting rates from any of the other sensors either.

I was seeing the drain happen both while I was away from home, using mobile data, and when I was at home, connected to my home wifi network.

dselzle avatar Aug 28 '23 16:08 dselzle

so I know you said you didnt see any extra data usage but can you tell me about your dashboard? do you have any camera entities or streaming webpages? We have seen that these connections do not get stopped if you leave the app while they are in view so this may also be a potential cause of drain.

dshokouhi avatar Aug 28 '23 16:08 dshokouhi

so I know you said you didnt see any extra data usage but can you tell me about your dashboard? do you have any camera entities or streaming webpages? We have seen that these connections do not get stopped if you leave the app while they are in view so this may also be a potential cause of drain.

I do have one view that includes two Picture Glance cards with camera stream entities. I'll see if leaving the app with/without that page open seems to correlate with the battery drain.

dselzle avatar Aug 28 '23 16:08 dselzle

so I know you said you didnt see any extra data usage but can you tell me about your dashboard? do you have any camera entities or streaming webpages? We have seen that these connections do not get stopped if you leave the app while they are in view so this may also be a potential cause of drain.

I do have one view that includes two Picture Glance cards with camera stream entities. I'll see if leaving the app with/without that page open seems to correlate with the battery drain.

No luck reproducing the issue yet, with the streaming thing or otherwise. Of course.

dselzle avatar Sep 13 '23 23:09 dselzle

Facing the same issue. Took me several months to trace it back to Home Assistant app since I had it whitelisted in OS battery optimization settings and kept looking elsewhere.

HA is accessing my location in background every minute, which prevents the device from going into deep sleep. I checked the troubleshooting checklist posted above and none of the draining settings are on. I do not believe the app is transmitting the location every minute, but it is waking the device to get the current location regardless.

This may be related to one of my automations that rely on location; looking into it. Switching dashboards before quitting or manually closing the app by swiping up in recent list has no effect. I am disabling the location permission temporarily to watch the impact.

I have been running the Play store version (auto updates regularly) for over a year. Server is running on a Raspberry Pi and also updated regularly. Internal URL connects directly via IP and external goes over a self-managed VPN connection. Happy to share any further information that might help trace the issue.

aadityabhatia avatar Jan 09 '24 04:01 aadityabhatia

On my device I have traced this down to opening any page with a video feed

If I use the app without opening any video feeds the battery drain is negligible, once I've viewed a page with a video stream the high battery drain occurs. I have to kill the HA background task to get battery drain back to normal.

andonevris avatar Apr 18 '24 17:04 andonevris

On my device I have traced this down to opening any page with a video feed

known issue https://github.com/home-assistant/android/issues/979

I also asked about this earlier

dshokouhi avatar Apr 18 '24 17:04 dshokouhi

I just discover few day ago a huge battery use and 38Gb (yes - GIGA) of data use in one day. I know I have some streaming from my home webcams but those are not on the first view of the main dashboard and, anyway, I take a look at the streams for only for few minutes and send the home assistant app in the background (idle) when I finish. This huge use of data and battery power happen when idle.

robert-sz-76 avatar Jun 13 '24 21:06 robert-sz-76

I just discover few day ago a huge battery use and 38Gb (yes - GIGA) of data use in one day. I know I have some streaming from my home webcams but those are not on the first view of the main dashboard and, anyway, I take a look at the streams for only for few minutes and send the home assistant app in the background (idle) when I finish. This huge use of data and battery power happen when idle.

@robert-sz-76, under camera settings, you probably set camera_view: live, try to change it to camera_view: auto. This will tremendously decrease data transfer.

teklabania avatar Jun 17 '24 20:06 teklabania

I realise now that all my stream are live. I made an automation that , on ha companion idle or in background, switch away from the camera streams dashboard and it work pretty well. Anyway, I'll switch all the cameras to auto, thanks for your suggestion.

robert-sz-76 avatar Jul 11 '24 20:07 robert-sz-76