Life360 Device Tracker Platform

Phil,
Many thanks for your efforts with the integration. It is very much appreciated.

I have installed 0.5.0b0 and can now get a life 360 online connection that remains connected. I used the token method as the email connection would not stay connected.
It has been working for a day or so now and remained online and I see binary sensor created for my life 360 email address. It has not added anything else that I can see. In the past it would pull in the 3 other family members from my circle created.
Am I missing a step or else needed? At this point I donā€™t have any tracking ability.
Many thanks.

Yeah, things seem to have changed again. Itā€™s not working for me either. :frowning_face: Not sure whatā€™s going on yetā€¦

Iā€™ve not upgraded recently and still on 0.4.0 dev15ā€¦all working fine for me at the momentā€¦

Sorry for the second post. I have hidden my email address.

Hi, I updated 0.5.0b1 and since then Life360 no longer works. I reconfigured the integration, uninstalled and reinstalled it, but it doesnā€™t work anymore. Did I miss something? I have the following message:

Honestly, Iā€™m not sure at this point.

I have two systems running this code: my ā€œproductionā€ system and a test system. The production system seems to be running along smoothly. But Iā€™m seeing the same problems on my test system. And they are BOTH using the SAME authorization string. (The test system is also using a second account w/ username & password.)

I think I found a couple of possibly related issues with the b1 code, but ā€œfixingā€ them doesnā€™t seem to have completely solved the problem.

WAIT: UPDATE:

So, last night I was getting the ā€œloginā€ error (actually 403 Forbidden) when trying to retrieve the list of Circles & Members. This is retried every 15 minutes. It ran all night that way until I disabled the integration this morning.

Now when I re-enabled it (about 1.5 hours after disabling it), I got one ā€œtoo many queriesā€, which was retried after a couple of minutes, and IT WORKED!!

So, seems like Life360 just sometimes likes to be difficult. :person_shrugging:

EDIT:

The ā€œgoodā€ news is that, once the list of Circles & Members is retrieved, the normal Member update requests seem to work fine, although I have to say, I have seen a couple of ā€œloginā€ errors lately. I may end up having to retry those, too.

BTW, one of the ā€œfixesā€ I mentioned above involves the use of a separate query that I was using only in the config flow, specifically the ā€œmeā€ query. I was using that as sort of a test to make sure the authorization entered (either username/password or authorization string) worked, but it, just like the request for Circles, seems to sometimes cause login errors, so I simply deleted it (since I had never used it before.)

Released 0.5.0b2

A couple more fixes:

  • Fix a bug with updating Circles & Members data update coordinator. This bug could sometimes prevent properly creating or deleting device_tracker entities after configuration account options were changed.
  • Do not use ā€œget_meā€ query in config flow to test authorization since it also sometimes causes error 403 ā€œForbiddenā€ (aka login error.)
2 Likes

Everything works fine now. Thank you for your work.

Hi Phil,

Iā€™ve had some issue with this release. All changes involved a restart of HA afterwards.

I did a dirty upgrade over the previous version 0.5.0b1 and I could no longer get status for the entity trackers that were created and it disabled the integration.

I tried reenabling the account (username and password), but the same issue persisted.

So I removed the service, and did a fresh install however when logging in again I am only getting a binary sensor for one of the users pulled in, and then no device items created for the users linked to then account.

Logs seem to indicate it canā€™t get the members and circles as you describe above after the clean install, but there were no errors on when installing over the previous version (where the data would have been in a local file from previous requests), just that the entities were unavailable

Iā€™ll leave it a while, but may revert back a couple of revisions if the issue continues

OK I was getting 429 requests all the time.

Disabled the Integration for 5 mins, reenabled and it worked first time. I also opened the life360 app on my mobile during disablement, not sure if that kicks something to work also

Yes, I have seen that, too, a few times, but not very often. It seems sometimes the first Member update can result in an error 403 (forbidden, aka login), which will, indeed, cause the account to be disabled. Thatā€™s not the whole integration that gets disabled, but just the corresponding account. You should also see an ERROR in the log about the login error while getting data for the Member. And, of course, there should be a repair issue as well.

