Fast battery drain (post iOS15 upgrade) - actually post adding a second zone too close to another

Granted this is a 2015 iPhone 6S Plus with 82% original battery capacity however it was managing perfectly well until post update and the Settings->Battery output appears to point the finger at HA companion app background activity.

Are there any useful logs I can pull to get a more detailed idea of what is going on?

I did try looking in location history for clues however the HA companion app froze and then crashed.

This is definitely an unexpected amount of drain. The easiest way to see if it’s the app or not is to export the full set of debug logs (App Configuration > Debugging > Export) and seeing if it’s spewing logs about anything, and if so, what. You can either look at them yourself or send them to me here on Dropbox – note that they will contain personal info like your location, your HA URL, etc. It will not include things like passwords or access tokens.

There’s a few possibilities:

  1. It’s in the location handling, and that’s why it’s allowed to stay in the background.
  2. It’s in the local push handling, and that’s why it’s allowed to stay in the background.
  3. It’s neither of these, but something incidentally happening when location changes happening, like e.g. the frontend.

As long as you’re running iOS-2021.8 or later, #3 should be less of a possibility, but still the logs will help point the direction, if it’s that – it should at least show what is running.

Note that there may be a difference between high activity and high percentage. In this particular case it does look like they are correlated, however.

Thank you Zac. Unfortunately I lost my nerve yesterday re battery capacity as I needed to go out, hence I deleted the app from my iPhone, however I have reinstalled it this morning, if the failure mode is still present I shall grab the logs and send them to you. Sorry.

Whatever occurred does appear to be linked to the upgrade from iOS14 to 15 the last 10 days battery usage jumped following the upgrade to iOS15 whilst my phone usage and location was typical.

Edit: Looks promising, similar behaviour over the last couple of hours with the app reinstalled. I shall update again a little later on and include the logs.

I suspect I have probably shot myself in the foot on this occasion, looking in the logs I can see a significant number of region exited events, and this is probably tied to me attempting to add the children’s school as a zone however in practice it is probably too close to home to be able to cope with lower accuracy GPS location events.

User error.

It may be that. It may also be iOS 15 - it may be running things due to the upgrade which it also isn’t attributing well in the Battery list (technically speaking this list is very difficult to make accurate, so I can’t blame them too much).

Hope things have settled now but if it happens again feel free to report back the same way.

It does appear to have been my second zone too close to the home zone causing the power drain. Apologies for the false alarm.

I was wondering whether it would be practical to modify the logic around geofencing based upon the reported accuracy of the location data or the relative time and distance between location data in order to filter out jitter without risking missing actual events? You may well already do something like this in the companion app and it would have to not adversely impact normal case behaviour of widely separated zones.

Every geofence event triggers a GPS poll (because the data provided in the event isn’t generally good accuracy) which means if you’re jumping in and out of zones repeatedly that does sound like a good theory. I’m not sure there’s a solution but it may be possible for the app to try and disallow overlapping or near-overlapping zones - but many people also rely on this, too.

It’s definitely one of those fuzzy areas, I’m not sure filtering out, or weighting lower accuracy locations is a reasonable solution, especially if it could break existing use cases.

Hi, I have the same issue which pointed me here. Is there anything we can help to diagnose this issue ?

I am also having battery drain lately. Took a look at the log and I see a lot of:

2021-09-30 08:55:25.111 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Received: event: for HARequestIdentifier(rawValue: 173)
2021-09-30 08:55:25.118 [Error] [main] [AccountRow.swift:201] fetchAvatar() > failed to grab thumbnail: missingPerson
2021-09-30 08:55:25.121 [Error] [main] [AccountRow.swift:201] fetchAvatar() > failed to grab thumbnail: missingPerson
2021-09-30 08:55:25.124 [Error] [main] [AccountRow.swift:201] fetchAvatar() > failed to grab thumbnail: missingPerson
2021-09-30 08:55:25.124 [Error] [main] [AccountRow.swift:201] fetchAvatar() > failed to grab thumbnail: missingPerson
2021-09-30 08:55:25.124 [Error] [main] [AccountRow.swift:201] fetchAvatar() > failed to grab thumbnail: missingPerson
2021-09-30 08:55:25.124 [Error] [main] [AccountRow.swift:201] fetchAvatar() > failed to grab thumbnail: missingPerson

Any suggestions?

I also notices super fast battery drain on my iphone 6S after upgrading from IOS14 to IOS15.
According to the battery settings it was caused by 95% background use of Home Assistant app.
Copied the 150mb log files to my PC and began analysing these.
Home Assistant was writing constantly in the log file.
It looks like it was entering and leaving Geographic Region Zones constantly. I had defined 2 zones on my home (1 big home, and 1 smaller for my backyard shed, I was constantly entering and leaving my shed according to log, while I was in fact in the house/home).
I removed the shed location and enlarged my home/house circle.
Excessive logging seems to have stopped now.
Strange this problem did not occur on IOS14.

So this is interesting, a similar case to my own as reported earlier in the thread, I had put it down to user error on my part wrt choosing to add a second zone close to my home zone just around the time I updated to iOS15 however I now question this conclusion given you obviously had a working configuration with iOS14. I would estimate my zones to be approximately 50 metres apart so unless you have a long garden then it sounds as if this should have worked well for me with iOS14, I just got unlucky with iOS15 for whatever reason.

Edit: Alas my 6S Plus battery is now showing “service” so I have given in and ordered a new iPhone rather than replace the battery on what shall probably now have a limited supported life from Apple, I shall try reproducing the issue on the newer hardware and see if this might be specific to older devices or a more general bug / feature in iOS15.