Life360 Device Tracker Platform

you must understand that… and of course I understand it’s not reporting a city, but the continent and capital of the country the lat/lon belong to.

if

It’s only trying to report a name for the time zone, which as you say yourself, contains many cities. If ‘Europe/Berlin’ and ‘Europe/Brussels’ are equivalent, then from the perspective of indicating the zime zone, either is just as good as the other.

than you could probably agree that isn’t the optimal perspective… What would be correct is displaying format UTC +2 for my timezone. translating that to any of the possible (many tens of) time_zone names is a bit risky as it now turns out to be. What use is an incorrect attribute .

All the more, if another package could do this better (and of course I don’t know that, merely reporting what it does do perfectly), why not give it a look?

I mean, if the component bases all info on the given gps’s lat/lon, shouldn’t it be getting the correct time_zone’s name?

No, it’s not reporting that either.

First and foremost, the datetimes reported have the correct time zone “suffix”, e.g., ‘+02:00’. Reporting a name for the time zone was as easy addition. And when there are multiple choices, then any is as good as another for reporting a name for the time zone.

I’m sorry you’re trying to derive a city location from the time zone name. That’s not a valid thing to do. The attribute’s name is time_zone, not city, or even location.

If you want to report a city name for the GPS coordinates, that’s a feature request. And since I’m not working on the custom component anymore… :wink:

EDIT: I just checked the code again. In fact, it’s getting a time zone name directly from timezonefinderL, then it uses a HA utility to convert that to a tzinfo. So if you have an issue with the choice that timezonefinderL is making, Issues · jannikmi/timezonefinderL · GitHub

EDIT 2: Looks like there is a new version of timezonefinderL. I used 2.0.1, but now there is a 4.0.2. (Don’t get too excited, 4.0.2 is the next release after 2.0.1. lol!) Anyway, you can try changing the version in manifest.json and restart HA and see if it gives you any better results.

geopy can get city, country, etc from the lat/long values…not sure why you’re not getting the extra location details you want directly from the precise location rather than using timezone…

My point was that if they tried to configure the life360 integration in any version less than some flavor of V95 it won’t work.

I was saying that for the integration to work they would have to install some version of 95.

Ok, I was confused because I’ve said multiple times it’s available in 0.95.0 beta releases which are available now and have been since 6/19.

Guess it doesn’t hurt to make sure. :slight_smile:

1 Like

Whats the battery drain on Life360 like compared to Owntracks? Is Life360 better overall in terms of accuracy?

100% yes yes yes yes

I’ve used both and OwnTracks was a battery hog. I switched to Life360 before it worked with HASS and started using this app as soon as I saw it on the forums about a year ago. At the time it was more important to have an accurate location on my children than it was to have that location included in HASS. Integration into HASS was just the icing on the cake and this CC has always proven to be fantastic. Glad to see it going “official”.

I’ve only used OwnTracks for a very short time, and that was mostly for testing a fix I made to the integration. I don’t really have any experience with it’s battery usage to share.

Life360’s claim to fame is its ability to provide fairly responsive and accurate location information while minimizing battery drain. They are a for profit company with paid staff as opposed to an open source project. Although I have no scientific data to back it up, my money (literally) is on Life360 (i.e., I have a paid subscription. :slight_smile:)

You might want to search the forum. I’m sure there are plenty of topics in which people share their experiences with OwnTracks.

EDIT: FWIW we’ve been using Life360 from August 2013, first just the app, then with SmartThings, and now with HA. It’s been installed on multiple cell phone models over the years, including both Android & iOS, and we’ve never noticed a battery issue. E.g., I just looked at the battery usage on my Android phone and it says Life360 has used 1%, same as Google Maps, and very much less than most of the other apps & system processes listed. I think that’s pretty typical.

We have been using Life360 for about 5 years and its been great with minimal battery impact!

HI Phil,

sorry if I expressed myself unclearly, but that’s not what I am trying to do, just didn’t find the words ‘time zone name’… I am not trying to find a city location from ‘time zone name’, I am trying to find the correct ‘time zone name’ for my lat/lon.

no, that’s not needed any longer, the AppDeamon gives me all that and more.

I will try, and report back, though the release notes make note of a lookup:

* use the precomputed shortcuts to instantly look up a timezone ("instant shortcut", most common zone of the polygons within that shortcut)

not sure if that has the correct ring to it… we’ll see.

