Life360 debug

Is there a way to see what HA is seeing from Life360? There are five of us in our Circle in Life 360 and for some reason, my device is showing as home in a card but when you look at the place entry, it shows Null. It shows as home but not me when everyone else is at home. For the most part, it’s not a bad thing as the automation that I use with it still works but I don’t see why it is not showing me as “home”

Hi Darrell,

The place attribute has nothing to do with the HA device_tracker entity’s state. The HA entity’s state is strictly determined by the GPS data (latitude, longitude & gps_accuracy.) HA uses that data to see if you are located within any Zones defined in HA. If you are, then the state of the Life360 entity will be the name of that HA Zone. If not, then it will be Away. (Actually, for Home and Away, the states are really home and not_home, but the UI display those as Home & Away, or whatever the correct words are for your selected language.)

The place attribute, on the other hand, indicates which “Life360 Place” Life360 thinks you’re in. It should agree with what the Life360 app shows.

Remember, though, there is always some lag between the time the Life360 app updates and the time HA sees those updates.

See also Home - Home Assistant vs. Life360.

Oh, I also meant to say, if HA’s Home Zone is bigger than Life360’s Home Place, then it’s possible you just happen to be located inside HA’s Home Zone (so your HA entity’s state is Home), but outside of Life360’s Home Place (so the place attribute is null.) That would explain what you’re seeing.

I always recommend keeping your HA Zones in sync with your Life360 Places. Unfortunately, that’s not as easy as it should be. (The link I provided above describes one way of doing that.)

When I first created the Life360 integration as a custom integration, it had a feature that could create/update HA Zones based on Life360 Places, but I was required to remove that feature when I submitted it to become a standard, built-in integration. Something about dynamically changing HA Zones by an integration did not fit the HA paradigm.

Maybe I should create a custom integration that can do this…

I know the Place attribute is coming from Life360 which is what I have my automation set to check. But when I am home now and it’s just me and not the rest of the family, the status is Null and not Home. When everyone else is Home, all of their statuses does show Home. Understand the lag but I work from home a lot and I have been home for about 36 hours and it still showed as Null. If you look at the Life360 card, it shows me as Home and the Life360 app shows me as Home.

It would help if you could be a little more precise about what piece of data or pieces of data you are referring to. When you say “status”, I don’t know if you mean the device_tracker state, or its place attribute.

First, I’m curious, why do you have the automation using the place attribute instead of the device_tracker entity’s state? Is it because you want the automation to react when the device enters other Life360 defined Places (and you don’t want to bother creating corresponding HA Zones?)

FWIW, I don’t see anything necessarily wrong with this, and I have seen others do the same. I’m just trying to better understand the use cases, especially if they imply I need to adjust the HA Life360 integration accordingly.

I can’t exactly explain what you’re experiencing. The HA Life360 integration (for the most part) is only displaying what the Life360 server tells it. If the place attribute is not showing Home, that’s because that’s what the Life360 server is providing for that device. I can’t explain why it’s setting the place attribute to null, because I have no insight into how the internals of Life360 work.

But this isn’t the first time I’ve heard something like this. Generally, though, in my experience, if you open the Life360 app, the HA Life360 integration entities will pretty much update almost immediately. (Otherwise, they update when they want to, depending on a lot of factors, which is part of how Life360 keeps their app’s battery usage low.) When you see the condition you describe, if you open the Life360 app, do the corresponding HA entities update shortly after that, such that the place attribute is now what you expect? (I’m not suggesting you have to open the Life360 app to make the HA Life360 integration work correctly. I’m only asking as a way to help debug the scenario.)

The other thing to look at is the last_seen attribute. This mostly indicates when the “GPS fix” was last updated (i.e., latitude, longitude & gps_accuracy.) It’s possible for other attributes (such as battery level) to update after that, though. But I would assume the place attribute only updates when the GPS data updates, but I can’t say for sure. That’s just a guess. Again, this is more about how the Life360 internals work than the HA Life360 integration.

