iOS icon indicating copy to clipboard operation
iOS copied to clipboard

The HomeAssistant iOS is to blame for high battery drain

Open man55 opened this issue 2 years ago • 41 comments

iOS device model, version and app version

Model Name: iPhone 15 Pro Max Software Version: iOS 17.0.3 App version: 2023.471

Home Assistant Core Version

2023.10.0

Describe the bug A few days ago the battery began to discharge quickly. I see in the settings that the HA app consumed half the charge in 24 hours, although I opened it only a few times.

To Reproduce Just use HA

Expected behavior Low impact on battery consumption as before.

Screenshots IMG_7934

Additional context

I downloaded the logs from the HA app, but I don’t know whether there is sensitive personal information there or not, so I haven’t published them yet.

man55 avatar Oct 16 '23 11:10 man55

Same problem on iPhone 14 Pro with iOS 17.0.3

EDIT: It seems like HA app runs some type of "music", because my headphones, which are connected to my iphone and mac, only focus on the iphone and do not switch to the mac if i start there any media.

jafhueppe avatar Oct 16 '23 17:10 jafhueppe

oh wow never checked that in battery settings but now it makes sense (iPhone 12 mini iOS 17.0.3)

Simon-Design avatar Oct 17 '23 08:10 Simon-Design

I have uninstalled the app for now because its background activity is eating up all my battery! I have to charge my iPhone in the middle of the day, which I have never done before. When will this be fixed?

IMG_7990

man55 avatar Oct 20 '23 14:10 man55

I have this issue too. 65 hours of background activity in 10 days..

mr-derk avatar Oct 22 '23 06:10 mr-derk

The time in the background doesn't correlate to battery usage, so it's normal to have 14h50m, but it's more interesting to see what's the battery usage (%)

bgoncal avatar Nov 01 '23 09:11 bgoncal

The time in the background doesn't correlate to battery usage, so it's normal to have 14h50m, but it's more interesting to see what's the battery usage (%)

Just look. Screenshot in first message. The HA in the background eats up about 50% of the battery. After prohibiting the application from running in the background in the iOS settings, the situation has improved noticeably, but you also have to kill the HA after each launch.

man55 avatar Nov 01 '23 09:11 man55

Sorry, I missed that both were from your device. I will keep track of that, currently I don't see the same issue on my device, did you try to remove specific permissions and see if it improves? For example, just disable location permission for HA app

bgoncal avatar Nov 01 '23 09:11 bgoncal

I think it’s an iOS issue and not with the app. I’m now on 17.2 beta and everything is back to normal

Simon-Design avatar Nov 01 '23 13:11 Simon-Design

It's possible the Local Push extension went haywire, generally this happens when there's low overall battery use and it percolates up to the top.

zacwest avatar Nov 01 '23 14:11 zacwest

I think it’s an iOS issue and not with the app. I’m now on 17.2 beta and everything is back to normal

Hmm, hundreds of other applications are installed and working, including background and geolocation, but the problem is only with HA. And is this an iOS problem? But what kind of coincidence?

man55 avatar Nov 01 '23 14:11 man55

Disable Local Push if you do not want the app to do this. https://companion.home-assistant.io/docs/notifications/notification-local

zacwest avatar Nov 01 '23 15:11 zacwest

Disable Local Push if you do not want the app to do this. https://companion.home-assistant.io/docs/notifications/notification-local

Thanks, but I need this feature, it's one of the best features. Maybe the developers will fix this better?

man55 avatar Nov 01 '23 16:11 man55

I think it’s an iOS issue and not with the app. I’m now on 17.2 beta and everything is back to normal

Hmm, hundreds of other applications are installed and working, including background and geolocation, but the problem is only with HA. And is this an iOS problem? But what kind of coincidence?

Out of curiosity, what other apps with the same local push extension are you using? I can install them and see how it behaves on my phone too

bgoncal avatar Nov 01 '23 17:11 bgoncal

I don't see any problems with push. Again, I have disabled background updates and geolocation for the Companion app in the iOS settings, but I continue to receive push notifications. I don’t know what functionality might have stopped working, maybe I don’t use it. But now there is no such problem with huge battery consumption from HA. So maybe the problem is not Local Push after all? But I still have to kill the Application after each opening, otherwise it will drain the battery again. This is a bug that needs to be fixed, and Local Push is not to blame. IMG_8350

