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.
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:
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.
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.)
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.)
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
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! 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
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.
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.
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.
@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.