Life360 Device Tracker Platform

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

Yes. Restart HA. There seems to be a bug somewhere that causes the device_tracker’s not to be set to the correct state after first setting this up. I suspect the bug is somewhere in the common device_tracker code, but haven’t tried to debug it. Clearly life360 is providing the correct GPS location, so there’s nothing more it can do. If the state is wrong then it has to be something the common device_tracker code is doing wrong. But from my own experience, and from a couple of other people who have reported the same thing, restarting HA seems to fix it and it doesn’t seem to come back.

Did a restart but same result. Will try a reboot when I get home.

I have restarted hassio several times, set my home lat and long to the same values reported by life360 and result is the same when my wife is home and life360 dev_state shows place as home but state is away.

Not sure what to try next.

Last night with some great help from pnbruckner and SeanM we were able to locate the problem. My lat and long in my configuration was off by enough to cause the error. The old integration worked but the new is I guess more accurate. The thing that made is clear was when pnruckner asked where the people icons were showing in the front end MAP. I’d never used this but when I updated my configuration with MAP it became very clear that home was in the wrong place.

Thanks again to all that helped me get this resolved.

1 Like

Just bumping in here for a quick question.
Do you know on the tip of your tongue how i can in my integrations page have an entry listed where it says I am logged in, but not have any indication anywhere else that the life360 even exists in my system?
No entity_id, no errors in the logs or anything.
Its only there.
And my credentials are correct I might add.

tempsnip

In my config\.storage\core.config_entries I have this listed though (obviously where the information is stored, but it’s everything I have to share, to give some pointer to my problem)

            {
                "connection_class": "cloud_poll",
                "data": {
                    "authorization": "Bearer NiuhWQ0MDUtNtfgfYhggG4jwNjU5ODQ5Mjc1",
                    "password": "MYPASSWORD",
                    "username": "[email protected]"
                },
                "domain": "life360",
                "entry_id": "9851f885204a4fdd8b5c4746c953889a",
                "options": {},
                "source": "import",
                "title": "[email protected] (from configuration)",
                "version": 1
            }

I have been using the custom component before, way back.
But since then I have moved, and I haven’t reused any configuration in my new setup, so I’m having a hard time believing it could be the custom component that is haunting me here.
Any ideas?

Best Regards
Baskedk

EDIT:
Just realized that i ofc had the config entry to share to, so here you go :slight_smile:

life360:
  accounts:
    - username: [email protected]
      password: MYPASSWORD

LOL! Typical me!
I finally pull myself together and write for help to figure out what I have done wrong, and i immediately figure out what it was…
I had totally forgot about the known_devices.yaml file…
And in that I have set to NOT track new devices…
DO’H!
Thanks anyway!

Yes, that would do it. In fact, that was what I was going to ask about. It seems fairly common for people to set track_new_devices to false, especially when using network based trackers.

BTW, you might want to change your Life360 password. You shared the authorization token above which is generated from your username and password and will allow anyone to access your account. Delete the life360 integration, change your password with Life360, update the password in your config and then restart HA.

Thanks for the heads up.
It is done

Hi
did anyone get problem with life360 tracker and pi-hole?
When pi-hole addon is enabled, tracker is not working, when I disable it, tracker works.
But funny thing is, pi-hole is reporting life 360 queries, but it didn’t block them

So it seems phone is able to update his location to life 360, but HA is unable to get that information?
I don’t see any other entries for life 360 and have no idea what to do to make these two work together because I like them both so much :slight_smile: