Life 360 support

@claytonjn Okay, I added HTTP to the Hass.io addon last night but didn’t have time to fully test it but I should be able to get that published tonight or tomorrow. If you do end up downloading it please give any feedback on it as location based tracking can be a pain to test in my opinion.

Your configuration will look something like this (this is from the github readme file):

{
    "process_type": "HTTP",
    "mqtt_host": "",
    "mqtt_port": 0,
    "mqtt_username": "",
    "mqtt_password": "",
    "preface": "",
    "cert_file": "fullchain.pem",
    "key_file": "privkey.pem",
    "host_url": "https://mySite.com:8081",
    "refresh_minutes": 5,
    "user_device_map": [{
      "life360_name": "Eric",
      "known_devices_name": "eric_phone"
    }],
    "life360_user": "MyLife360User",
    "life360_password": "MyLife360Password"
  }

I had to add the user_device_map to tie the life360 data to the known_devices.yaml. Not sure of a better approach so if you have any ideas please feel free to share.

@editter I added 0.0.6 locally but when I try to install I’m getting ERROR (SyncWorker_19) [hassio.dock.interface] Can't install editter/life360-armhf:0.0.6 -> 404 Client Error: Not Found ("manifest for editter/life360-armhf:0.0.6 not found").

I haven’t tried working with local add-ons before so I’m not sure what I’m missing. Also, what would be the proper syntax for mapping a second Life360 user to a second device?

@claytonjn I haven’t published it yet so it didn’t build that version of the addon which is why it returns the 404.

If you are doing it locally remove line 11 from the config.json ( "image": "editter/life360-{arch}",), save, and then install should work

For having multiple users it would look something like this:

"user_device_map": [{
      "life360_name": "Eric",
      "known_devices_name": "eric_phone"
    },{
      "life360_name": "Wife",
      "known_devices_name": "wife_phone"
    },{
      "life360_name": "Kid",
      "known_devices_name": "kid_phone"
    }],

Cheers

@editter Got it installed, thanks.

I tried that format for multiple users but it wouldn’t let me save and didn’t pass jsonlint which is why I asked. Just did it again and it worked, so I must have just missed a comma or something.

I’ll let you know how it works in a couple hours when I leave work. Thanks!

EDIT: process_type keeps resetting to MQTT for some reason. I’m seeing Message was written to /location/Clayton every minute, as expected, but the device tracker isn’t updating.

I’ve run into the config not updating when running locally but I think that was fixed with some of the recent Hass.io releases…try refreshing the browser and try changing & saving it again? If it is set to MQTT then it will display that message but when it is using HTTP I don’t currently have anything being logged but I will add that tonight.

Can you send me an example of your config (DON’T FORGET TO REMOVE PASSWORDS! :slight_smile:)

Update: For anyone coming to this thread later, I forgot to add the correct setting the the config.json schema. That has since been fixed and I will be releasing these changes once it is tested a little more

Hi @editter. Awesome work with his add-on. I’ve added the add-on and configured but get this error:

Error: ENOENT: no such file or directory, open ‘/ssl/fullchain.pem’

Anyone else had this or seen it before?

This is my Life360 config with things ‘*’ out:

{
“process_type”: “MQTT”,
“mqtt_host”: “192.168.0.14”,
“mqtt_port”: 1883,
“mqtt_username”: “",
“mqtt_password”: "
”,
“preface”: “life360”,
“cert_file”: “fullchain.pem”,
“key_file”: “privkey.pem”,
“host_url”: “http://****************:8081”,
“refresh_minutes”: 1,
“user_device_map”: [],
“life360_user”: “**",
“life360_password”: "

}

Hey @benhuson1
It looks like you don’t have the lets-encrypt add on setup which is why you are seeing that error. With Hass.io it is really easy to setup so I highly recommend using it and this add on assumes you have that setup.

I could see removing this restricting if someone isn’t using webhooks (host_url) but with the holidays that won’t be for a few weeks. I am a big proponent of security though so I would say go down the lets encrypt route :slight_smile: there’s ton’s of good examples out there but if you have trouble let me know.

@atomicpapa I have added the custom component by Skalavala and was wondering where do I need to put my MQTT details i.e. username and password of MQTT.

