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.

I’m still on iOS 14.8.1 but seeing the Home Assistant app run about 10-20 minutes in the background of every hour on an iPhone 11 and an iPad Pro, even when I’m sleeping and the iPhone/iPad is stationary/on the charger. I’ve been noticing this for a couple of weeks now. In the last 24 hours, the HA app has run 6h 10m in the background on my iPhone.

My iPhone is running the currently released app. My iPad is running the beta with multi-server support.

Seeing this I have a zone that is close to my home zone. I’ve just tried deleting that to see if it helps. I’ll report back in a few days depending on what I find.

Im in the same situation. I realised that my iPad Pro (2020) had a dead battery in half the usual time and I found the HA graphs on the Battery Settings.

I dont use “background refresh” on NONE of my iOS devices btw.

This is the only repetitive message while I dont use the iPad or HA apps.

2021-12-13 15:01:32.880 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Received: result success HARequestIdentifier(rawValue: 2465)
2021-12-13 15:02:28.422 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:03:24.407 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:04:20.707 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:05:17.345 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:05:20.427 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Sending: {"id":2466,"type":"ping"}
2021-12-13 15:05:20.441 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Received: result success HARequestIdentifier(rawValue: 2466)
2021-12-13 15:06:17.016 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:07:13.026 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:07:42.861 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Sending: {"id":2467,"type":"ping"}
2021-12-13 15:07:42.875 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Received: result success HARequestIdentifier(rawValue: 2467)
2021-12-13 15:08:40.403 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:09:36.454 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:10:32.438 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:10:33.824 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Sending: {"id":2468,"type":"ping"}
2021-12-13 15:10:33.836 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Received: result success HARequestIdentifier(rawValue: 2468)
2021-12-13 15:11:29.467 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:12:25.451 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:13:21.390 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:14:18.394 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:14:26.973 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Sending: {"id":2469,"type":"ping"}
2021-12-13 15:14:26.988 [Info] [hakit-work-queue] [Environment.swift:53] init() > WebSocket: Received: result success HARequestIdentifier(rawValue: 2469)
2021-12-13 15:15:22.390 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:16:19.328 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping
2021-12-13 15:17:15.085 [Info] [main] [Environment.swift:53] init() > WebSocket: Ping

I wonder if this is an indication that the point release iOS14.8.1 also contained a back ported change around location services, or, it’s actually a backend iCloud change triggering the difference in behaviour for otherwise unchanged client software and the results we had up until that point were statistically insignificant to rule out iOS14.

iOS14.8.1 appears to have been released around 26th October 2021.