Life360 Device Tracker Platform

Yes, if you want to continue to use the CC, then it would probably be a good idea to do that before upgrading to 0.95+.

Hi,

I’ve read through the above link and made changes to my files and folders (added manifest.json etc) and now my configuration checker shows my configuration is valid.

The only issue is the badges show my daughter and myself as being away when we are actually home.

life360

I went into my configuration.yaml and changed add_zone: from true to all and added the home_place line, so it all reads as follows

  - platform: life360
    username: !secret life360_username
    password: !secret life360_password
    prefix: life360
#    show_as_state: driving, moving, places
#    driving_speed: 18
#    add_zones: true
    add_zones: all
    home_place: Home

I also still have the zones.yaml file that has a list of places like my local shopping centre etc with their GPS numbers (but not my home address as I never needed it before). I have my home configured in configuration.yaml as follows:

  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: removed_the_number_for_privacy
  longitude: removed_the_number_for_privacy

If I log onto the life360 website, it shows both of us as being at home.

I can see discussion above about custom_updater and version numbers but got a little confused.

Any ideas why my icons show us as being Away when Life360 shows us as being Home?

Thanks in advance.

First and foremost, did you install the latest version, 2.10.1? Specifically, are the files you have in <config>/custom_components/life360 the files from here, and only those files?

If you’re using:

    add_zones: all
    home_place: Home

then it doesn’t matter what your HA lat/lon configuration is. It will be replaced by the coordinates of your Life360 Place named Home.

If you add the following to your configuration, then you’ll be able to look in home-assistant.log for messages that show what life360 is doing:

logger:
  default: info
  logs:
    custom_components.life360: debug

I have those 3 files plus 2 folders.

  • One folder I called “Backup 2019-06-22” which I put a copy of what was in the folder originally (a file called “device_tracker.py” and a folder called “pycache”).
  • One folder called “pycache”

TBH, I can’t remember how I set it up when I first got the Life360 account. I’d have to watch Dr ZZ’s YouTube video again :slight_smile:

I gather I just need to follow this - homeassistant-config/docs/custom_updater.md at 59f7bdc945ad1b418035987e2c57cc9eef6c1fd1 ¡ pnbruckner/homeassistant-config ¡ GitHub - and add the following to my configuration.yaml file:

custom_updater:
track:
- components
- python_scripts
component_urls:
- https://raw.githubusercontent.com/pnbruckner/homeassistant-config/master/custom_components.json
python_script_urls:
- https://raw.githubusercontent.com/pnbruckner/homeassistant-config/master/python_scripts.json

I haven’t done this yet until you confirm that’s what I need to do, plus I’m a little confused as to what I’m meant to do after that.

Ok, I’ve done that.

BTW, you replied quicker than I expected. I came back to edit my post to say that although the configuration checker says my configuration is valid, when I restart the services, the notifications bell shows the following:

(above screenshot has the 3rd notification cut off. It says there are newly discovered devices, but I always get this).

Anyway, I’ve updated my conf file with the debug lines and restarted and yet somehow, simply adding those lines have fixed the status on the icons as showing as home, plus the notification only shows the python issue and the “newly discovered devices”

I’m not sure why it’s now fixed as I’ve restarted the services multiple times.

Question. Do I still need to add those lines about custom_updater to my configuration.yaml file, and if so, what do I do after that?

Thanks

Hey, Phil, I really hope you didn’t take anything I said as a criticism of anything you’ve done. I’m sorry if it came across that way. I’ve got nothing but respect for the work you’ve put into all of your components.

Based on prior posts, I (wrongly…) assumed that you had to remove the stuff you did to get it accepted. My bad.

And yes I think the driving & moving state option would definitely be beneficial to add back in if you would like to do that. It would be appreciated. I think i’m just going to add the feature request in the “feature request” area of the forum. I don’t want to get in anymore “hot water” because it’s not really a “bug”.

I’ve already added all of the life360 places as zones in HA so that isn’t an issue at all. So the driving and moving as states were the biggest thing I would be missing.

