Life360 Device Tracker Platform

So there’s a HA InfluxDB integration that pulls selected data from HA’s recorder database, and Grafana can graph information from the InfluxDB. Is that it? I guess I wonder why Grafana can’t just pull data directly from HA’s recorder database. But there must be a reason that’s escaping me. :slight_smile:

What I heard / understand is that influxdb is more suited to store data for graphing than mysql or other standard dbs
From Compare InfluxDB to SQL databases | InfluxDB OSS v1 Documentation

You can see that:

InfluxDB is designed to work with time-series data. SQL databases can handle time-series but weren’t created strictly for that purpose. In short, InfluxDB is made to store a large volume of time-series data and perform real-time analysis on those data, quickly.

1 Like

Sorry if this is a dumb question but i’m really new to HA and Life360.

Is there any way to do a couple of things:

  1. Capture one of the values returned by the Life360 object, such as battery level, and have it defined as an entity that can then be added to a custom dashboard?

  2. Is there any means to capture the same value and graph it over time?

Sorry if these are simple questions but as a new guy in the HA world i’m keen to learn more.

Thanks

Pete

Yes, via a Template Sensor.

One way is via a Lovelace History Graph Card.

No problem. Glad to help. :slight_smile:

1 Like

I finally went to DrZzzs youtube and saw what I missed that wasn’t in the instructions. Removing the Life360.conf file in the Config folder. Once I removed that file, it started working.

Well, that’s strange, because with the standard life360 integration in 0.95, it doesn’t use or even try to read that file. It should make absolutely no difference whether or not it’s there.

Or are you still using my custom integration with an older version of HA?

BTW, what DrZzza youtube? The only one I know of was obsolete before it was posted. Nice, but obsolete as far as installation instructions go.

EDIT: I just watched the youtube you were referring to. It was a little all over the place, but I guess that’s what those things are like. Anyway, he didn’t follow the instructions too well, but still got it working. He did some things he didn’t need to, like removing life360.conf, but as I said, that doesn’t matter.

I’ve update the instructions a bit since that youtube was made, and added Hassio specific instructions. I don’t use Hassio, so those are based on feedback from Hassio users. But I think I can simplify a bit more. (I was trying to be overly conservative.)

Anyway, it’s late and I’m rambling. Bottom line, removing life360.conf did not solve your problem. Something else you did must have fixed it. But, as long as it’s working for you now, that’s all that matters.

He just did an upgrade live stream yesterday

That was yesterday? BTW, I saw your name fly by a few times. :slight_smile:

image

Yesterday? Yeah, I caught the beginning but that was all

Hey Pete,

So I haven’t done this myself yet. But here is something that you can do:

you need to define an attribute in this case life360.batterylevel as a sensor using the template. Once you do that you just add it to your config file under sensors. It will automatically track it for you under % chart in history. Alternatively, you can use inflexdb and grafana and you can just graph the attribute.

Look here it:

Worse is influxdb can’t do data calculations so grafana can plot it for you. For example, I wanted to subtract my indoor and outdoor temperature but it only performs the calculation on one set of data at the time which is a bummer. We need an addon that just does the math.

For anyone that still needs to transition from the custom Life360 integration to the standard one in 0.95+, or is having problems, I just updated the instructions based on recent feedback. Hopefully it helps the transition go a little more smoothly.

When trying to use the new platform with latest version of home assistant, I have this issue

homeassistant    | INFO:homeassistant.util.package:Attempting install of life360==4.0.0
homeassistant    | Failed config
homeassistant    |   General Errors: 
homeassistant    |     - Component not found: life360
homeassistant    | 
homeassistant    | Successful config (partial)

The issue is when I add in the configuration.yaml

life360:

I have removed the old platform…

What I am doing wrong ?

Is that all you have in your config? Nothing about your account or any of the other setup options? If yes, go back and read up on what is required.

Just moved from the CC to this one and all good so far.

The only bit I can’t get to work is the show_as_state. Below is my config - the component runs fine when I comment out the show_as_state

life360:
  accounts:
    username: !secret life360_username
    password: !secret life360_password
  prefix: life360
  show_as_state: driving, moving
  driving_speed: 18
  max_gps_accuracy: 200

Any ideas?

Thanks @pnbruckner for all your hard work BTW - especially getting this ‘native’ :slight_smile:
mb

EDIT: this is the error from the log:
ERROR (MainThread) [homeassistant.config] Invalid config for [life360]: value is not allowed @ data['life360']['show_as_state'][0]. Got 'd'.

Thanks Phil.

I looked at templates when I first installed Home Assistant but at the time they made my head spin a little. Now that i’ve got a specific use case to work against it makes much more sense; 5 minutes later and i’ve got a couple of sensors defined which show my mobile battery strength.

Now that I understand templates a bit more I can see just how powerful they are. Very impressive.

Thanks for your help.

1 Like

Yes. They had me change the schema for that option from cv.ensure_list_csv to cv.ensure_list. Basically it won’t accept a “comma separated value” anymore, only a true YAML list. So you need to change:

  show_as_state: driving, moving

to either this:

  show_as_state: [driving, moving]

or this:

  show_as_state:
    - driving
    - moving

EDIT: Instructions updated accordingly.

1 Like

You are a Star :star2: :+1:

Thanks

mb

1 Like

You must actually remove it. E.g., do not simply move it to your config directory. If you do then that will cause problems when HA tries to import the life360 package from pypi.org..

FYI, it would be ok to just have life360:, or no Life360 config at all, in your configuration. In that case you would need to add your credentials via the Integrations page in the UI.

However, that would not explain the error.

EDIT: On the other hand, @laurentdb, you said you added life360:, but did you remove:

  - platform: life360
    username: LIFE360_USERNAME
    ...

under device_tracker:? If not, then yes, @atomicpapa is right, you need to check the transitioning instructions.

Also, one quick question. I have turned on debug for life360 to grab my zones - however it only gets 11 of them (also they are random ones - not alphabetical or anything, though the same random ones each time). Is there a limit to how many we can all from Life360 so I can then manually add them to Zones?

cheers!