Life360 Device Tracker Platform

My device now is visible in the map at the home zone and the state is home.
My wife’s device is in another HA zone and the state is the name of the HA zone where she is.
So actually all is working… must check if i go in another zone and if the state will be the same of the zone where i will be.

Did you mean invisible?

Sorry, if i check the map in the frontend i am invisible and i can see only my wife’s icon in the right HA zone. Is this correct?

Yes. It sounds like it’s working now. I have no idea what causes this, but so far, in the small sample size I’ve seen, restarting fixes the problem and it doesn’t come back.

Ok i just restarted… tomorrow i’ll check if all is working as expected… Just let you know…
Thanks

1 Like

I just updated to .95 and love that it got integrated!

I of course didn’t read the part about prefix, so now I have my two old device trackers and 2 new ones with “life360” on them.

I’m fine with that but how do I delete the old ones?

Also, the group.all_devices is still tied to the 2 old ones and the 2 new ones didn’t get added, so I had to redo all my automation to call out each device tracker

Just make sure you have prefix set the way you want it, then edit known_devices.yaml to remove the set of device ID’s you don’t want, then restart. All should be good.

Regarding group.all_devices, that is created dynamically. It will only include the “active” device_tracker entities. When you clean up prefix & known_devices.yaml, all should be good. :slight_smile:

My biggest problem is when my wife’s phone is in her work locker for 8 hours where there is no GPS the app logs her out and keeps showing she hasn’t left work. I have emailed Life360 but got no response.

I got the old ones removed by deleting from that file and then the auto all group fixed itself.

Two other questions though, can you change the display name on a device tracker? With yours the names came in upper case and now it’s all lower case. I know it’s stupid but curious.

The second is the updated seem much slower. I’m using my same settings. I used to have my house unlock before I got there, now I’m sitting in driveway for 30 seconds. It could just be life360. I have the interval to 10, same as before.

Now I need to make my manual zones and tweak some automations and should be good.

@pnbruckner

I just noticed that the states as reported by the life360 shows the states of ‘driving’ & ‘moving’ as all lower case. All of the other states (Home, Away, in a zone) show as properly capitalized.

I’m not sure if this is considered a proper bug and should be reported thru that channel or if it’s something that you can do on your end?

When discussing adding show_as_state (for driving and moving) “back” to life360 on discord, it was requested that I change the states to all lower case. This is consistent with other states.

FWIW, “Home” and “Aware” are not states. They are frontend representations of states (i.e., home and not_home.) So this is a “frontend issue”, or, at least, a frontend question.

You would do this in known_devices.yaml, just like before.

None of the changes in transitioning from a custom to a standard integration should have had any effect on this. It’s just a coincidence.

OK, thanks for the info.

posted a feature request:

Hopefully it will get some traction.

@pnbruckner
Hi. I recently switched to the built in from custom when I upgraded to 0.95.4. All works well with the exception of the show_as_state. I’ve used both of these methods and neither show when the device is moving despite when I check that it actually shows moving true :

This is my entry in my device_tracker.yaml file:

- platform: life360
  username: '[email protected]'
  password: 'mypassword'
  max_gps_accuracy: 200
  prefix: life360
  show_as_state: 
    - driving
    - moving

Am I doing something wrong? I’m expecting to see the state of the device to change to moving as it did before. That is what that config setting does right? Thanks a ton!

life360 is no longer configured under device_tracker. See the transition instructions for details.

Given what you show, your configuration should now look like this:

life360:
  accounts:
    username: '[email protected]'
    password: 'mypassword'
  max_gps_accuracy: 200
  prefix: life360
  show_as_state: 
    - driving
    - moving

And remove what you had in your device_tracker.yaml file.

1 Like

Thanks. I’m not sure how I missed that crucial part. My apologies for the trouble.

1 Like

I’m (attempting) to make a template sensor for the at_loc_since attribute to replicate how it appears in the Life360 app. This is what I have so far:

life360_at_loc_since_sean:
  value_template: "Since {{ state_attr('device_tracker.life360_sean_mooney', 'at_loc_since').strftime('%-I:%M %p') }}"

However this seems to return “Since 6:36 pm” which is 4 hours ahead of what the app correctly reports (“Since 2:36 pm” ). The minutes part is right, not the hours. Time zone is set correctly in Home Assistant (America/New_York) so I’m a little bit stumped. Am I doing something wrong?

This attribute is an aware datetime object in UTC. If you want to output it in the local time zone, then try this:

life360_at_loc_since_sean:
  value_template: "Since {{ state_attr('device_tracker.life360_sean_mooney', 'at_loc_since').astimezone().strftime('%-I:%M %p') }}"

This assumes the time zone setting in the environment in which HA runs (OS, docker, etc.) is set to the local time zone. If not, then you can do this:

life360_at_loc_since_sean:
  value_template: "Since {{ state_attr('device_tracker.life360_sean_mooney', 'at_loc_since').astimezone(now().tzinfo).strftime('%-I:%M %p') }}"
2 Likes

Thanks, that worked perfectly :slight_smile:

1 Like

I just upgraded Hassio to 95.4 and changed my Life360 configuration in my configuration.yaml. Here is my current config.

life360:
  accounts:
    username: !secret life360_username
    password: !secret life360_password
  prefix: life360
  show_as_state: 
    - driving
    - moving
  driving_speed: 18
  max_gps_accuracy: 100
  max_update_wait:
    minutes: 45
  warning_threshold: 2
  error_threshold: 3
      

Here is what it looks like in dev_state for my wife. It shows address of home and she is indeed home.

not_home source_type: gps
latitude: 33.848206
longitude: -117.778491
gps_accuracy: 20
battery: 83
address: home

I turned on life360 debug mode so I could see the traffic between life360 and hassio. I then set the state for my wife as home. Waited for an update. I get this line in the log.

Line 961: 2019-07-10 11:51:22 DEBUG (SyncWorker_12) [homeassistant.components.life360.device_tracker] Updating life360_joannie; Time since last update: 0:00:09

and the state changes to Away but she is still home.

I have noticed that her I-phone also shows not_home. Life360 app shows that she is home.

Any ideas?

I