Recently upgraded to a pixel 8 pro and I seem to have some strange issue that only occurs every few days.
Battery usage seesm to be a huge issue every so often and struggling to track down why, as an example I charged my phone last night, unplugged it and went to bed.
I had 100% battery on going to bed I wake up 8 hours later to find my phone has 20% battery left, looking at what used the battery it seems to be home assistant
none of above is set up, Sensor wise I am currently using the following sensors:
Android Auto
Battery Level
Battery State
Charger Type
Back ground location
Location Zone
I am not using high accuracy as per the link above.
The home assistant app battery usage is set to optimised, I have tried unrestricted and restricted, restricted seem to help and prevents the battery drain but I do have other issues when in restricted, mainly when I leave home zone it can take 30 - 60 minutes to update I have left home zone.
Another thing to note is if I reboot the handset and do a full charge sometimes I can get through a full night with hardly any battery being used, I only seem to get this battery drain issue every few days, its not happening every day\night.
I was wondering if there was anyway to tell why home assistant on this handset is using so much battery in the back ground, I also have a Galaxy note 10 and that doesnt have the same issue either which leaves me to believe there is some issues effecting just that handset but not sure how to figure out what or why!!
I suspect there are two factors (Captain Obvious to the rescue! ):
Android version and in particular, background app sleep
Sensor use
I also have a Pixel 8 Pro, but don’t have battery issues as ALL HASS app sensors are disabled. This was done after bad experiences with previous Pixels and battery drain for little benefit. The only one that was interesting was high-resolution GPSr location to trigger ToDo list notifications, but my attempts at automations didn’t work so got binned.
My HASS app is set to Optimised and has burnt 2% since last charge - but that was after a few activities that need manual control rather than automations (after checking my Location Zone is ON).
My guess is the Galaxy note 10 has an older Android version, and probably a different kernel optimisation as Samsung always makes changes to stock Android.
So, nothing you don’t already know, but try reducing the active sensors, and try different App battery usage profiles (press and hold the icon → App info → App battery usage).
EDIT: HASS App → Settings → Companion App → Background Access - mine was set to OFF which probably explains why GPSr zones didn’t work, but also my lower battery usage. No, I’m not turning it on!
dont think its obvious, the strange thing is this only happens every few days, not every day, the sensors I listed above and I dont think any of them are the cause of the drain, its hard to say what is.
My gut feeling is that there is something happening thats causing the the phone to constantly try and do something in the backgroudn which is then pushing battery usage through the roof, there must be a way to check the logs to see what this is?
Well, in a rubbish British way I was trying to say my post isn’t much help, as you’d probably thought of my ideas!
The trouble is, that’s the behaviour of most complex systems. There’s so many variables and independent sub-components, the overall behaviour is rather hard to pin down (and fixing such issues was my career for many years).
My main suggestion is to try A/ B testing with the HASS app background access turned OFF for a few days, then back on. Just try to normalise other factors like 5G / WLAN radio usage, screen time (clearly not an issue overnight in your example), and reboot at the start of each test.
Log access is in the app under Need Help? → Troubleshooting → Show and Share Logs
thanks, already been through and tried some of these options.
The main problem is I can go 3-4 days without seeing the issue and as I said in my original post if I changes to restricted or background access off then automations don’t fire.
I have ran home assistant for a few years now and have been using the same options on other android handsets and its never been anywhere near this bad.
I will have a look at the logs the next time I come accross the issue!
Yeah - I’ve seen battery drain issues one and go with Android monthly security updates as Google try “optimisations”. The one advantage of a Pixel is, there’s usually another kernel build in 4 weeks…
When the battery usage is shown as “assistant has used 73%” its assistant using the battery and due to the Wifi being unusually high it looks like Assistant is searching or polling something on the network.
Likely each night knock out a module and see if you can pin it down to a module or when not using rather than have it in the background just close the app.
It could be something like you have RTSP video running constantly in the background.
Thanks, been trying to replicate the issue since the first post but it hasnt re-occured as of yet, very strange.
This is last night, 7% used
HA usage
This is what I was saying in the orignal post, it doesnt happen every night, just some days randomly I wake up and my phone has used 70% doing something crazy in the background (certainly seems specific to my setup for sure) but is a strange one.
Will keep an eye out and hopefully catch it the next time it happens.
Pixel 8 pro here as well, lots of additional sensors enabled and I have never seen that amount of battery usage. In fact the ha app barely uses anything. Then again, I always go back to close the app and not just swipe it away
So I think I have found the cause of the high battery drain, its down to a camera feed being left opened in the back ground and the strange thing is even when I swipe the app away or close the app completely the camera feed seems to stay open in the back ground and I cannot find the camera open I.E. I closed all apps by swiping them but can still hear the sound of the stream, I only found this out as I could hear the sound from the feed playing in the background of my handset.
Strange why this is only happening on the pixel 8, I have a couple of Samsung handsets and a couple of iphones and they dont suffer from the same problem. Really no ideaq how to solve this.
I see on the GITHUB the same issue has been mentioned
So I guess I just need to be very careful not to close the app when the feed is playing as it sounds like the connection will be left opened if that happens.
I woudl expect closing the app should close any active streams but seems thats not the case
Its taken me months to find this, I only noticed by chance the other day and then this morning I woke up to a flat battery where home assistant drained it overnight from 83% down to 0%.
I’ve used the HA companion app as a devcie tracker since I started using Home Assistant, never had a problem with that or the functionaility, it doesnt seem to drain the battery either.
The issue here is not related to a devcie tracker entity but an RTSP stream being left opened when you close the app, I do have a the Unifi integration and my person entities that I track do have device trackers for both GPS and wifi, I also only have this issue on 1 handset out of 4, the people in my home use x2 Iphones, a Samsung Galaxy Z fold and I am using a Pixel 8 pro, The Pixel 8 pro seems to be the only handset suffering this battery drain issue. Again the device tracker entities are not whats causing the battery drain.
camera traffic has been a known issue for sometime, unfortunately the only fix at the moment is to make sure a camera stream or streaming card is not in view when you exit the app. Users also confirmed the issue in chrome for android. I dont think iOS has this issue either.
Yeah the camera thing happens to me too. I switch to another app, and the camera keeps streaming. For me it’s when I’m viewing my 3D printer as it prints, as per: