home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.6k stars 309 forks source link

Battery consumption high #2023

Open ProfDrYoMan opened 2 years ago

ProfDrYoMan commented 2 years ago

iOS device model, version and app version

Model Name: iPhone 11 Pro (German Location Setting) Software Version: 15.2 App version: 2021.12.1

Home Assistant Core Version 2021.12.3

Describe the bug Battery usage to up to 20 % even when not opened a whole day. I have background and sensors and everything that might consume disabled. Only enabled is location (always) since I want to track via iBeacon (which is working fine). Network is always working fine. Never had a glitch there. I was outside the iBeacon reach.

Only if I disable location the app behaves fine. I had this running before for months, since there was no iBeacon. At first I had all switched on, but then realized some battery consumption and dialed all off. Now I need location.

To Reproduce Location off. Consumption fine. Location on. Battery drain.

Expected behavior Well. :)

Screenshots

Additional context

zacwest commented 2 years ago

iBeacon has been pretty messy since Exposure Notifications. Do you see a lot of location usage in App Configuration > Location > Location History?

ProfDrYoMan commented 2 years ago

I am in vacation 1000+ km away from home. Yesterday was a day with 15%. The iBeacon is at Home.

There are only few updates in the history.

ProfDrYoMan commented 2 years ago

Also before I used the iBeacon having all on was eating battery.

Setup now.

5E132002-D068-4D54-A36C-7735A60F1DB4 7A29605C-953A-4290-B850-95CDB84EB123

All off and blocked, but location full on.

zacwest commented 2 years ago

Can you attach (and feel free to redact the other apps) a screenshot of the 24 hour battery usage by % and by time?

ProfDrYoMan commented 2 years ago

Will do as soon as I spot it on a day. This is from Monday.

4AC9AB51-AB4C-4BA5-B904-099478AD3238

798CA04D-1CEB-4BD0-9360-06B1FAD5D3E8

11% although I was most of the day outside.

And 8 min is 11%. At the end of the day I had roughly 20% left.

zacwest commented 2 years ago

