Life360 Device Tracker Platform

What version of life360 do you have installed? If it’s at least 2.9.4 then HA should be installing the life360 pypi.org package (aka “core” life360), you shouldn’t have to do that yourself.

I have version 2.10. I’m not sure why it’s not installing automatically, but is there any way I can install it myself?

Yes, don’t use hassio! lol! But seriously, I have no idea. I know how to do it with a venv install, but not for hassio. Hopefully @scubieman or someone else using hassio can help you out.

Push me in the right direction from Hass.io. I’m fairly new to this, and that seemed like the easiest way to go. I’m running it on a Rasp Pi.

I was kidding. I don’t know a lot about hassio, but I know a lot of people use it. Besides the ease of getting started I believe it has other benefits, too, but again, I really don’t know what they are. I’ve been using HA for about a year now and don’t seem to miss whatever hassio brings to the table. I’ve seen enough issues, though, to keep me from seriously looking into it.

I know you were kidding, but I’m serious :slight_smile:
I’d prefer not to use a full blown server at this time, so I may load Raspbian then try the docker install. What do you think? https://www.home-assistant.io/docs/installation/docker/

I’ve seen issues with docker, too. But then again, I know a lot of people go that way, too. I’m probably not the one to ask. FWIW, I also started with a RPi. In fact, my “production” system is still running on it. I’ve been in the process of slowly moving to an “old” laptop (Core i7 w/ an SSD, so not too shabby :wink:), but that has taken a bit of a back seat to the work I’ve been doing on this and the amcrest component. Anyway, like I said, I use a venv install which, to my mind, makes things a lot easier. But I’m pretty ignorant when it comes to docker and hassio.

Thanks again, not only for your time replying to me, but for your work on the component. Do you happen to have a link that might help me with a venv install?

This is what I used:

Hi, i have these setting for the device tracker:

- platform: life360
  username: !secret life360_username
  password: !secret life360_password
  prefix: life360
  driving_speed: 18
  max_gps_accuracy: 200
  time_as: local
  interval_seconds: 10
  show_as_state: driving, moving, places
  add_zones: all

and i noticed that this template with the device tracker doesn’t work. I suppose it depends from the state as not_home is not a state with that configuration.

- platform: template
  value_template: "{{ is_state('device_tracker.life360_maurizio_fabiani', 'not_home) }}"

Am i right? And how to have the automation working when i am not home? Maybe with Moving ?

Even with other device trackers that wouldn’t always work. Whenever any GPS-based device tracker is in a Home Assistant zone (other than home) the state will not be 'not_home', but rather the name of that zone. By using show_as_state: driving, moving, places you’re just creating more opportunities for the state of the tracker to be something other than 'not_home' when you’re not home.

What you want is:

- platform: template
  value_template: "{{ not is_state('device_tracker.life360_maurizio_fabiani', 'home') }}"

Now, having said all that, you also had a typo in the template – you were missing a single quote at the end of 'not_home. :wink:

1 Like

Ok thanks for the good explanation and for the right example!
P.S. The typo was a wrong copy and paste…

1 Like

I’m back (sorry). I successfully have HASS running in a virtual environment, and I have to say, I think this will work (for me) much better. I have a lot more flexibility this way. The only thing I miss is the HASS.IO add-ons, but I believe I can add that back on if I really want it.

I just wanted to thank you Phil and let you know that it worked without issue with this setup. I tried numerous times with the HASS.IO image and it simply wouldn’t work.

1 Like

Thankyou phil
I have installed the life 360 and it works great with node red and the geofence node.

1 Like

… and still waiting.

Honestly, not sure how to get this done. I think I’m proposing a reasonable compromise, but it seems to be dead in the water. No response in over 9 days. If anyone has any suggestions, I’m all ears. Or feel free to chime in.

[Add support for Life360 device tracker PR #23405 ](https://github.com/home-assistant/home-assistant/pull/23405

FWIW, I think this part of the discussion is the crux of the matter:


balloob 9 days ago

Home zone is created based off the core configuration. We can’t have integrations start overriding it, because it won’t be clear who “owns” the data and there is no longer a single source of truth.

pnbruckner 9 days ago

Sorry, but I don’t understand this.

First, as I already mentioned, the need came from practical experience. If HA and Life360 have different definitions of home then they can, and will, disagree. This has been noticed by the users of my existing custom component and has caused confusion.

Second, to avoid that bad situation the two systems need to come into agreement as to where home is. Either this needs to be done manually, which is error prone and not as easy as it might seem (HA defines via GPS coordinates, whereas Life360 does it via address or a map), or this can be done automatically for the user. At least making HA agree with Life360 can be done automatically. (See this on the proposed doc page for more details.)

Third, who’s to say whether HA’s or Life360’s definition of home is correct? I think this should be up to the user. Updating HA’s home zone from Life360 info is a configurable feature – the user can decide whether that’s what they want or not.

And lastly, even in HA there is no “single source of truth”, because it can come from either configuration.yaml or from an IP address lookup. And even if it comes from the config, there’s two choices: under homeassistant or zone. So that’s three different places it can come from in HA.

The bottom line to me is, it should be up to the user, and having a way to automatically keep the two systems in sync is better than forcing a user to manually copy data from one system to the other.

Oh, and BTW, if debug is enabled it tells you that it’s doing this:

2019-05-13 12:58:59 DEBUG (SyncWorker_29) [homeassistant.components.life360.device_tracker] Updating zone.home from Place: Home: LATITUDE, LONGITUDE, RADIUS

pnbruckner 2 days ago

balloob so how can we make some progress on this? Maybe I should back out the changes to the zone and owntracks components and just put the life360 code back the way it was, which as I’ve said, has been not only working well in my custom component that many, many people use, but it also solves the real problems I’ve outlined. Then you can take your time to work out what you want to do with zones, and then this, as well as owntracks, etc., can be updated accordingly. But in the meantime I can retire my custom component and people can start using a standard component.

I think I’m going to take the time to reconsider how configuration is done. I think if this comes into more widespread use the current configuration options are insufficient to handle all the complex Circle/Member/Place scenarios out there. I also need to look into maybe making this configured strictly via the UI, since that will probably be necessary. Anyway, making this a standard component is back to being a Work-In-Progress. In the meantime the custom component is still available.

If anyone has any thoughts about config options overall, by all means, let me know.

1 Like

The way that I use your component is to treat is as an independent sensor. I define places in the Life360 app and use those names in my automations. I don’t try to sync Home Assistant and Life360.

I did define some zones in Home Assistant but they are only used as labels on the Home Assistant map.

I’m not sure if this helps and I’m not suggesting anything. It’s just the way that I use it.

1 Like

Same here. If I need specific zones defined, I define them in HA. Not interested in syncing between Life360 and HA.

Hi, hope this custom component will be available with HACS, from the custom_updater developer

1 Like

Sorry, but that probably won’t be happening. First, I’m focusing on trying to make this a standard component. Second, HACS requires each custom component to be in its own github repository, which none of mine are. At this point it’s not worth the effort to completely reorganize my github repo, and custom_updater, AFAIK, still works.