fwiw, as posted above: Ive taken Phils suggestion and issued the ‘bug’: new Life360 integration missing 'Moving' and 'Driving' attributes · Issue #24698 · home-assistant/core · GitHub
some support might help maybe? don’t hold back :wink:

I just went to add my support and saw that one of the devs/admins has already chastised you for posting the “bug”.

See, I knew I didn’t want to do it! Troublemaker! :laughing:

o well, I’ve already been chastised today, for asking politely… sometimes one wonders if the ‘blue guys’ have nothing else to do :wink:

I’ll add my +1 then to your future feature request and added a somewhat more detailed explanation to why I filed the issue: https://github.com/home-assistant/home-assistant/issues/24698#issuecomment-504672875

I’ve added the feature request.

you should vote too :wink:

Ha!

I never knew I needed to (or even could) vote on my own feature request.

I always assumed that it was a given that of course I had voted on the request if I was the one who posted it. :thinking:

No wonder none of my feature requests ever get implemented. I guess they figured if the OP of the request never even thought it was good enough to vote on it then there was no use in implementing it!

:smile:

Done!

1 Like

Something that might work would be to create a Person “component” and not give it any presence or tracker entities. Then you could set the state of the component to be moving, driving or places.

Since the person component isn’t attached to any presence or tracker devices then Home Assistant shouldn’t be changing it’s state. Meaning that whatever you set the state to should stay that way until you change it. (I’m not sure what the state would be after restarting Home Assistant.)

I haven’t tested this to see if it works or to see what the downsides are.

I personally disagree that the official Life360 component should have a “show_as_state” option like the custom component did. The state of the official component should work exactly like all of the other device tracker components - it shows home/not_home or whether you are in one of HA’s defined zones. If you want to use Life360’s more advanced functionality all the information is there in attributes and can be accessed by automations or exposed using template sensors.

But if it’s as easy as making a few changes to the integration code then why shouldn’t it be done?

there should be no reason to make the user jump thru hoops to create a bunch of sensors (at least one for each circle member) just to get the same functionality that we had before.

I will also say that if you don’t want to use a “show_as_state:” option then no one is forcing you to use it and it will work exactly as all of the other device_trackers work. Why would you get to choose which options other people can use if it literally would have zero effect on you?

added to that, if ‘all the other device_trackers’ would behave perfectly, and wouldn’t cause any issue in tracking our devices, one could argue that that would have to be the default implementation.

unfortunately that is far from the case. wifi based trackers are famous for their unreliability, Bt trackers only work short distance, and several gps trackers (like iCloud) kill the battery of your device.

The Life360 component/now integration has proven to be (one of ) the most reliable device_trackers by far, except for maybe a set of device_trackers used as Composite (not coincidentally by the same author) or a hand_made configuration that takes a lot of fine-tuning (have one like that based on Mqtt device_tracker)

the Life360 is perfect out of the box. Id love it to be the next default tracker, including the moving and driving attributes, and set these as state. Once you use these, you don’t want to go back.

If all it takes is an optional config setting

show_as_state: moving, driving

we can all have the best we want/need?

@finity @Mariusthvdb and anyone else who cares…

Regarding the Driving & Moving states, I mentioned to balloob on Discord that there was interest in having this added to the standard life360 integration, and he said, “that’s the kind of thing that we were thinking of adding to the person integration, but didn’t do yet.” I think that’s a better place for this kind of feature, so I guess I won’t pursue adding it to life360.

Did he give any kind of a time frame for doing it?

It will be disappointing if it’s put off being done there for a long time.

No, that’s all he said.

No. You can do that, but you do not need to do that. The life360 custom integration can be added manually. Just follow these instructions (where you can follow the “Alternatively, place a copy” part.)

That would not have had any effect. Something else must have changed.

No.

So is it working for you now?

Wouldn’t the person: component still need at least one device_tracker to report a “Driving” state though in order for it know? So this is still needed on the device_tracker level I believe.

Although his comment was a little vague, I interpreted it as a sign of support, that it was a good idea they were already thinking of. I just left a comment in the Discord too, so hopefully we’ll get a more clear answer.