man55 avatar Nov 08 '23 07:11 man55

I am also seeing very high battery drain, since upgrading to iOS 17.1 from HA. Bizarrely the problem appears to be worse when the phone is switched to “Low Power Mode”, which I believe disables background refresh. The problem is also worse when off the home network, and thus needing mobile data.

ColinRobbins avatar Nov 23 '23 22:11 ColinRobbins

Ran into the same problem just yesterday afternoon. It is really strange because there was no update done either on the app or the iPad or the iPhone or HA itself. All have the latest version installed. It is really killing my devices battery.

Palmdale95 avatar Dec 09 '23 10:12 Palmdale95

Local Push is not to blame

I was noticing high drain overnight (say, 2% an hour), and disabling local push eliminated it. With it off, my iPhone 12 mini can go several hours overnight not registering any change in battery charge.

It’s got me thinking there’s likely different issues here. For example, is it possible that there’s some wifi issue that can cause local push to use more battery? Or even something like Wifi 6 connections being able to go in a lower power mode than Wifi 5 connections?

I also wonder if we may be seeing the difference between devices with different battery sizes. My iPad Air has local push on, but it’s battery is so much larger that idle drain appears to be very low even with local push enabled.

deviantintegral avatar Dec 09 '23 15:12 deviantintegral

What do you have the Periodic Update value set to in app settings under Sensors? Local Push will also update sensors while it is connected. The system keeps the Local Push websocket connection going but it should just be used for push and it'll do sensor updates while alive.

zacwest avatar Dec 09 '23 15:12 zacwest

Sensors are currently set to 5 minutes.

I did also go through disabling all other functionality (location, background updates, etc) before I determined that local push was the issue.

deviantintegral avatar Dec 09 '23 23:12 deviantintegral

Have the same issue.

ChurnM4c avatar Jan 01 '24 19:01 ChurnM4c

Same issue for me this night from 90% at 01:00 to 75% at 08:00

Edit 09/01/2024 : disabling local push solve the issue

mixman68 avatar Jan 08 '24 19:01 mixman68

It appears that the HA iOS keeps a websocket open the entire time that Local Push is enabled. Whether or not this is worth it for you depends (privacy vs battery life). I'm not sure that we can immediately solve this as it will depend on whether iOS can sleep or not while a websocket is open.

codyc1515 avatar Jan 15 '24 09:01 codyc1515

We can imagine to send a generic notification via Apple servers to reconnect local socket and get the real notification

mixman68 avatar Jan 15 '24 10:01 mixman68

The intent of the local push is to avoid sending notifications to Apple. The function you are describing where a dummy push is sent and then HA would poll was declined by Apple, as I recall.

codyc1515 avatar Jan 15 '24 10:01 codyc1515

Any update on this issue?

FabioEight avatar Mar 03 '24 09:03 FabioEight

Same here on iPad. The apps also drains the battery to 0%. It should reduce activity when battery is below 20% but better not to use power when not in use. Deleted the app and battery drainage stopped

ednieuw avatar Apr 07 '24 12:04 ednieuw

Did anyone found a way to keep the basic HA app features without battery draining on his iOS devices?

FabioEight avatar Apr 20 '24 10:04 FabioEight

Hitting this with an iPhone 12 Pro on IOS 17.4.1 and app 2024.4 as well.

IBMRob avatar May 17 '24 06:05 IBMRob

Can we get some eyes on this?

robd003 avatar Aug 21 '24 18:08 robd003

Can we get some eyes on this?

Please check https://github.com/home-assistant/iOS/issues/2429#issuecomment-1891702710 and https://github.com/home-assistant/iOS/issues/2429#issuecomment-1848440402

Currently the "local push" feature has pros and cons:

Pro:

  • Local push notification :)
  • Refresh sensors more often

Con:

  • Uses more battery
  • Keeps websocket connection open

Try disabling local push and observing the app behavior for a week.

bgoncal avatar Aug 21 '24 18:08 bgoncal