Life360 Device Tracker Platform

@pnbruckner what’s the likelihood of this ever becoming an official component?

I assume you mean custom_updater? Yeah, this is part of what I meant by PITA. :wink:

@GaryOkie, I haven’t checked that issue yet. Should be interesting to see what he does about this, or if anything should even be done there. Although, it might be easiest for it to handle this, since at run time it could determine what HA version was running and install the custom components in the right place. What a mess.

I’ve been asked that a lot. The answer is, not likely anytime soon by me. There is a LOT more stuff one would have to do to make it an official component, not to mention losing control. I’ve said before I’m not ready to make that commitment. But this is all open source, so anyone can do it if they’re up to all the work.

I’m on v87.0 and switched the component over to new directory structure (config/custom_components/life360/device_tracker.py) and it still works for me.

EDIT: I guess I should also add that the custom resource tracker fails to catch the new structure so it disappears from the list. :slightly_frowning_face:

1 Like

yep, I sure did mean custom_updater! I was also thinking the best way to handle this mess is for the custom_updater to create the folder and move the code.

1 Like

Yes, I meant custom_updater. See also here for some background why they changed this.

No, unfortunately not - also the trigger never fires of its own accord. I get that message when I trigger it in dev tools. No massive urgency to look at it and of course no obligation, either. I’m on 0.87.1

Am i forced to change the path to life360.py like someone here says?
Actually i have /config/custom_components/device_tracker/life360.py, i am running 0.87.1 and all is working great!

With HA update 0.88.0+, is there new documentation on component folder structure by chance?

Coming. But for now, just move

custom_components/device_tracker/life360.py

to

custom_components/life360/device_tracker.py

Also now that i am using 0.87.1?

Same as above. Just move the file.

My first guess is that the automation is off. If that is the case, try turning it on and see if it stays on. If it goes back off, then you probably have something wrong in the trigger/condition section(s.) If it stays on, then try triggering it by firing the event on the Events page.

If that’s not the issue, then look in home-assistant.log for the event. E.g.:

pi@raspberrypi:/home/homeassistant/.homeassistant $ grep '<Event life360_update_[^[]*' home-assistant.log
2019-02-20 18:44:35 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event life360_update_overdue[L]: entity_id=device_tracker.life360_xxx>
2019-02-20 20:40:53 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event life360_update_restored[L]: entity_id=device_tracker.life360_xxx, wait=2:36:10>

If none of that helps, please post your automation as it exists now.

might be the silliest question ever, but shouldn’t we rename your files too? Making that:

just move the file and rename it appropriately

Most people are on Linux. And on Linux, moving the file is how you change the name.

# From config folder
cd custom_components
sudo -u homeassistant mkdir life360
sudo -u homeassistant mv device_tracker/life360.py life360/device_tracker.py
2 Likes

a yes, didn’t think of that, sorry.

but since many people here are on Hassio/Pi and use yaml and smb, as am end do I, I would be safe to rename the device_tracker life360.py to device_tracker.py, and move it to folder /custom_components/life360 ?

coming to think of that, I would even like to rename it to device_tracker_life360.py, since I have a few other device_trackers in the custom components section.

Would that be ok, simply renaming it?

You have a separate folder for each device_tracker you use now, at least that’s how I understand it. So there would be no need to rename it to what yo mentioned since it’ll be in an isolated folder.

IE: image

image

I don’t use Hassio, so I have no idea how you would do this in that case. But, generally, yes, you move the file from <config>/custom_components/device_tracker to <config>/custom_components/life360 (which you will have had to create), renaming the file from life360.py to device_tracker.ply in the process.

That won’t work. If you have multiple custom device_tracker platforms, then you have to do the same thing with them, except that you’ll have to create a new folder under <config>/custom_components for each with the corresponding name, and each one will be moved to its corresponding folder, and all renamed to device_tracker.py. E.g.:

custom_components/device_tracker/life360.py -> custom_components/life360/device_tracker.py
custom_components/device_tracker/xxx.py     -> custom_components/xxx/device_tracker.py

I organize my work flow so, that I know which file is what and belongs where, by the file_name.

If I stumble on a file called device_tracker.py, I wouldn’t know what it would be, and needed to check its contents. Testing setups is very easy that way. Put a file in my folder put_aside, restart and see what happens.

So yes, I want unique filenames.

Then you need to take that up with the developers. We’re just reacting here to what has already been decided and put into place.

1 Like