The component works fine and I get sensor.life360_sensor state as running. However I do not see my phone in the list?

Thanks.

Did you also download the corresponding life360.yaml package? All config I believe goes there

1 Like

Hi guys. I am new to Hassio and have been slowly adding devices. I have installed the Addon for Life360 and assumed that i can simply use the HTTP function to collect position data.
I am getting this:
starting version 3.2.4
info: No previous state found, setting to defaults.
1/29 7:22:30 pm - info: init/refresh token successful
1/29 7:22:30 pm - info: Configuring auto update for every 5 minutes
1/29 7:22:31 pm - info: Configuring server
1/29 7:22:31 pm - info: Listing via https
1/29 7:22:31 pm - info: Listening at port 8081
1/29 7:22:32 pm - error: TypeError: Cannot read property ‘latitude’ of null
at formatLocation (/life360/server.js:157:45)
at state.members.map.x (/life360/server.js:170:49)
at Array.map ()
at /life360/server.js:170:40
at Generator.next ()
at fulfilled (/life360/server.js:9:58)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

With the following setup:
{
“process_type”: “HTTP”,
“mqtt_host”: “”,
“mqtt_port”: 0,
“mqtt_username”: “”,
“mqtt_password”: “”,
“preface”: “”,
“cert_file”: “fullchain.pem”,
“key_file”: “privkey.pem”,
“host_url”: “https://.duckdns.org:8081",
“refresh_minutes”: 5,
“user_device_map”: [
{
“life360_name”: "G
",
“known_devices_name”: "g
**_phone”
}
],
“life360_user”: “",
“life360_password”: "

}

It dosnt feel right to use the mqtt_json in configuration.yaml?
device_tracker:

  • platform: mqtt_json
    devices:

    {preface}/location/{life360 first name}

    eric_phone: life360/location/Eric

Can you please show me how this should be configured?
I have 2 different Circles configured in life360. do i need to put this somewhere?

thanks

Has G updated their location yet or are they a new user? It looks like they don’t have a value for their location which is causing an error so I will add a check in there to verify that all the data is there before using it.

Thanks,
Eric

I have checked the login, user name. All working in life360. I have even tried other family members names. all the same response.
Do i need to reference the Circle name?
Is it the first name only or first and last. (Tried all)

All users have been running for some time, so there should be plenty of data.

Sorry… Let me know if i have missed anything else? I assume i don’t need to do anything with MQTT or any other HASSIO configuration?

I have been away for work. I looked tonight and it all working after it updated to new version.
Thankyou. Really appreciate your great work Eric.

Hey.

Is there a way to get a “trigger” when my phone is charging?

Thanks :slight_smile:

I can add something to the data that is passed to HA and you should be able to setup an automation. I will try to get that released early this week but I will post here once I have something.
Thanks,

1 Like

@ohman92 I added the info for is_charging for both MQTT and HTTP which will be 0 or 1 (0=false, 1=true) in version 0.0.8.

Full examples of the message bodies are here

If you have any issues or need help adding an automation with it let me know and I can try to come up with an example for it :slight_smile:

Thanks,
Eric

@editter
Thank you!!! I will try it out on sunday :smiley:

@editter
I’m sorry, but I don’t know how to make this work.
I’m currently using this shell script: https://pastebin.com/xrYTvtCR
That script makes sence to me, just run it and it works.
I dont know what to do with all your files :confused:

I tried to put the life360 map into /.homeassistant/ and runned the run.sh file but I got an error.
I pretty sure I’m not doing it right.

module.js:327
    throw err;
    ^

Error: Cannot find module '/home/homeassistant/.homeassistant/life360/server.js'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:134:18)
    at node.js:962:3

Please tell me how to do :slight_smile:

edit: I don’t have hassio :confused: is there anyway to add charging state to this shell file?

Ahh I was thinking you were using HASS so that’s my bad.

Here I added the needed charge fields to the paste here: https://pastebin.com/Jnagdh3V

I wasn’t able to test it but you should now see “charge” coming through from your MQTT message. It will either be 1 or 0

@editter
It does not work :confused:
I’m listening on my mqtt broker and see the “charge” message, but it stays at “0”.

Any suggestions? :slight_smile: Thanks