I’m using Home Assistant OS (core-2021.12.10) and I have managed to get Google Maps based location tracking functioning on three devices/accounts (my own and two children). For some reason, with one of the devices/accounts (Motorola Moto G50), the location is not updating (and is not delivered) in HA automatically. If I remember correctly, with the previous device (old Samsung J5 2016) there were no problems (till about 12/2021).
I have followed all the HA Companion App General and Troubleshooting instructions (sensors enabled, settings fine and not restrictive, no obvious errors in logs, all the background permissions etc. OK). I don’t know does it have anything to do with this, but the owner of the Google account is the youngest one and therefore the account is the most strictly administered by Google, even though I have tried to enable all the settings related to location. To me it seems that the (Google Maps based) location is only updated, when I open the Google Family Link App and update the location there-in.
Has anyone had any similar experiences and/or any ideas how to solve this issue?
What do the location logs look like? Look at the logs for about 10 minutes to get a good idea to see if it is similar to the provided example in the troubleshooting section
For example for all this day for me I have got a large number of location updates (at home), but for the problematic device/account the location did not update (neither to Google Family Link nor to HA Map) until I opened Google Family Link and updated the location manually.
Please find below one extract from the logs:
> 02-08 22:10:38.142 17074 17074 D LocBroadcastReceiver: Got single accurate location update: Location[fused XX,YY hAcc=16 et=+5d13h27m23s831ms alt=154.39999389648438 vel=0.76224196 bear=89.45026 vAcc=2 sAcc=1 bAcc=??? {Bundle[EMPTY_PARCEL]}]
> 02-08 22:10:38.142 17074 17074 D LocBroadcastReceiver: Location accurate enough, all done with high accuracy.
> 02-08 22:10:38.142 17074 17074 D LocBroadcastReceiver: Last Location:
> 02-08 22:10:38.142 17074 17074 D LocBroadcastReceiver: Coords:(XX, YY)
> 02-08 22:10:38.142 17074 17074 D LocBroadcastReceiver: Accuracy: 15.774
> 02-08 22:10:38.142 17074 17074 D LocBroadcastReceiver: Bearing: 89.45026
> 02-08 22:10:38.142 17074 17074 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
> 02-08 22:10:38.142 17074 17074 D LocBroadcastReceiver: Received location that is 1142 milliseconds old, 1644351037000 compared to 1644351038142 with source fused
> 02-08 22:10:38.143 17074 15835 D UrlRepository: localUrl is: false and usesInternalSsid is: false
> 02-08 22:10:38.151 17074 17074 D LocBroadcastReceiver: Got single accurate location update: Location[fused XX,YY hAcc=16 et=+5d13h27m23s831ms alt=154.39999389648438 vel=0.76224196 bear=89.45026 vAcc=2 sAcc=1 bAcc=??? {Bundle[EMPTY_PARCEL]}]
> 02-08 22:10:38.151 17074 17074 D LocBroadcastReceiver: Location accurate enough, all done with high accuracy.
> 02-08 22:10:38.151 17074 17074 D LocBroadcastReceiver: Last Location:
> 02-08 22:10:38.151 17074 17074 D LocBroadcastReceiver: Coords:(XX, YY)
> 02-08 22:10:38.151 17074 17074 D LocBroadcastReceiver: Accuracy: 15.774
> 02-08 22:10:38.151 17074 17074 D LocBroadcastReceiver: Bearing: 89.45026
> 02-08 22:10:38.151 17074 17074 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
> 02-08 22:10:38.151 17074 17074 D LocBroadcastReceiver: Skipping old location update since time is before the last one we sent, received: 1644351037000 last sent: 1644351038142
> 02-08 22:10:38.154 17074 17074 D LocBroadcastReceiver: Got single accurate location update: Location[fused XX,YY hAcc=16 et=+5d13h27m23s831ms alt=154.39999389648438 vel=0.76224196 bear=89.45026 vAcc=2 sAcc=1 bAcc=??? {Bundle[EMPTY_PARCEL]}]
> 02-08 22:10:38.154 17074 17074 D LocBroadcastReceiver: Location accurate enough, all done with high accuracy.
> 02-08 22:10:38.154 17074 17074 D LocBroadcastReceiver: Last Location:
> 02-08 22:10:38.154 17074 17074 D LocBroadcastReceiver: Coords:(XX, YY)
> 02-08 22:10:38.154 17074 17074 D LocBroadcastReceiver: Accuracy: 15.774
> 02-08 22:10:38.154 17074 17074 D LocBroadcastReceiver: Bearing: 89.45026
> 02-08 22:10:38.155 17074 17074 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
> 02-08 22:10:38.155 17074 17074 D LocBroadcastReceiver: Skipping old location update since time is before the last one we sent, received: 1644351037000 last sent: 1644351038142
did you enable any location setting? Like include in sensor updates under single accurate location? I see a lot of logs from that sensor but not from the background location update sensor which is where updates are supposed to come from.
No its a sensor setting under Single Accurate Location. It only gets triggered when the app receives a lot of inaccurate reports or when the user requests them.
Companion App > Manage Sensors > Single Accurate Location > Sensor Settings at the bottom
I’m afraid toe even admit how I resolved my location update issue. I went into apps on my phone scrolled down to maps, and went into permissions, location and it was set to only allow while using the app. After changing that to all the time. My location change on Home Assistant is nearly instantaneous.
@ejkeebler Thanks for the reply! Did this happen for you with a device controlled by Google Family Link or was it an “adult’s” device?
Actually yesterday noticed the same. I started toggling the Google location settings and then went to allow/enable various permissions for Google Maps. This was interesting that the issue originated from Google Maps permissions and enabling all the other location related settings wasn’t enough. Was this expected @dshokouhi and is there an explanation for this?
I think you misunderstood me I am talking about a sensor setting for Single Accurate Location.
Once you go to that sensor page scroll down and youll see an option for Include in sensor updates. Just make sure its turned off and it wasnt turned on because it has a tendency to cause conflicts. It is off by default but some users enable it as a form of troubleshooting for some reason.
My pixel 6 pro has location set to only when app is opened for Google Maps and my location updates are fine for HA.
the app uses google services for location updates, how that is implemented on a device depends on a manufacturer. All the app does is make a request to the google service and wait for updates to come in. The logs show this communication.
yes that toggle exists because its the old behavior of location updates and it has a tendency to drain the battery as it makes a GPS request for location as opposed to using googles fused location provider.
Well I know that google maps houses some of the location API logic because if you install the app on a amazon tablet location tracking will not work until you install google maps and open it once. Now amazon devices dont ship with google services, you have to manually install them to get things like the play store to work. This sounds like a device specific issue as its related to google services and doesnt occur on every device.
OK, I changed the “Include in sensor update” OFF. Let’s see what kind of effect it has. Perhaps this and the “Google Maps” issue could be added to the HA Companion App Location Troubleshooting FAQ page (don’t know where this could be suggested).
no its an adult device, but I honestly dont remember ever setting that, and I guess the majority of the time i’m using it is in the car for navigation, so I guess I just never noticed it was set that way. But honestly for 6 mos i’ve been trying to figure out why home assistant seemed to just not update my location unless I checked my location, had every home assistant sensor enable to high i could think of.
Clearly things are a bit different for how you are using this as a family device, so not sure if it helps. I changed my sons phone as well and it seems to be working much better now too.
The primary use case honestly is just so the door unlocks and I dont have to key in a code when I get home, to make it easier to carry things into the house.
Two years later… Did you solve the problem? I have exactly the same problem with my youngest child’s phone (Family Link enabled). I’ve gone through all the settings and they are identical to the other child’s phone, where the location information updates just fine. (This phone also uses Family Link). Both phones are Samsung phones. The location services of Google Maps and Family link work well, but the Home Assistant’s status is not updated when the child is outside the home area.
I’ve tried all troubleshooting but nothing seems to help
I gave up :). Let me know if you get it working. Actually one reason for giving up might have been also that Google FamilyLink location based notifications got introduced/improved to create notifications, when the phone enters/leaves some area. I was not interested to track the path of the phone.
A few things stand out when reading this thread. The thread is about Google Maps integration (Recently an improved, more user friendly version was introduced in HACS). It can be used for location tracking.
However, instructions followed by some are those for Home Assistant Companion based location tracking. That too can provide the same functionality, but it is not the same thing.
Google Maps integration relies on Google Maps to be running in the background, Home Assistant Companion app relies on the Home Assistant Companion app. Either app will need permissions to use (accurate) location information in the background, either must be excluded from battery management ‘features’ that stop applications, and also need to be guarded from privacy features that remove rights if you do not open the app for a while.
Google Maps integration is in my experience slower to relay position information and at times less accurate than Home Assistant Companion app is. Both may very well not be updating quick and accurate enough to open and close doors for coming and going. Besides the accuracy of the location, also the update frequency comes into play. For that to work a router/wifi/ping or bluetooth based device tracker can improve response time a lot. They can tell if you are really close or not, and do it fast. What they lack is GPS coordinates, which the other integrations have.
You can use multiple device trackers in the person integration, or you could use the composite integration from hacs to combine information from multiple device trackers to get the best results. The composite integration is a bit smarter about it and has more configuration options.
If you can live with a minute or so delay, the companion app alone will do just fine. It has a trick or two by using extra sensors and checking for wifi. I can also reccommend adding a router or wifi based device tracker. I would use Google Maps only as an additional source, not the main one.