GPS/Location update frequency

Is there any setting/option to set the GPS/location update frequency?

I see it updates ~1-2 minutes now and would like to be able to set that (from home assistant perspective - not the app) at desire.

I currently have GPS Logger (been using it for years) and the Home Assistant companion app for both myself and my wife. My GPS Logger app is set only to track “passive locations.” Most of the time if I look at the map when one or both of us is out, the GPS Logger entities will be where it needs to be, but the Home Assistant app entities lag up to 10 minutes.

Using GPS Logger as a reference of possible GPS/location settings would be a good start.

The app uses Google’s location provider so anytime it has an update for us and it meets the accuracy requirements we send it over

Are you sure about that?
I see this very often.

Almost constantly actually, but my sensor is not updating that often.
Which is odd, HA request a position but it’s not saved.

During the time I wrote this post, it has come up three times

Google?! please tell me my location data is NOT going via or to google!?

yes you can expect to see location updating that frequently that was why I said anytime google has an update for us and it meets the requirements we send it over. Sometimes you can see updates coming in every 30 seconds like if you are using google maps navigation for example.

Sensors update on a completely different interval…some update every 15 min and some update upon a state change. Location also updates when the sensors update.

If you are using the google play store version then yes, we recently released a minimal app version taht does not use any of googles services and therefore does not do location tracking, notifications nor use any of its API’s. We had a blog post about this a couple weeks back.

Why can’t the app just use “the phone’s” GPS? Without using google?

You know the app is built by developers who donate their own free time. We have not had a developer come by and create a location tracker that does not rely on Google as that takes a lot of time to build out.
Google provides APIs that are well tested and do not drain the battery and not to mention easier and faster to build out. We are open source so any developer is free to come along and add it!

4 Likes

Ok, fair enough I understand the opensource/development part. But I do not understand why asking the phone’s direct GPS location instead of Google doing it and send it to an app makes a battery difference :thinking:

1 Like

An alternative to solve the problem is to use the request_location_update service made available by Hassio.

In my case I was interested in the increased GPS update rate activity as I got closer to home. Through the proximity service, when I go below 3 kilometres, I make it intensify until I get home or stop, requesting an update every 10 seconds.

So I built an automation (which can be used for both Apple and Android) to do this. I leave you the corresponding piece of code if it helps:

- alias: "GPS - increase freq update Person position near home"

  trigger:
    - platform:  numeric_state
      entity_id: proximity.your_device
      below: 3
       
  action:
    - repeat:
          until:
            - condition: or
              conditions:
                - condition: state
                  entity_id: person.you
                  state: home
                - condition: state
                  entity_id: proximity.your_device
                  attribute: dir_of_travel
                  state: stationary
                - condition: state
                  entity_id: proximity.your_device
                  attribute: dir_of_travel
                  state: arrived
                - condition: numeric_state
                  entity_id: proximity.your_device
                  above: 3
          sequence:
            - service: notify.mobile_your_phone
              data:
                message: request_location_update
            - delay:
                hours: 0
                minutes: 0
                seconds: 10
                milliseconds: 0

Alternatively, you can also set the forced location update unconditionally as often as you like, but BE AWARE that (as written in the documentation) it could have a negative impact on the device’s battery.

I know it was an old post but I think this solution could be useful for anyone looking for an alternative.