Location sensors - Making use of "High accuracy mode when entering zone"

I just recently started to make use of the Android Companion Apps location sensor / device_tracker. With the default settings

  • Background Location: Enabled (High accuracy mode: Disabled - Minimum Accuracy: 200)
  • Location Zone: Enabled (Minimum Accuracy: 200)
  • Single Accurate Location: Enabled (Include in sensor update: Disabled - Minimum Accuracy: 200 - Minimum time between updates: 60000)

I made the expierience, that there can be almost 15 minutes inbetween location updates, which is not nearly accurate enough to detect, if I am closing in on my home zone (for which I use the proximity integration). Therefore I am playing aroung with the high accuracy mode. Knowing it uses more battery, I would like to limit the use to the minimum. Since a couple of months (April to be specific) the app supports the feature, to enable high accuracy mode, when approaching a zone. For this an extended zone is formed around the targeted zone.

This sounds perfect, but would only work, if the “less accurate” location mode is updated in time to detect, that I am now in the zone.home_expanded. With the expierienced update rate of up to 15 minutes, that zone would need to be rather huge.

What are your expieriences? Is there anyway to improve the “less accurate” location mode to make use of this expanded home zone? Otherwise I would need to enable high accuracy mode based on bluetooth connection, which means that the mode is enabled throughout the full commute.

I have about 40 minutes to work.
I have sometimes not had the charge cable in during the drive and I barely notice a difference.
I have the screen on all the time, Waze running and high accuracy mode with every five seconds.

I can test it tomorrow morning and see exactly how much the battery drops during the drive but it’s nothing that has concerned me yet

Edit:
During the 40 minutes drive with screen on, Waze running and high accuracy mode on the battery dropped from 75 to 69%

Thanks for your feedback it’s really appreciated. I am just trying to optimize the behavior. For now I am also using the Bluetooth connection as you have shown me in another thread. But I am also trying to figure out what the experience of others is with the new option. The basic idea of it seems great.

I also found that the high accuracy when nearing home zone didn’t switch quickly enough for a fast update when I reached home. I’ve worked around this by adding a device_tracker.brent_override to my person, and when my phone connects to my home wifi, I have an automation that calls device_tracker.see to set that to home. Then when I leave and GPS causes my person to leave home, another automation sets that back to not_home. It’s a bit klugey, and not how I would ideally be handling it, but it does provide a fast update when I get home.

1 Like

The 15 minute thing is only if the app has the same location as previously sent. Otherwise you get updates every couple of minutes. Try to inspect the zone events to see if you need to adjust your accuracy setting. That might help trigger things faster.

What do I need to be looking for? When I noticed this, I was on my commute from work (zone.work) to home (zone.home). Parts of it on the Autobahn, so I question that the location was the same for some time.
Upon entering or leaving the zone the location is usually updated quite responsively, also when not using high accuracy mode.

if you don’t see updates for 15 minutes when your driving on a freeway then check the logs under App Configuration. You will see the entire decision making process for location there included when we receive an update and the reason for not sending the data. We also log when we send data too. So you’ll need to pull up and see what it says.

An example of what to expect can be seen here: https://companion.home-assistant.io/docs/troubleshooting/faqs#location-is-not-updating-in-android-app

Zone events are different than background location which is why you have 2 separate accuracy settings. You can also listen for the events for zone entry to see if accuracy is high or low. Its possible we get an event and ignore it due to accuracy not being met.

Very interesting and a good hint. Thank you for the information. I will monitor the behavior and check the logs.

Yea I found that we had to make discovering proper settings some how easy to do and logs were perfect since we have a whole decision making process and makes it easy for users to follow and developers to troubleshoot. Personally for me I noticed even when I am at home my average accuracy was around 350 so I decided to set mine to 400.

As Hellis81 is proposing, I am now using high accuracy mode, when connected to my cars Bluetooth.
Today I did another test and deactivated that option, to check in the App’s log, why location updates come in so sparsely, when not using the high accuracy mode.
On my drive to practice (~15 Minutes) I did not receive a single location update. There was nothing disregarded in the logs. I could just not find any single line regarding a location update…

So for now I will use the high accuracy mode, when connected to Bluetooth, but I’d be interested in why that “low” accuracy mode is performing so poorly on my phone when traveling.

If you did not see a log statement saying location update received them the app never got an update from Google.

Reviving this thread to add an observation : I had very sparse location updates and HA would take sometimes a lot of time detecting someone leaving the house. I noticed that the moment I launched google maps, HA updated its location and the automations ran.
So I looked at Google maps notification/access rights and deactivated the option “remove rights when the app is not used”. Lo and behold, now the GPS updates are more frequent and automations work as intended.
Edit : Not sure about this solution anymore… But using a persistent connection with HA seems to work flawlessly (in HA companion app settings).
Hope that helps someone.

3 Likes

I have set up a notification if my garage door opens and nobody (my wife and I) is home. The issue is that my wife’s phone does not seem to trigger home zone quickly enough and I get the alert most times she opens the garage door (and I am not home). I believe I have the high accuracy settings in her companion app set up around our home zone but I guess her location is not being updated fast enough to detect that she is in the wider home zone radius to trigger high accuracy mode before she arrives home.

Does anyone have any ideas on how to tweak settings to make this more reliable?

You can try deactivating battery saving mode for google maps and HA.
Otherwise, adding the wifi connection status is a pretty efficient workaround

Hi, I would like to reopen the discussion to ask for help:
I’m trying to get a gps location update every 3/4 seconds when I’m returning home.
My plan is that when I am approximately 200/300 meters from home the automatic gate should open.
Without draining your phone’s battery too much?
I read in the thread about an expanded home zone. What is it, how is it configured? works?
What code should be put in the configuration.yaml?

all that you need to know starts from this point https://companion.home-assistant.io/docs/core/location#android-location-sensors high accuracy mode is a sensor setting which is described at the end.

I haven’t undestood what mean “aggiorna il sensore con i sensori di posizione”… I thins in english sund like as “update the sensor with position sensors”
anybody can says me what it does?

I would like to stop high precision when I’m connect on my wifi… how I can do it? thanks

I have several things that are still not clear to me, and above all it would be nice if Home Assistant Companion could… first of all, being able to decide the timing with which the sensor is updated… the difference between 1 minute and 15 minutes is too much… it should be customizable… secondly… it should distinguish whether you are moving or not… if you are still, it is useless to update the position… if you are moving, it would be interesting to update more and more often as you get closer to home… the fact that there is the possibility to choose high precision excluding the home zone is beautiful but it should be implemented… both for distance ranges… and the possibility to say that if you are connected to a WiFi then you can disable high precision… I am having a lot of difficulty getting my device tracker to work correctly and especially in the background…

what’s yours cofigurations of sensor position update?.. 1 minute or 15?

did you read the link i sent, last paragraph in this section https://companion.home-assistant.io/docs/core/location#location-sensor-settings

on the same page I linked you to:, 3rd sentence from the bottom

https://companion.home-assistant.io/docs/core/location#notification

check the troubleshooting steps in the docs https://companion.home-assistant.io/docs/troubleshooting/faqs#device-tracker-is-not-updating-in-android-app

depending on your device you may have multiple background options to disable, some devices add more options there.