Life 360 support

It must be as @skalavala said. I tried the website interface again and was now able to login in just like @atomicpapa confirmed. So when I restarted the script on my HA instance everything is working again.

Looks like they are having server issues https://twitter.com/Life360/with_replies

Hopefully, it will be fixed soon!

In case anyone was still looking for an easy way to use Life360 with Home Assistant I created a hass.io addon. I would classify it as being in beta but it works pretty well so far.
https://github.com/editter/hassio-addons

3 Likes

Hi

Is this just for hassio or any version of HA?

Thanks.

I am new to Home Assistant but from what I understand addons only work with hass.io

Thanks very much for the Add-on @editter. I have manged to get it working. Life360 gets a lot of use in our house so this is a perfect add-on for us.

Is there a way to increase the polling rate?

I am a Home Assistant noob but am make slow but steady progress!

Cheers, Matt

At this point no but it does use something called webhooks which allows Life360 to communicate with your instance with home assistant when you enter and leave a Place (as defined in Life360) which will update all locations instantly. The only downside with this is that you need to have your Home Assistant instance open to the internet which might not be the case for all users. Does that help for your use case at all?

If that doesn’t work for you I can look into exposing the refresh value but I want to be careful not to cause issues for Life360. Based on what I have seen they don’t really intend for this to be used by other developers so I wouldn’t want someone setting that refresh value to low and making a ton of requests to their server and getting this addon blacklisted. Ideally I could see when someone is in transit and start to update more frequently but I haven’t fully thought through that part yet.

I am also new to Home Assistant and am working with an undocumented API so it’s a bit of trial and error on my part so if I break anything let me know and I will fix it ASAP :slight_smile:

Thanks, Eric

Thanks Eric. I am wondering if I haven’t configured it correctly. It doesn’t appear that the Webhook is posting on entry to the house as it still shows I am away and the map shows me at a place I was 15 minutes ago. I am using CloudMQTT instead of the built in MQTT broker.

Skalavala has created a custom component that will work with any version of HASS. We use it extensively in my house for automation.

https://github.com/skalavala/smarthome/tree/master/custom_components/sensor.

3 Likes

@mattharrington I don’t think it has anything to do with MQTT because that is the same process that will fire every 15 minutes. Did you open up the port to allow the web request in?

Example: https://my-home.duckdns.com:8081/webhook

You should get a 403 error which is expected. If you don’t get that then check that port 8081 is open on your router (or whatever port you have it set to).

Also heads up that I changed how the MQTT preface is handled in version 0.0.4 so you will probably need to add a slash to the beginning of it in your config section (or change your configuration.yaml). https://github.com/editter/hassio-addons/tree/master/life360#releases

Thanks @editter. I didn’t have the port appended to my config URL so there was a problem right there. I updated to 0.0.4 but now get the following error on the status page. Any thoughts? Many thanks for the help.

TypeError: res.status is not a function
at app.use (/life360/server.js:269:17)
at Layer.handle [as handle_request] (/life360/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/life360/node_modules/express/lib/router/index.js:317:13)
at /life360/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/life360/node_modules/express/lib/router/index.js:335:12)
at next (/life360/node_modules/express/lib/router/index.js:275:10)
at Layer.handle [as handle_request] (/life360/node_modules/express/lib/router/layer.js:91:12)
at trim_prefix (/life360/node_modules/express/lib/router/index.js:317:13)
at /life360/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/life360/node_modules/express/lib/router/index.js:335:12)

Update: It seems to be working fine however. Cheers.

@mattharrington great to hear it’s a port forwarding thing, I’ll add that step to the Readme.

The status error shouldn’t cause any issues because it is only hit when a web book call is made without an access key. I will take a look at it though because it still shouldn’t happen. Thanks for the feedback, that really helps! If you notice any issues please feel free to contact me, location based testing can be a pain sometimes :slight_smile:

I have the Life 360 addon installed. I have all the options set. I have the following in my config:

device_tracker:                 
  - platform: mqtt_json              
    devices:                         
      my_phone: life360/location/Matt

But nothing is showing up on my dashboard. What am I missing?

Found the issue. For mqtt_host, it didn’t like the hostname of ‘hassio’. Once I put the IP address in, it worked.

Do you have to manually add a device into Known_devices.yaml?

I’ve added the addon, everything looks ok, but there is no new device_tracker.my_phone being created. I manually added this but didn’t make any difference. Or at least no GPS coordinates were there.

I can see Life360 connecting to MQTT and also Life360 connecting out to collect data. But the front end isn’t showing anything. Nothing showing listed in states either.

Any advice?

Probably? I think I had to manually add it when I first set it up but that was a few weeks ago so I am not sure. Here are some examples of my configurations that should work.

known_devices.yaml:

eric_phone:
   track: yes
   hide_if_away: no
   name: Eric Location

configuration.yaml:

device_tracker:
  - platform: mqtt_json
    devices:
      eric_phone: life360/location/Eric

Sorry for the delay in responding I just happened to check the thread, if you want a faster response please create a New Issue on the github repo.

Has any consideration been made for optionally using the new OwnTracks HTTP component rather than MQTT? We don’t have anything else in our house using MQTT, so being able to utilize HTTP should minimize overhead.

@claytonjn I hadn’t really thought about it before but seems like a good idea. Are you looking for this in the HASSio addon or the component that was mentioned previously? (I can do it for the addon but not really for the component)

@editter I’m currently using the custom component, but I’m on Hass.io so there’s no reason I couldn’t switch over.