Currently, the integration only retries error 403 while fetching the lists of Circles & Members, but Iā€™m considering retrying all of these errors. There seems to be no rhyme or reason to when the server will return this error, although it seems to happen way more often while fetching the list of Circles.

Yep, when you remove the integration entry, the file that saves the list of Circles & Members gets deleted. So this is not unexpected. It wonā€™t be able to create the tracker entities until it can retrieve new lists. And that canā€™t complete until the server stops returning error 403 or 429.

Nope, no errors, just warnings until it can complete the retrieval of the lists of Circles & Members.

Ah, then you were lucky! :laughing: Iā€™ve never seen a case where an error 403 happens immediately after an error 429, and Iā€™ve never seen a case where error 429 doesnā€™t go away when the integration waits the amount of time the servers says to wait (which, BTW, you can see in DEBUG messages in the log.) You can disable and re-enable the account, but it will just get another error 429 with the remaining time (if there is any.) If the time is up, it will work, whether or not the account was disabled/re-enabled. Bottom line is, when it gets in this state where itā€™s retrieving the list of Circles & Members, but itā€™s getting these errors, you just have to wait. Could be a couple minutes, could be hours.

Having said that, Iā€™m trying one other thing (which I havenā€™t released yet.) I.e., when it gets an error 403 while retrieving Circles, it will clear the network sessionā€™s cookies. I have no idea if this will have any positive effect, but I donā€™t know what else to try.

Thanks for the explanations they will definitely help others. The cookies thing may work, would make sense if Cloudflare are assigning affinity in their DC to a server and it may reset that connection. Its certainly a trick I try when testing load balancers at work when we giving them a cookie as part of the first connection request

1 Like

Released 0.5.0b3

Sometimes the Life360 server will continually respond with error 403 (forbidden/login) to requests for the list of Circles an account can see. Other times, however, it will respond with just one error 429 (too many requests), or it will simply work. In both error cases, the integration will retry (after 15 minutes for error 403, or the amount of time the server says after error 429) as many times as necessary until the query works. There doesnā€™t seem to be any rhyme or reason as to how the server will respond at any given time. Sometimes the first request works, sometimes thereā€™s one error 429, sometimes thereā€™s a few error 403ā€™s, sometimes it seems like it will respond indefinitely with error 403. As an attempt to deal with this, the integration will now clear the network sessionā€™s cookies when it gets an error 403 after a Circle request. No idea if this will help, but itā€™s worth a try.

Also, when selecting an account to modify or delete, show which accounts are disabled.

Lastly, when an error 403 occurs while retrieving Member data, all activity with the associated account is stopped and the account is disabled. However, in some rare circumstances, a ā€œforegroundā€ Circles & Members update may be in progress, and that was not being stopped properly. This update fixes that.

Released 0.5.0b4

In an attempt to minimize the effects of HTTP error 403 (forbidden, aka login):

  • Clear cookies after all 403 errors, not just in response to request for Circles list.
  • Reduce retry delay after 403 error after Circles request from 15 to 5 minutes.
  • Immediately retry all other requests after 403 error up to 2 times.

I donā€™t know if any of this will help, but itā€™s an attempt to avoid login errors after a HA restart which seem to sometimes happen while fetching Member data.

1 Like

Updated to b4ā€¦ Had to disable my account and then re-enable itā€¦

All is well after that.

Why do you say that?

What version did you have before? Any errors or warnings?

All entities were disabled after I updatedā€¦ I reviewed the config settings and it said that my account was disabled.

I selected modify account to re-enter my credentials and all was well after that.

I updated from b3ā€¦ I generally use your composite tracker, so it ā€˜mayā€™ have been disconnected/disabled from the b2(?) - b3 update and I did not notice it.

Ok, thanks for the details.

same hereā€¦

@JasonMeudt @maurizio53 when an account gets disabled, there should be an ERROR in the system logs, and a repair issue should get created. Also, the corresponding ā€œonlineā€ binary sensor should change to disconnected (i.e., off.) Did you not see any of that? The account should not get disabled without some sort of indication.

Released 0.5.0b5

  • Skip account type selection when modifying an existing account.
  • Bump life360 package version to 7.0.0.
  • Add explanation of when to use ā€œAccess type & tokenā€ to config flow.
  • Update info.md.
  • Improve login error test.