Device Tracker, Best echange for Life360

I’ve found with this integration though (or the google maps app), the GPS accuracy attribute often goes from 20 to 5 all of a sudden, and it will report that someone has left the house, because they jumped outside of the zone.

Still trying to find a solution for that. For now I just make the zone bigger, but that also means I will detect people leaving the house later (although I do see them come home earlier!)

This didn’t use to be a problem with the life360 integration. I thought it was an android problem as per previous posts as well, but I’ve seen it on iPhones happen as well.

Well first, a smaller GPS accuracy value means a more accurate location fix, not less.

The accuracy value can be thought of as the radius (in meters) of a circle around the point specified by Latitude & Longitude. The actual location of the device is anywhere inside that circle. So, smaller accuracy means smaller circle means smaller area within which the device is actually located.

If the accuracy jumps from 20 to 5, that means it more accurately located your device.

The accuracy, I assume, comes from the device’s GPS system. So, I would think that would be common to Google Maps and Life360. However, I don’t know if maybe the two apps ask for the location in different ways and/or with different parameters. Maybe Life360, in general, gets more accurate readings more often than Google Maps does. Don’t really know. (FWIW, I’ve recently started using GPSLogger, and that app has parameters you can change as to how fast/accurate it gets a GPS fix. That is what I’m basing my comments above on.)

Another thing to consider is the max_gps_accuracy setting for the HA integration. Both Life360 & Google Maps has a setting like this. Basically, if the reported accuracy value is bigger than this maximum, (i.e., the location fix is less accurate than the limit), then the update is skipped/ignored. This is to prevent very inaccurate readings from providing undesirable results. Still even if the center jumps way out of a zone that the device is still actually inside due to an inaccurate fix, in theory at least, the GPS accuracy value should create a circle big enough to still intersect the zone’s circle, so it should still report the device in the zone (unless, of course, it now overlaps a different zone as well!) If you haven’t specifically set this option, the default (for Google Maps) is 100,000 meters, so effectively there is no limit (the circumference of the Earth being less than 25,000 meters) and all updates, no matter how inaccurate, will be used.

Lastly, and I covered this a few posts up, Google Maps by default only updates every 60 seconds, whereas Life360’s update interval was like 10 or 12 seconds (I think.) But you can configure Google Maps to query more often if you like. Although, I’m not entirely sure what the ramifications may be to querying more often, if any.

1 Like

Ah that makes sense. My max_gps_accuracy is set to 200, so that’s probably why it jumps out of the home circle.

Yes I also setup google maps update to 10 seconds, CPU seems somewhat increased but I will have to check in the daytime.

I have noticed that iPhones in my experience so far actually work better. I have one Samsung galaxy tab 10.1 who keeps lagging behind other phones for 2-3 minutes. A side effect of that it seems (as the other phones don’t do this (as often) it keeps reporting it home/left home etc, I don’t think that should happen.

I have the device_tracker set to :

    max_gps_accuracy: 100
    scan_interval: 10

And my home zone has a radius of 50. But this happens when the tablet is far away as well. The tablet might have bad gps but then I still would not expect the integration to report it as home or away when it’s clearly not home and flip between those when it’s 10km away. I noticed when I set the accuracy to like 50 or 20 even, the other phones also start exhibiting this kind of behaviour, so I put it back up to 100.

Maybe I need to put it much higher for the tablet to behave.

The integration does not decide what zone the device might or might not be in. It only reports the location & accuracy, and the device tracker component level code decides on the state of the entity.

The way it does that is by comparing the “location circle” (as I explained, based on the lat/lon & accuracy) to all the “zone circles” (based on lat/lon & radius.) If the location circle intersects one or more zone circles, then the device’s state will be the name of the “best” zone circle (based on distance from the center of the location & zone circles, etc.) If it does not intersect any zones, then it is away (i.e., not_home.)

So, if a device is jumping around, it’s what the device is reporting, and the Google Maps integration is only the middleman between the device and the device tracker component level code. It can’t know that the device is reporting incorrect GPS data (including accuracy.)

Have you tried adding a map card with those tracker entities and set a history period of maybe a few hours? It will show a “bread crumb” trail for each device. You can then see exactly where it is reporting the device is (even if it really isn’t in some of those locations.) It doesn’t, however, show the accuracy circles. You could also create a template entity for each tracker entity whose state is the accuracy of the associated tracker entity. Then you could also plot a graph of that to see if/when it reports very inaccurate (i.e., high value) results. (Of course, that will only show values up to the set max accuracy.)

That doesn’t make any sense. Again, with smaller maximum accuracy settings the integration with “throw out” more inaccurate updates, not the reverse.

I have a custom version of the Google Maps integration available for beta testers. You can find it here:

pnbruckner/ha-google-maps: Custom Home Assistant Google Maps Integration (github.com)

See the README.md for details about what’s new, how to use it, etc. (I still need to fill in the section with the detailed instructions of how to obtain a cookies file, but that info is already “out there”, so let me know if you need a link.)

If anyone wants to give this a try, please don’t hesitate to ask for help, and please provide feedback, good or bad. I want to get any remaining issues (none that I’m aware of right now) resolved ASAP.

2 Likes

Hi,

I have installed your integration. I think one step is missing during the installation. We must go to the Settings, devices and services and install the Google Map integration. Apart from a small lack in the documentation, no problem to install.

Thank you for your work.

1 Like

To be honest I find that google maps is not a really good exchange for life360. The foundation is different and the integration and possibilities are very different. A service like Glympse.com is more like life360. But that would need some love from a developer before it can work.

Thanks for giving it a try. I’d really like to hear how it works for you.

Well, technically speaking, that is not an installation step. Installation is getting it into the custom_components folder so HA knows it exists. You do that via HACS or via manually installing it.

What you are referring to is the same as any integration you configure via the UI. You “add” an integration entry and supply any required configuration data. Some integrations can only be added once, and others, like this one, can be added as many times as you like, in this case, once per Google account you want to use.

I’m not sure it’s necessary to explicitly state this in the integration specific documentation since it’s a common HA procedure.

Anyway, I’ll make a mental note of your comment and if this becomes a common problem, I can add more explicit instructions.

You’re very welcome! :smile:

That’s pretty vague. Can you expand on that?

I’ve used Life360 & Google Maps in HA for years and both have worked pretty well, at least as far as providing useful location (and other) data.

I’m very interested to hear what you base those comments on and what you think is lacking in the Google Maps integration. Thanks!

1 Like

I thought it would be clear. But I’ll explain.

Life360 is made to track people and their movements. Also I can get movement history. It’s made for the whole family and help the family.
Glympse does the same, but market it as a business thing. But the idea is the same.
Google Maps is an atlas with a lot of abilities such as plan routes and navigate them. Sharing locations of places and people is one of those abilities. Though it perfectly shares your location and the location of others (adult members only), it does not work like life360. I can’t use the app to see where other are in a split second. The map it crowded with other places Google thinks I would be interested in and I have to zoom out to see other without all the other places. Also I can’t get the history of people of where they have been during the day. What Google is good at is search, and Google Maps is no different. But it is not a people tracker.

TL;DR: The API of Google Maps functions fine, it’s the android App which lacks to much tracking ability for my taste.

Please see the following new topic for more information & discussion concerning my custom version of the Google Maps integration:

I now see more clearly what you mean. I’ve added details in the above linked new topic, and I’ll be adding them to the custom integration doc as well. Thanks!

1 Like

Ok, I see now you were talking more about the Google Maps app (or website), and not Home Assistant’s integration with it. Fair enough.

The good thing is, the HA integration (and my custom version of it) provides the information you’re interested in without all the other bells & whistles, including location of those who have shared their location with you, and you can even get “bread crumbs” if you use HA’s Map card.

After testing google maps for a couple of weeks now I can add a disadvantage to my list. It is slow with it’s updates compared to life360. So slow, that my house does not notices me home until about 2 minutes after I arrive. That is a big no-go for me.

There are many factors that affect how quickly HA will see a location update from the Google Maps integration.

Which integration are you using, the standard, built-in one, or my custom version?

What do you have the scan_interval or update period set to?

How many Google accounts have you configured the integration to use?

Note that by default, both the built-in integration and my custom version query the server every 60 seconds. That can be changed via a config option to anything you want. Life360, on the other hand, queried the server every 10 seconds.

The built-in integration, however, limits the update period to no smaller than 30 seconds if you only use one Google account. (If you use more than one, the limiting code doesn’t work, so in that case, you can actually have it update more quickly than every 30 seconds.) My custom version does not have this limitation.

So, basically, using the default configuration, the HA integration will take on average 30 seconds to see new location values from the server, or as long as a minute, whereas Life360 took only 5 seconds on average, or up to 10 seconds.

My recommendation would be to use my custom version and set the update period to 10 seconds. That should get you results that are closer to what you experienced with Life360.

1 Like

Ok, after testing this for a month now I can pretty certainly say that Google Maps in the Netherlands sucks big time. It only updates location when it want’s to. It’s offline more often then not. It’s completely worthless. So, I’m back in the game for a good alternative.

You still haven’t provided the requested information. You’re making blanket statements based on your specific scenario & experience, but it’s not clear how/when they would apply to others.

Also, are you sure the issue is not with your phone’s configuration? It’s possible Google is not getting updates from your phone as often as you’d like due to settings in the phone you could possibly change.

It may be true what you say, and nothing can make Google Maps in the Netherlands work well for anyone. I wonder, though, if that is really the case.

Anyone else in the Netherlands (who is reading this topic) have a different experience?

Regarding an alternative, I didn’t take the time to go back and re-read the entire exchange above, so maybe you’ve already decided against using it, but another option that works well as far as responsiveness is GPSLogger. It only works with Android phones, though. The standard, built-in integration is fine, but I also have a custom version of it which adds a last_seen attribute, if you’re interested.

I’ve have explained my use case before. But I will again. I want a cloud solution so it works without with HA and without HA. I want a dedicated app were I can track my family without the use of HA. I don’t use the HA app for that. I also like to see movement of family members in the app (something Maps really lacks). That is that in a nutshell something apps as Glympse or life360 would really be perfect for and apps as GPSLogger or Owncloud are not. I don’t mind paying for it all as long as it works. But at the moment there is no solution that works.

Maps has full permissions on all phones and battery optimalisation is disabled for maps totally. But still it won’t update as smoothly as others.

You can still use Life360 for location monitoring of other Life360 members devices. It just doesn’t work with HA anymore. And that seems to fit into your requirements.

or am I missing something…?

My home automation works with HA obviously and so HA does need to know my location. I just don’t like to use HA app as a map for finding my family. So life360 is not working for me anymore. There is a very good alternative called Glympse with a very well documented API and free use. But nobody seems to care and I am no programmer.