Life360 Device Tracker Platform

Sorry been really busy for the last week, so not really kept up with the testing of this. Is it still only available as a custom repo ( i cloned the GiHub branch and mounted it in docker) or are we able to use HACs yet? No biggie, just want to update it ( I am about 10 days behind) and don’t know which way to go.

Cheers!

mb

EDIT: Answered my own question sort of as for now I have just done a git pull and a restart :slight_smile:

It’s still a “custom repo” (i.e., it’s not a built-in integration), but since I’ve released beta versions it can now be installed/maintained via HACS.

If you previously “manually” installed it, I would strongly recommend disabling the integration first (by which I mean, go to the Life360 integration page, click the three-dots next to “CONFIGURE” and select Disable. You should not have to delete the integration entry.) Then, after restarting HA, you can go through the process of removing the manual installation, and then adding it via HACS.

Oh, and then, once it has been installed by HACS, and you’ve restarted HA, you should be able to re-enable the integration entry. You’ll probably need to show disabled/hidden integrations to find it.

1 Like

Thanks Phil.

I just did a quick git pull and then a docker-compose pull to update both HA & Life360 quickly as about to jump into another meeting :slight_smile:
I’ll move it to HACs later tonight!

Thanks

mb

1 Like

Just added the following to the docs. It will be available in the next release:

Note on Updating Circles & Members Lists

The current implementation differs from previous versions in the way it retrieves the list of Circles visible to the registered accounts as well as the list of Members in each of those Circles. This is due to the fact that the server seems to severly limit when the list of Circles can be retrieved. It is not uncommon for the server to respond to a request for Circles with an HTTP error 429, too many requests, or an HTTP error 403, forbidden (aka a login error.) When this happens the request must be retried after a delay of as much as ten minutes. It may even need to be retried multiple times before it succeeds.

Therefore, when the integration is loaded (e.g., when the integration is first added, when it is reloaded, or when HA starts) a WARNING message may be issued stating that the list of Circles & Members could not be retrieved and needs to be retried. Once the lists of Circles & Members is retrieved successfully, there will be another WARNING message saying so.

Device tracker entities cannot be created until the lists of Circles & Members is known.

Once this process has completed the first time, the lists will be saved in storage (i.e., config/.storage/life360). When the integration is reloaded or HA is restarted, this stored list will be used so that the tracker entities can be created and updated normally. At the same time, the integration will try to update the lists again from the server, so WARNING messages may be seen again.

Due to the above, new Circles or Members will only be seen (and corresponding tracker entities created) when the integration is loaded. Therefore, if the registered accounts are added to any new Circles, or any Members are added to the known Circles, the integration will not be aware of those changes until it is loaded. This will happen at the next restart, or you can force it to happen by reloading the integration. I.e., go to Settings → Devices & services → Life360, click on the three dots next to “CONFIGURE” and select Reload. Please be patient since it could take a while due the above reasons before any new tracker entities are created.

Reviewing the logs, I only see an issue related to one of my circle members not sharing their locations…

Nothing on account errors.

EDIT: Updated to current git b5 and got this in the logs (as expected)…

2024-05-21 17:15:50.094 WARNING (MainThread) [custom_components.life360.coordinator] Could not retrieve full Circles & Members list from server; will retry

and followed soon (3 mins…) by:

2024-05-21 17:18:20.387 WARNING (MainThread) [custom_components.life360.coordinator] Circles & Members list retrieval complete

Thank you for keep this integration a life. I successfully add Life 360 integration to HA but I only have 1 binary sensor and nothing else

What I am doing wrong?

Restart HA and wait for a bit. You should then see the Life360 device_tracker show.

Look in your logs… You will see that you may have some warning on the loading of Cirlces…

Therefore, when the integration is loaded (e.g., when the integration is first added, when it is reloaded, or when HA starts) a WARNING message may be issued stating that the list of Circles & Members could not be retrieved and needs to be retried. Once the lists of Circles & Members is retrieved successfully, there will be another WARNING message saying so

See my post (just above yours…) that shows an example log entry…

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