sure, and Geopy package does a perfect job in the AppDeamon app. Which adds, not replaces, attributes to the existing life360 device_trackers. So many extra details even, it’s almost scary, and precise up to the restaurant people are in…

So the ‘time zone name’ life360 reports is not changed, would not dare to meddle with such a fine CC.

don’t get me wrong, it’s only since yesterday that I noticed the LIfe360 cc reporting incorrect ‘time zone name’.

No big deal, and I haven’t driven to the wrong country because of it. But now that I know, it bugs me reported attributes are not always correct.

Update

using the updated timezonefinderL 4.0.2 does make a difference, and at least 1 of the 2 involved trackers now reports the correct ‘time zone name’ . The other tracker that had the incorrect ‘time zone name’ now shows correctly on both :wink:

thanks for the tip!

Just an FYI, seems I introduced a small bug when simplifying the custom component in the process of submitting it to become a standard integration. I’ve already submitted the fix, and it will probably be in 0.95.1.

If the Life360 server provides no location information for a Member, rather than logging an error properly, the bug causes an exception. If there were more Members to process on that update cycle, then the update for those Members won’t happen. Assuming the missing location information was temporary (which it normally is), then all Members will be updated on the next cycle. FWIW, missing location information doesn’t happen very often.

So, if you see the following in your log, then it’s caused by this bug and it will be fixed soon.

2019-06-26 06:49:08 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/life360/device_tracker.py", line 354, in _update_life360
    self._update_members(members, members_updated)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/life360/device_tracker.py", line 302, in _update_members
    self._update_member(member, dev_id)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/life360/device_tracker.py", line 177, in _update_member
    last_seen = _utc_from_ts(loc.get('timestamp'))
AttributeError: 'NoneType' object has no attribute 'get'

Thanks you pnbruckner for this creat component. It is the most accurate device tracker. Great job!

For me one of the elements is to get the speed of a device at a certain point. I added an automation for this. When entering a zone the speed is stored in a binary value.
The problem was… it was always ‘0’ (zero) I had no idea what was wrong.

So I took two phones and go on a ride. In the beginning the speeds where displayed and updated in Home Assistant. 11 km/h… 20km/h… 19km/h… But suddenly, after a few minutes, both phones had a speed of 0 km/h and stayed that way.
Other values such as gps accuracy where still updated.

I do not know if this is a problem of Life360 (cannot find the speed readings anywhere) or this script. Hope you can take a look into this.

Thanks you

1 Like

The life360 HA integration does nothing on its own regarding determining speed. The only thing it does is to convert the raw number that comes from the server to a known unit of measurement (mph or kph.) If you’re getting zero, then that’s because that’s what’s coming from the Life360 server.

Thanks for the quick reply.
Is there anywhere on the Life 360 website where I can monitor the speed? When I can confirm I shall contact them.

Don’t know. I guess I never really tried looking at someone’s speed via the Life360 website. I look at their location, and their history, but never tried to look at speed live.

What are you doing with the speed values?

I don’t know if they were testing something and removed it but at one point I would see a person’s speed in the Life360 app.

Since speed is passed, I was trying to use it but am still trying to figure out how what I want to do with it.

I think it would be cool to take speed along with lat and long values and put them down on a map.

Possibly using the grafana worldmap panel https://grafana.com/plugins/grafana-worldmap-panel/installation

I added a Grafana graph using speed and it seems pretty accurate.
The following is with 2 people in the same car.

@CreatoX @surge919

FWIW, I’ve just implemented a feature in my composite tracker to calculate speed based on the distance between consecutive GPS coordinates and the time difference between them. This way speed can be calculated no matter what type of (GPS-based) tracker(s) you’re using. I’ll probably release that new feature soon.

1 Like

Hey @pnbruckner just noticed that the migration guide forum post (which is linked to from the release notes) should be updated.

It still lists show_as_state as something that is “no longer supported and must be removed” even though it was added back shortly after that guide was written.

1 Like

I use the speed to dertermine what vehicle I use at that time.
< 40 km/h is bicycle

When I come home from work, I want the garage door to open and close automatically so I can park my bike.
There is no room for my car :slight_smile: So I only want this to happen when I’m on my bike.

I use the exact same route by bike or by car.
The speed measurement is taken place somewhere on the route where the car is on the highway. Almost imposible to get a < 40 km/h reading :wink:

Sounds great, pnbruckner!