Lastly, I have created a significantly improved implementation of the Life360 integration which I’ve made available as a custom integration. This is being done to test it out as thoroughly as possible before attempting to submit it to the core software. In this custom integration I’ve recently begun work on a new feature that can have the Life360 integration make a request to the Life360 server for a Member’s device to update its location immediately. If you’re comfortable with using custom integrations and would like to try this out to see if it can help with your scenario, let me know. Fair warning, though, like everything else with the HA Life360 integration, it’s all based on reverse engineering and not any officially documented Life360 API.

I have three sons who from time to time forget to close the garage door when they leave. So once an hour, HA queries everyone’s status in Life 360 to see if anyone is at home. If no one is home and the garage door is open, HA will close it. So, I use the place attribute in Life360 to see if anyone is home. The boys and my wife don’t have the HA app on their phones so I can’t use that to determine the location but everyone does have Life360 on their phones so that works. I grabbed another screenshot from HA to see that the information is coming from Life360
image

I took lunch and went down the road to grab some food and came back. I opened the HA app while I was out and verified that it showed me as away and when I came back, the card pulling data into HA shows me as home.
image

Ok. But why do you use the place attribute of these device_tracker entities instead of their state? The place attribute is determined strictly by Life360, but the state is determined by HA based on the entity’s GPS attributes (also, of course, provided by Life360) and the Zones configured in HA. You say the state is correct (it shows Home, so the GPS data must be correct and placing the device within HA’s Home Zone), but the place attribute isn’t always what you expect. So, wouldn’t it make more sense to use the device_tracker’s state rather than its place attribute?

Let’s not confuse the HA app and the Life360 app. When I asked before if opening the Life360 app caused the Life360-based device_tracker entities in HA (and their place attributes) to update, that’s what I meant. I didn’t mean open the HA app. You may need to use the HA app to see these entities (via their cards, or through the STATES page, etc.), but opening the Life360 app can cause those entities to update more quickly (again, just as a test.)

To be clear, the Life360 app (on each Member device) updates the Life360 server whenever it wants, sometimes faster, sometimes more slowly, especially if it’s running “in the background.”

The HA Life360 integration queries the Life360 server periodically (once every 10 seconds) and gets whatever updates the Life360 server got since the last time HA queried it. Opening the HA app allows you to see the data HA has but does nothing to affect how often the individual Life360 apps update the Life360 server.

If, however, you open the Life360 app, it will cause all the devices of the Members in the Circle to (almost) immediately update the Life360 server. Then, on the next 10 second update, HA will see that new data, which will then be reflected in the HA app.

So, that’s why I’m asking if opening the Life360 app updates the entities in HA (and the HA app) so they have the data you expect (more quickly.)

Ok. But why do you use the place attribute of these device_tracker entities instead of their state?

When I go into my automation I don’t have a state to check from Life360.


I mentioned opening the HA app while I was away just to verify that it did see me as no longer being at home. In all honesty, I could care less if HA knew my location from the HA app. I just need to know everyone’s location from Life360. My wife and boys are not going to need the HA app on their phones so I need locations from Life360. Also, as I said, this wasn’t happening a couple of days ago so something changed somewhere. This is why I am using the Place attribute from Life360. As I type this, I am at home so no matter what is updating it, HA app or Life360 app, I am home and it should reflect me as being home and not Null. Again, in Life360, it shows me as home, I would expect the Place attribute for Life360 in HA to show as home as it will everyone else when they come home.

That’s the Attribute box. It’s optional. (Notice it doesn’t have an asterisk.) Don’t use that box, leave it empty. If you leave it empty, then the automation will use the entity’s state, not one of its attributes.

image

That’s fine. I understand you’re just using the HA app to access your HA server. No problem. I just wanted to make sure I was perfectly clear on which app I meant to try opening to see if the data for the device_tracker entities would update in response. It seems though you haven’t tried that yet.

Actually, no, you didn’t mention that. Ok, that’s interesting, but I’m not sure it helps much. Again, we’re talking about a piece of data that the HA Life360 integration has no control over. It’s simply displaying what it gets from the Life360 server. If it’s “wrong”, or not updating as it should, or used to, there’s nothing that I know of that can be done about that, other than making adjustments to the Life360 app & settings on your device per Life360’s FAQs. Although, I would still be interested to hear if opening the Life360 app (when this condition occurs) “fixes” it (at least temporarily) and makes the place attribute change to what you expect.

