Issue: My google location services presence detection generally works as expected however it drains my battery like crazy.
Observations: After activating location sharing, I noticed that my phones battery life significantly decreased. I also noticed that the phone would heat up an abnormal amount during moderate use. The system battery statistics say that the phone is using more battery than usual and when looking at the per app statistics google play services is listed at the top with the highest usage. In the states developer pane, the source_type attribute is listed as GPS and this never seems to change. The gps_accuracy seems to hover around 15 meters with the screen on and 30 meters with the screen off. From some brief googling it doesn’t seem like very many other people are experiencing this issue.
My setup: I have a Pixel XL (first gen) running Android P DP4. I was experiencing the same issue while running Android P DP3. I also have the latest version of magisk installed. All location settings are set to allow scanning of wifi, Bluetooth, and net to get location data as well. Location sharing is turned on permanantly.
Possible cause/solutions: From the above, it would seem that location sharing is exclusively using my phone’s GPS to report location which would explain the high battery drain. From the following article, it seems that there are two ways to get location from android although I realize that this is targeted at Android apps. https://stackoverflow.com/questions/33022662/android-locationmanager-vs-google-play-services I would assume, however, that this would also apply to use outside of Android. From the variety and type of data reported, it would seem that home assistants google location provider is set up to use the google location services method of getting location. My understanding of this method is that Android should automatically manage the best method of getting location to preserve battery. Since home assistant is reporting that the location source is GPS consistently and given the battery drain, I’m not sure that this is happening. Does anyone have any ideas on why this is happening or how this could be fixed?