Life360 Device Tracker Platform

Seems like I may need to add a brief explanation to the config flow that tracker entities will not get created until after the Circles & Members list can be obtained the first time…

Just wait a bit. Restart is not necessary.

I check my log, and it’s said: Circles& Members list retrieval cancelled. :man_shrugging:

That will happen if you change the accounts, either adding or deleting, or modifying, such as enabling or disabling, via the CONFIGURE button.

It can also happen in response to forbidden/login errors from retrieving Member data, but there should also be an ERROR message if that happens.

Please enable debug for the integration. Then reload the integration entry. Then go to the system logs page. WARNING & ERROR messages should show by default. To see DEBUG messages, you need to click the LOAD FULL LOGS button. You can filter using the search box at the top. E.g., enter Circles & Members in the box, and you should see details of the progress of retrieving the lists of Circles & Members.

If you need more detailed help, please start a PM with me.

1 Like

Thank you very much. I will, after I will come back home from work tonight. It’s really great to have someone who is helpful and dedicated. THANK YOU

1 Like

Released 0.5.0b6

Add notes to docs & config flow explaining the need to retrieve the list of Circles & Members before tracker entities can be created/deleted, and how that can take a while.

See Note on Updating Circles & Members Lists.

Also, here’s what the config flow dialogs look like:

After initially adding integration entry:

image

After modifying accounts via the CONFIGURE button:

image

3 Likes

I thought I had my setup working. Saw the device tracker entity. But only later travelled away from home to find out that the location on HA is not changing at all. It changes fine on the Life360 app.

The logs show this:

>   Line 144: 2024-05-22 18:17:11.588 DEBUG (MainThread) [custom_components.life360.coordinator] Updating Circles & Members took 0:00:23.357330
> 	Line 145: 2024-05-22 18:17:11.588 DEBUG (MainThread) [custom_components.life360.coordinator] Manually updated life360 data
> 	Line 146: 2024-05-22 18:17:11.588 WARNING (MainThread) [custom_components.life360.coordinator] Circles & Members list retrieval complete
> 	Line 147: 2024-05-22 18:17:16.119 DEBUG (MainThread) [custom_components.life360.coordinator] Finished fetching User data in 0.182 seconds (success: True)
> 	Line 148: 2024-05-22 18:17:21.113 DEBUG (MainThread) [custom_components.life360.coordinator] Finished fetching User data in 0.176 seconds (success: True)
> 	Line 149: 2024-05-22 18:17:26.154 DEBUG (MainThread) [custom_components.life360.coordinator] Finished fetching User data in 0.217 seconds (success: True)
> 	Line 150: 2024-05-22 18:17:31.103 DEBUG (MainThread) [custom_components.life360.coordinator] Finished fetching User data in 0.165 seconds (success: True)
> 	Line 151: 2024-05-22 18:17:36.143 DEBUG (MainThread) [custom_components.life360.coordinator] Finished fetching User data in 0.206 seconds (success: True)

Did you enter a value for “Max GPS accuracy”, and if so, what number did you enter?

If you go to the System Logs page, enter

Ignoring

in the “Search logs” box, and click LOAD FULL LOGS, do you see anything?

You might want to go to the Life360 integration page, click CONFIGURE, then under “DEBUG message verbosity”, select the bottom option. Then when you go back to the System Logs page, if you enter

[life360.api]

and click LOAD FULL LOGS, there will be a LOT of DEBUG messages, with all the gory detail of the requests to the server and the responses, including all the detailed data for each Member.

If you want to limit what’s seen to just the response data (including latitude, longitude, etc.), you might want to put the following in the search box instead:

Response data:

But be aware, like I said, this verbosity level will generate a LOT of extra messages in the log. I leave it set this way all the time, but you may not want to.

Yesterday I remove everything from Life360 folder, uninstalled and reinstalled again. Log in to my account to see which tokens I have to use, and it’s POST, not Bayer. Go thru configuration and… same result. It’s shows connected ( binary sensor) and nothing else.
Here is my debug log from today:

2024-05-24 06:40:21.318 DEBUG (MainThread) [custom_components.life360.coordinator] Updating Circles & Members (which was cancelled) took 0:02:07.325304
2024-05-24 06:40:21.318 WARNING (MainThread) [custom_components.life360.coordinator] Circles & Members list retrieval cancelled
2024-05-24 06:40:21.321 DEBUG (MainThread) [custom_components.life360.coordinator] Circles & Members foreground update: <Task pending name='Task-308950' coro=<RequestHandler._handle_request() running at /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:452> cb=[Task.task_wakeup()]>
2024-05-24 06:40:21.321 DEBUG (MainThread) [custom_components.life360.coordinator] Begin updating Circles & Members
2024-05-24 06:40:21.388 DEBUG (MainThread) [life360.api] Account 1: Request error: GET(https://api-cloudfront.life360.com/v4/circles), attempt 1: ClientResponseError(RequestInfo(url=URL('https://api-cloudfront.life360.com/v4/circles'), method='GET', headers=<CIMultiDictProxy('Host': 'api-cloudfront.life360.com', 'user-agent': 'com.life360.android.safetymapd/KOKO/23.50.0 android/13', 'accept': 'application/json', 'cache-control': 'no-cache', 'authorization': 'Post OPTIONS', 'Accept-Encoding': 'gzip, deflate, br')>, real_url=URL('https://api-cloudfront.life360.com/v4/circles')), (), status=429, message='Too Many Requests', headers=<CIMultiDictProxy('Date': 'Fri, 24 May 2024 10:40:21 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Content-Length': '5390', 'Connection': 'keep-alive', 'Retry-After': '478', 'X-Frame-Options': 'SAMEORIGIN', 'Referrer-Policy': 'same-origin', 'Cache-Control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'Set-Cookie': '__cf_bm=REDACTED; path=/; expires=Fri, 24-May-24 11:10:21 GMT; domain=.life360.com; HttpOnly; Secure; SameSite=None', 'Vary': 'Accept-Encoding', 'Set-Cookie': '_cfuvid=REDACTED; path=/; domain=.life360.com; HttpOnly; Secure; SameSite=None', 'Server': 'cloudflare', 'CF-RAY': '888caac59c980798-IAD', 'alt-svc': 'h3=":443"; ma=86400')>)
2024-05-24 06:40:21.389 DEBUG (MainThread) [custom_components.life360.coordinator] [email protected]: while getting Circles: aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url=URL('https://api-cloudfront.life360.com/v4/circles'); status: 429; retry_after: 478.0
2024-05-24 06:40:21.392 DEBUG (MainThread) [custom_components.life360.coordinator] Updating Circles & Members took 0:00:00.070440
2024-05-24 06:40:21.392 WARNING (MainThread) [custom_components.life360.coordinator] Could not retrieve full Circles & Members list from server; will retry
2024-05-24 06:40:21.392 DEBUG (MainThread) [custom_components.life360.coordinator] Begin updating Circles & Members
2024-05-24 06:40:21.392 DEBUG (MainThread) [custom_components.life360.coordinator] Circles & Members background update: <Task pending name='Circles & Members background update' coro=<CirclesMembersDataUpdateCoordinator._async_update_data.<locals>.bg_update() running at /config/custom_components/life360/coordinator.py:200> wait_for=<_GatheringFuture pending cb=[Task.task_wakeup()]> cb=[set.remove(), set.remove()]>
2024-05-24 06:40:21.393 DEBUG (MainThread) [custom_components.life360.coordinator] Finished fetching life360 data in 0.072 seconds (success: True)
2024-05-24 06:40:21.393 DEBUG (MainThread) [custom_components.life360.binary_sensor] Adding binary online sensors for: [email protected]
2024-05-24 06:40:21.421 DEBUG (MainThread) [life360.api] Account 1: Request error: GET(https://api-cloudfront.life360.com/v4/circles), attempt 1: ClientResponseError(RequestInfo(url=URL('https://api-cloudfront.life360.com/v4/circles'), method='GET', headers=<CIMultiDictProxy('Host': 'api-cloudfront.life360.com', 'user-agent': 'com.life360.android.safetymapd/KOKO/23.50.0 android/13', 'accept': 'application/json', 'cache-control': 'no-cache', 'authorization': 'Post OPTIONS', 'Accept-Encoding': 'gzip, deflate, br', 'Cookie': '__cf_bm=REDACTED; _cfuvid=REDACTED')>, real_url=URL('https://api-cloudfront.life360.com/v4/circles')), (), status=429, message='Too Many Requests', headers=<CIMultiDictProxy('Date': 'Fri, 24 May 2024 10:40:21 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Content-Length': '5390', 'Connection': 'keep-alive', 'Retry-After': '478', 'X-Frame-Options': 'SAMEORIGIN', 'Referrer-Policy': 'same-origin', 'Cache-Control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'Vary': 'Accept-Encoding', 'Server': 'cloudflare', 'CF-RAY': '888caac5cccb0798-IAD', 'alt-svc': 'h3=":443"; ma=86400')>)
2024-05-24 06:40:21.422 DEBUG (MainThread) [custom_components.life360.coordinator] [email protected]: rate limited while getting Circles: will retry in 488 s

And a screenshot of first configuration page:


I know, I am doing something wrong, but can’t figure it out what.

From the log:

Could not retrieve full Circles & Members list from server; will retry
rate limited while getting Circles: will retry in 488 s

All you should need to do is wait.

Before tracker entities can be created, the integration has to retrieve the list of Circles, and the list of Members in each of those Circles. Unfortunately, the Life360 server severely limits when the list of Circles can be queried. So, the first time you add the Life360 integration entry, you just have to wait until that process finishes. It (normally) can take up to 10 minutes, but there are times when it can take longer.

The latest release (0.5.0b6) added an explanation to the “config flow.”

See this post from just above.

4 hours later it’s still show 1 entity and status: connected

What version of the integration are you using?

Please (at least temporarily) change the Life360 integration entry config, setting the verbosity level to the middle choice (Above plus redacted response data) or lower (i.e., more details.) Then reload the config, go to the System Logs page and when you see the WARNING message in the log that the Circles & Members list has been successfully retrieved (you may have to refresh periodically to see it), enter the following in the search box:

Response data: {"circles":

then click LOAD FULL LOGS. What do you see?

Then change the search box to:

Response data: {"members":

What do you see?

If you want to share the detailed data, feel free to send it to me in a PM.

1 Like

Released 0.5.0b7

Catch TimeoutError exceptons during server queries. Package was catching asyncio.TimeoutError exceptions, but apparently aiohttp also throws Python built-in TimeoutError exceptions as well. New package version now catches TimeoutError exceptions so they are handled properly by the integration.

Phil,
Thanks for coming back to this. I have it installed and the list has populated with everyone. Now I just need to go back and see if the automations need to be configured differently. :slight_smile:

dj

1 Like

Phil, another thanks. Installed b7 and this is the first version for me that has stayed connected overnight. Fingers crossed but last few releases are working well.
Much appreciated.

1 Like

Installed b6 yesterday and its working like a dream for me so far. Really, really appreciate all the work on this integration!

1 Like

Hi
First of all thanks a lot for your integration
I try to update integration from version 0.3.10 to last beta version 0.5.0b5

And it is not working for me :

Enregistreur: homeassistant.setup
Source: setup.py:406
S'est produit pour la première fois: 16:06:03 (1 occurrences)
Dernier enregistrement: 16:06:03

Setup of 'life360' is taking longer than 300 seconds. Startup will proceed without waiting any longer
Enregistreur: homeassistant.bootstrap
Source: setup.py:181
S'est produit pour la première fois: 16:06:03 (1 occurrences)
Dernier enregistrement: 16:06:03

Error setting up integration life360 - received exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 167, in async_setup_component
    setup_future.set_result(result)
asyncio.exceptions.InvalidStateError: invalid state

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 181, in async_setup_component
    future.set_exception(err)
asyncio.exceptions.InvalidStateError: invalid state

Do I need to do a fresh install (uninstall + new install) to work? or is it something else?

Thanks for your help
++

The latest beta is 0.5.0b7. Please try that. In theory, you shouldn’t have to do anything but upgrade.

Thank you very much @pnbruckner for your quick answer
I have the same 2 error messages after re-updating from v 0.3.10 to 0.5.0b7 (I think that my previous post already concern b7 even if I wrote b5… :sweat_smile:)
Additionnaly, my integration is automatically disabled :
image

When I click on activate button, nothing seems to happen

I will try a fresh install (removing the integration, removing life360folder) and will see if it works again
++

OK no need to make a fresh install : Just need to delete the account and reconfigure new one.

Thanks again for all of your work ! It is awesome

1 Like