Is that for a particular range of hours (e.g. tapping the graph) or for the unfiltered version? When you filter by hour, it gives you a percent-of-percents (so it'll be 11% of the battery usage in that window, not 11% of total battery).

ProfDrYoMan commented 2 years ago

It was tapping on the Monday. In the 10 day view.

svillar commented 2 years ago

I've the very same issue.

In the iOS battery settings, home assistant app is always the top 1 on battery consumption by far. Basically it looks like it's always doing something in the background. If my phone has been up for 8h I have 8h of background activity for home assistant app.

BTW, I have background activity disabled. I've also revoked the location data permissions just in case. No luck, the app keeps draining my battery.

svillar commented 2 years ago

Screenshot of battery usage (sorry for the spanish, but you get the idea I guesss) Imagen PNG

zacwest commented 2 years ago

Usage high but % low is normal with local push enabled. Please read over this thread for more details: https://community.home-assistant.io/t/home-assistant-for-ios-v2021-7-background-battery-use/325226/4?u=zacwest

svillar commented 2 years ago

Usage high but % low is normal with local push enabled. Please read over this thread for more details: https://community.home-assistant.io/t/home-assistant-for-ios-v2021-7-background-battery-use/325226/4?u=zacwest

Makes sense. Thanks for the quick and good reply.

ProfDrYoMan commented 2 years ago

Just want to update on this. No local push. Only the external URL configured. Eating battery like chips.

Sometimes more, sometimes less. But 15-20 % background happens often.

Recently I was on flight mode for half a day. Background 30 %!

I got fed up and deinstalled the app using HA with a home screen bookmark now.

I hope this will get fixed at some time.

OGKevin commented 2 years ago

HA is killing my phone 😞

iOS 16.0 (20A362) HA version 2022.8

Local push enabled.

imageimage image

JonLaliberte commented 1 year ago

I’ve noticed this recently. My phone (14 Pro) normally had a decent charge left at the end of the day(20%+), but recently it’s been getting very low (10%-).

Here is the last 10 days data (HA) is top of the chart for this period:

92982297-2776-4E6A-A00A-4C7B60D07940 7A3AE892-F4CA-4A8F-AD16-8E91388CABD0

iOS app: 2022.10.1 (2022.424) Home Assistant 2023.1.4 Supervisor 2022.12.1 Operating System 9.4

Note: I do have two instances configured that I switch between. I just set one of those up this past weekend, but this was happening prior to this.

It seems to have gotten worse around the 26th of December. I can’t recall anything significant changing around then though.

F27B0BFB-FCC5-4395-AF95-00B615CE1DDA

Admittedly I can’t prove it was HA causing this back then, but the 10 day data shows that the hypothesis could make sense. I can add day by day screenshots for the last 10 days and when I’m back on desktop. It does look like it got worse when I added that second instance.

zacwest commented 1 year ago

Did you receive any electronics for christmas? For example, a HomePod? Given the app wasn't updated and the timing aligns it may be something else. It's unlikely the app would spontaneously increase usage, but there are numerous system things which can use CPU without showing up in the list.

JonLaliberte commented 1 year ago

@zacwest Hah, I thought of that too and I didn’t add any new devices recently. At some point I did change to a new zigbee controller - but nothing that should affect HA on iOS. I actually probably have fewer notifications than in the past as well.

On the HA instances for one I am sending all sensors. For the other none(but still sending location).

I’m happy to test/dig up logs/etc.

zacwest commented 1 year ago

They easiest way to see diagnostic level battery usage is to extract debug logs from the device level. This is somewhat technical, so there's a few spots in between that you can send files to me instead of doing them.

  1. Take a sysdiagnose by pressing both volume up and down at the same time and holding the power button for about 1/4 second. It should vibrate.
  2. Go to system Settings > Privacy > Analytics > Analytics Data and search for sysdiagnose. It may take a few minutes to show up since it takes time to generate. The list doesn't live update there.
  3. Send the zip file to yourself by e.g. AirDrop.
  4. Search for the .PLSQL file in logs/powerlogs
  5. Open that in this app which can parse the raw data.
  6. Select the region(s) where your energy use seems abnormally high

On the rightmost column will be a process-by-process breakdown of energy usage which is significantly more detailed than Apple shows you.

This is a process I recently discovered myself so it isn't something I had access to until recently. It should help at least figure out which parts of HA are using stuff if it isn't just random things.

JonLaliberte commented 1 year ago

@zacwest Nice! I was able to get it running, but I'm not sure about the results, so I uploaded the plsql file to your dropbox if you want to take a look.

I see HA with a "BB" under it, not sure what that means. Also, I'm not sure if there is a way to get more data - it seems to only have pulled in data from January 15th to last night (when I ran the sysdiagnose).

It looks like usage reported here is less than the iOS settings show. For example for January 15th, the iOS battery view shows HA as 24% of the battery usage. Selecting the same day in EffectivePower shows only 5% for HA.

Let me know what you think if you get a chance to check it out.

Screen Shot 2023-01-17 at 1 23 17 PM
zacwest commented 1 year ago

BB probably means Baseboard, which is e.g. cellular data usage. That's not too bad of a percent for usage, really; I'm guessing identityservicesd is what's the root cause of your battery drain since it's around 40% of the energy usage during your latest 100%->11% cycle.

image

Googling around, it sounds like this may be Messages or iCloud-related; maybe try restarting the device or signing out/in of iMessage?

JonLaliberte commented 1 year ago

Got it.. I was looking around about identifyservicesd briefly, but I figured it best to ask you in case this was something you had seen before. Restarted my phone just now, I'll check the the data tonight or tomorrow and see if it gets any better (if not I'll try signing in/out of iMessage).. I'll let you know if I find anything. Thanks again!

JonLaliberte commented 1 year ago

Over the last two weeks Home Assistant still has some high numbers in the Battery Settings (the 10 day average is still showing 23% of battery usage), but my empirical data is that things have improved. Checking in HA I can see that my battery hasn't gone below 20% since restarting the phone on the 17th. Something must have been stuck burning up the battery. Thanks for the push Zac!

Screen Shot 2023-01-31 at 4 15 55 PM