Want to use Life360 to track and use home/away status

Ah sorry Juan I now see what you mean - I noticed that I had also entered both my first and last name in the Life360 “First Name” box on the website. I have now corrected it, and my HA MQTT topics are now:

life360/ian
owntracks/ian/ian
owntracks/gill/gill

But the device tracker is still not visible on the HA console (or in known_devices.yaml) :0(

The only thing I have left to suggest, is manually populate the known_devices.yaml with your settings in this case. Mine looks as below:

kyle_kyle:
  hide_if_away: false
  icon:
  mac: XX:XX:XX:XX:XX:XX
  name: Kyle
  picture:
  track: true
  vendor: Apple, Inc.

The device name (in my case kyle_kyle) should match your OwnTracks topic, excluding the owntracks portion. So for you it would be ian_ian and gill_gill respectively. You can see then if it starts providing the correct data. You can probably scrap the vendor line.

Also, I know it’s probably a stupid question, but I’m clutching at straws here, you do have the Owntracks platform configured for device trackers in your configuration.yaml right?

# OwnTracks
- platform: owntracks

I’m not sure what the HBMQTT errors are referring to in the case of your log I’m afraid, as I’m using Mosquitto as my MQTT broker. However it looks like it’s referring to publishing messages, not reading them.

If the pre-populating known_devices.yaml doesn’t work, the only suggestions I have left are:

  • Temporarily disable life360.py, and install the Owntracks app. Just so we can definitively rule out whether or not it’s a problem with the Life360 component, or a broader problem in your HA instance
  • Possibly open an issue on the life360.py GitHub repo, see if @skalavala has any ideas

Ok I tried manually adding entries in known_devices.yaml (with made-up MAC addresses for ian_ian and gill_gill), but they didn’t get updated.
I then tried setting up Owntracks on my Android phone, but couldn’t get past a java.io.EOFexception when trying to connect to my HA MQTT server. I had port forwarding set up for 1883, set up a username/pw for the MQTT service, etc, but couldn’t work out why it couldn’t access my MQTT server.
In the end I decided that trying to get that up and running was probably no less complicated than trying to resolve the original problem.
I did leave a message on Github for the life360.py developer, but the last response was 5 days ago so I guess he didn’t have any ideas.
I believe that I have the owntracks platform configured correctly for my device tracker - this is what it looks like:

device_tracker:
  - platform: owntracks

I assume that I don’t need any other parameters?

@itm1960, thats correct. So your owntracks/ian/ian topic should be reporting location, battery etc on the console.

Sorry, silly question but did you add this to your configturation.yaml file:

device_tracker:

  • platform: owntracks

Yes this is the code copied and pasted from configuration.yaml:

device_tracker:
  - platform: owntracks

I can see the owntracks/ian/ian topic correctly reporting location, battery, etc if I subscribe to the MQTT topics on my HA server using the MGTT.fx client. It’s just HA that is not picking up the MQTT data and reporting it.
There is also a life360/ian topic being published on the HA server - this contains much larger MQTT messages, but is also being kept updated.

Hmmm, well I’m officially stumped. I promise you that setting up device trackers in HASS is definitely not usually this hard these days.

When you forwarded port 1883 to your HASS instance for OwnTracks, did you also add 1883 to the docker container run options? Or I’m lieu of that, have you configured to container to use host mode networking?

If we can confirm that all that config was done correctly, it might be worth trying Mosquitto as your MQTT broker instead of the built-in broker. That’s the only difference in our setups that I can see at this point. There’s a docker image for Mosquitto - eclipse-mosquitto:latest - so it shouldn’t take too long to get set up.

@juan11perez, are you using the built in broker, or Mosquitto/CloudMQTT?

No I didn’t add anything for port 1883 to the docker run options, nor do I know anything about host mode networking (I’m a complete newcomer to Docker). This is the command that I used:

sudo docker run -d --name="home-assistant" -v ~/homeassistant:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant

Do I need to add an option?
I’ll investigate setting up Mosquitto…

That command is fine, this option --net=host is the one that sets the container networking options to host mode. For the purposes of what we’re discussing, it just means that you don’t have to manually specify ports that are passed through to the container.

Oh and in response to your earlier question, yes, your device_tracker config is correct.

I’m running Mosquitto

So I managed to get Mosquitto up and running (in a Docker container) and it seems to have solved the problem - many thanks for all of your input.
I have no idea why this wouldn’t work with the embedded HA MQTT broker, and would be curious to know if anyone else managed to get it working.

Hm, yeah, strange. I don’t think I’ve seen any issues around OwnTracks and the embedded broker mentioned before. In any case, glad you got it working.

Sorry, kind of late to this discussion, but I thought I’d mention this anyway in case you (or others) are interested. I created a custom device_tracker platform for Life360. It does not require any other service (such as MQTT or owntracks.) It basically goes right to the Life360 server. It does, however, use a low-level python integration to Life360 that is not officially published. But, other than that, it works pretty well (at least for me), and doesn’t require setting up all those other components. If you’re at all interested, check out:

And if you (or anyone) is interested in trying it out, let me know and I can provide more details. (Probably best to PM me in that case.)