It’s the Life360 app. But, sure, I agree. It would really be nice if the place attribute provided accurate & up to date data, but again, that’s controlled by the Life360 infrastructure, not the HA integration.

Having said that, the integration is reflecting that you’re home – in the entity’s state. The state is correct, right? If you use that in your automation, instead of the place attribute, I expect it to work as you want.

Actually, no, you didn’t mention that. Ok, that’s interesting, but I’m not sure it helps much.

I’m sorry. I thought I had. Oops. :slight_smile: Anyway, so I went and cleared out the Attribute section and reset the time it checks so it would run, and now the problem seems to be the case. I can’t change it from Home to home but Life360 seems to report it as home, lowercase h.
image
Once it saw I was home, it should have stopped the automation but it didn’t. It continued on to everyone. My guess is that it comes from Life360 with the capital H.
I waited a bit to post again since my son is on his way home. When he got home and the status updated, this is what the same setup for him shows.
image
You can see for him, the Place does show Home with the capital H. So I can’t figure out why for me it continues to show a null value even though the Card shows Home.

The actual state for a device_tracker entity in HA that is in the “Home” zone is home (lowercase. And, FYI, the actual state for “Away” is not_home. This has been the case for HA device_tracker entities forever AFAIK.) It does not come from Life360. HA determines the state value based on the GPS data of the device_tracker entity.

What do you mean you can’t change it? Change what? Certainly, you should be able to change the value for the state key in the state condition to (lowercase) home, especially if you’re using the YAML mode. But, even in the UI mode, you should be able to select “Home”, and it will actually enter the value of home (and same for Away, for which it will enter not_home.)

So, just go edit your automation, in UI mode, and select “Home”. It should do the right thing.

E.g., when I create this condition in UI mode:

image

And then check “Edit in YAML”, I see this:

image

Ok. I think I am getting lost in the weeds here so let me ask my question a different way. If you look in Yaml, this is the section for me.
image

and this is the section for my son
image

and when I look at the status in HA for me is shows again a Null value
image

but for him, it shows Home as the place value.

image

Why is it different? Maybe if I can understand why they are different, then I can figure out what’s going on. I had him stand beside me and we both opened the Life360 app so it would update.

You’re never going to get where you want to be if you keep following this tack. You need to forget about the place attribute. It is strictly controlled by Life360, and I have no idea why it seems to be correct for your son and not for you.

The only way this is going to work for you is if you use the device_tracker state in the code, and the state value for that is home, not Home. Take what you have, remove the attribute line, and change Home to home. Then it should work.

I know you said you can’t change it to home, but I still don’t understand why that is the case. Maybe you could describe exactly how you’re trying to change it. As I showed you above, it can be done.

Ok. I’ll mess with it some tomorrow. Also I do have a place in Life360 named home so that’s why I use that.

Dj

Ok. I figured it out. It has to do with multiple circles. I got some Tile devices for Christmas and set them up the other day and added them to my Life360 account. I didn’t want the devices to show up on everyone’s phone so I created a second circle and put them there. I guess HA was getting my information from that circle and not the family one. When I added home as a place in that circle this morning, it showed up in HA.

1 Like

Ok, thanks for the additional information. That does seem to explain it.

The current life360 integration implementation will retrieve your data from all Circles you are in (well, all the Circles it sees via the Life360 accounts that have been configured in HA), and it will use whichever is the last one it retrieves. I don’t know if the order is deterministic, as it depends on the order the data is provided by the Life360 server. But it does seem like in your case it was definitely retrieving the newer Circle (i.e., the one you created for the Tiles) last.

FWIW, I mentioned a custom integration I created to test out a new life360 integration implementation. That newer implementation also retrieves a Member’s data from all Circles they are in, but it attempts to find and use the “best” data of those (which is not necessarily the last one it retrieves.) There are several criteria, the last one is, all else being equal, data with a non-empty Place is considered “better.” So, had you been using that, you may not have ever noticed a problem. :slightly_smiling_face: (I say “may”, because data with a later “last_seen” attribute is considered better, and that has a higher priority than the place attribute comparison.)

1 Like

Thanks for all the help and information. At least all the info is here in case someone else runs into this.

1 Like