Life360 Device Tracker Platform

OK, thanks!

1 Like

I checked my login details, I did a password reset as well. Same error message, any other ideas?

Try deleting the life360.conf file in your config directory and restart HA.

1 Like

:smiley: That fixed it! My phoneā€™s icon showed up in HA right after the restart.
Thanks for your help!

Glad it fixed it.

FYI, the current version of the life360 PyPI package will attempt to re-authenticate if it gets an error 401 from the server. But you were getting an error 403. My guess is that at some point after setting up life360 in HA you changed your Life360 password (or something like that.) In any case, Iā€™ll change it so it re-authenticates (which updates the life360.conf file) if it gets an error 403 as well so hopefully this doesnā€™t happen again.

What I noticed was that the life360.conf file was empty until I deleted. The file was recreated during the restart and an entry got recorded into it.
It looks for me that the file I created was not accessible for the serviceā€¦

Hmm, interesting. You said the file you created. Do you mean you created the empty life360.conf file directly, outside of HA, or somehow it got created by the life360 HA code?

Just wanted to say ā€˜Thanks againā€™!
All set up and everything looks good for now :slight_smile:
Your help is appreciated!

1 Like

@rossmatt06, @Cali, @balagexy, et al,

Per the previous discussion, Iā€™ve created a beta version (2.6.0b1) that implements the new add_zones option of include_home_place. If anyone would like to give it a try, let me know how it works for you.

It also bumps the version of the life360 package (from PyPI) to 2.1.0, which now handles HTTP 403 errors.

Next I will be adding a device_tracker service to allow manually updating HA zones from Life360 Places.

EDIT: I should probably mention, if you do choose to set add_zones to include_home_place, then you might also want to remove places from show_as_state, since HA would now be able to make the determination of which zone (or Place) youā€™re in. The only downside would be if you use the Life360 Check-In feature. If you do, and you remove places from show_as_state, then your device_trackerā€™s state would no longer indicate when youā€™ve checked in somewhere on Life360.

1 Like

Yes, I did create life360.conf file in my config folder. I canā€™t find now but one the setup tutorials I checked said ā€œcreate a life360.conf file in your ā€˜configā€™ folderā€, so the process can access it and write the necessary values into that file. I might just caused this issue with that :frowning:

Hmm, well I can tell you I didnā€™t write that tutorial! :wink: But, with the recent changes I made, should anyone else fall into this trap, the code should be able to recover. (Unless the file is created in such a way that HA canā€™t delete it - e.g., permission issues.)

If you do find that tutorial, Iā€™d like to see it. If itā€™s recommending incorrect steps Iā€™d like to see it fixed.

Thanks for the info!

all of a sudden all my life360 device_trackers stopped workingā€¦ all showing not_home
On the life360 website I see this message:

Error: All supposed receivers left the circle,

but they show located alright. In the app the location seems to be alright too for all of my circle members. Which makes me hope its not a CC thingā€¦or HA for that matter?

could there be some server issue?

my binary_sensors are created either:

  - alias: Life360 connected
    trigger: 
      - platform: event
        event_type: life360_update_overdue
      - platform: event
        event_type: life360_update_restored
    action:
      service: python_script.set_state
      data_template:
        entity_id: >
          binary_sensor.overdue_{{ trigger.event.data.entity_id.split('.')[1] }}
        state: >
          {{ 'on' if trigger.event.event_type.endswith('overdue') else 'off' }}

not even when triggered manually.

Hi, I use in 2018 a system based on life360 services with a owntrack device tracker through mosquitto defined in this web (sorry, in spanish):

When I change to your platform life360 in 2019 i now have a problem with precision of my phones and when i arrive home deactivate alarm later

how can i solved my problem??

Thanks and sorry for my english

  • id: location_away
    alias: ā€œAlarma Modo fuera de casa cuando salimos de casaā€
    trigger:

    • platform: state
      entity_id: group.Familia
      from: ā€˜homeā€™
      action:
    • service: shell_command.motion_file
    • service: alarm_control_panel.alarm_arm_away
      data:
      entity_id: alarm_control_panel.alarma
      code: !secret alarm_code
  • id: location_arrive
    alias: ā€œAlarma desactivada cuando volvamos a casaā€
    trigger:

    • platform: state
      entity_id: group.Familia
      to: ā€˜homeā€™
      action:
    • service: shell_command.presence_file
    • service: alarm_control_panel.alarm_disarm
      data:
      entity_id: alarm_control_panel.alarma
      code: !secret alarm_code

Do you mean on www.life360.com?

Are you seeing any errors in home-assistant.log? And if so, what are they?

Well, if the events arenā€™t occurring, then the automation wonā€™t run. And manually triggering an automation that uses the trigger variable wonā€™t work either, because trigger wonā€™t be defined.

Itā€™s possible. Look for DEBUG, INFO, WARNING and/or ERROR messages in home-assistant.log for custom_components.device_tracker.life360. That information would be helpful.

Can you post your life360 configuration? (Of course, remove any sensitive data.)

yes. still there:

52
lol, have to be quick cause it fades outā€¦ the are still in the circle though, as is visible on Life360

and my device_trackers have reappeared, donā€™t know what happened, other than that I have change my recorder settings, from including domain sensor, and excluding some entities, to excluding domain sensor, and including many entitiesā€¦ It happend during that operation, though I didnā€™t change the device_trackers domain include.

if anything arises in the logs, youā€™re the first to know :wink: thanks for your response.

If youā€™re seeing an error like that on Life360ā€™s website, then the problems youā€™re having are probably in their system and has nothing to do with HA or the custom life360 device_tracker platform (other than itā€™s being affected by the problems in the Life360 server.) Hopefully it gets fully resolved for you.

Hello all! First: Iā€™m a complete newbie in Home Assistant, Pyton, Linux etc. so I think my questions are on that level, Iā€™m afraid. But Iā€™m eager to learnā€¦.
Iā€™v been trying to get this device tracker to work, so I can see where the kids who live with us are hanging out. Unfortunately I canā€™t get it to work.
This is my setup:
I have Hassio 0.85.1 installed on a Raspberry Pi 3B+ (I tried 0.86.4 but after returning to the overview card it keeps loading). I work with Hassio on a Windows machine using Samba, which works fine.
I first downloaded the .zip from github, extracted it in my downloads folder and copyed (not drag and drop) the complete custom_devices folder from the extracted .zip to the Hassioā€™s config folder in the windows explorer (opened throug a Samba link).
When copied, I copy and paste the Yaml-code in my configuration.yaml:

    #device_tracker
device_tracker:
  - platform: life360
    username: !secret life360_username
    password: !secret life360_password
    prefix: life360
    show_as_state: driving, moving, places
    driving_speed: 12
    max_gps_accuracy: 200
    time_as: device_or_local
    max_update_wait:
      minutes: 45

I put my credentials in secrets.yaml, check the configuration (it says valid configuration) and click on restart.

I did this about 7 times. I donā€™t see Life360, and my log says:

    Error setting up platform life360 
ā€Ž15ā€Ž:ā€Ž46 components/device_tracker/__init__.py (ERROR) 
Life360 communication failed! 
ā€Ž15ā€Ž:ā€Ž46 custom_components/device_tracker/life360.py (ERROR) 
ModuleNotFoundError: No module named 'life360' 
ā€Ž15ā€Ž:ā€Ž46 custom_components/device_tracker/life360.py (ERROR) 
Unable to load /config/known_devices.yaml: Config file not found: /config/known_devices.yaml 
ā€Ž15ā€Ž:ā€Ž45 components/device_tracker/__init__.py (ERROR) 
You are using a custom component for device_tracker.life360 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant. 
ā€Ž15ā€Ž:ā€Ž45 loader.py (WARNING) 

I read that known_devices .yaml should be created, but I donā€™t see it.

I know there must be something wrong :blush: and probabely because Iā€™m doing something wrong. But after reading this topic, looking at YouTube videoā€™s where everything goes smooth and easy I think there is only one option: calling for helpā€¦
Can anyone please tell me what Iā€™m doing wrong? And please, remember Iā€™m new at thisā€¦.

I donā€™t use hassio, so I canā€™t help with file/permission/etc. issues. But I do know that people have been able to use this custom component on hassio successfully.

You do know you can do that with the Life360 app (and their web interface), completely independently of HA, right? In fact, Iā€™d say, itā€™s even easier to see that information natively in Life360.

That was overkill. All you need is one file ā€“ life360.py ā€“ copied into <config>/custom_components/device_tracker, where <config> is HAā€™s configuration folder, which on hassio I think is /config. You may need to create the custom_components and device_tracker directories first. And you need to make sure the account running HA has permission to access those folders and the files they contain.

The errors youā€™re seeing are because the PyPI package that this custom platform needs (also called life360) is not available on your system. However, if HA was installed and is functioning correctly, that package should be automatically downloaded and installed by HA the first time it tries to load this custom platform. Look earlier in home-assistant.log ā€“ do you see any messages about attempting to install life360?

Regarding not being able to load known_devices.yaml, that is being done by the ā€œcomponent-levelā€ device_tracker code (not my custom code.) That seems to point to a more basic problem. If you havenā€™t gotten too far with HA, you might want to consider starting over. Maybe try a standard device_tracker platform (even something as simple as ping) to see if you can get that working. Once that is working, then adding life360 should be easier.

Hi Paul, thanks for the quick response. Some answers:

You do know you can do that with the Life360 app (and their web interface), completely independently of HA, right? In fact, Iā€™d say, itā€™s even easier to see that information natively in Life360.

Yeah, Iā€™m aware of that. But my docter told me itā€™s good to keep busy and take up new challanges. So, I.m diving in and trying to get it to work. 64 is a great age to start learning codingā€¦.:sunglasses:
But as i said befor, Iā€™m really new and any help is appreciatedā€¦.

That was overkill. All you need is one file ā€“ life360.py ā€“ copied into <config>/custom_components/device_tracker , where <config> is HAā€™s configuration folder, which on hassio I think is /config . You may need to create the custom_components and device_tracker directories first.

That were my first 2 attempts. That didnā€™t workā€¦ā€¦

And you need to make sure the account running HA has permission to access those folders and the files they contain.

Well, you may have pointed out something there. My account in Hassio has the same username as I use to connect via Samba, but they use different passwords. I can open the config folder to edit my Yaml files, so I donā€™t think that is the problem, but when looking through the log as you suggested I also saw errors concerning a mistake in my database.
Indeed, I wasnā€™t very far with my automations, so I did what you suggested: I removed the SDcard from my Rpi, formatted en installed Hassio again. I will retry en report back later. Thanks for sharing your ideas, when Iā€™m having more questions I know where to find you :wink:

1 Like