pnbruckner / ha-life360

A Home Assistant integration for Life360.
45 stars 6 forks source link

Failed Authentication #15

Closed matthewharrington closed 6 months ago

matthewharrington commented 6 months ago

Hi team.

I am purplexed here.

Installed new API version but cannot get authorised. Reset password, used token with no joy. Any thoughts?

Many thanks for your hard work on this integration

image

ogger: homeassistant.config_entries Source: config_entries.py:575 First occurred: 11:26:26 PM (3 occurrences) Last logged: 11:39:48 PM

Error setting up entry Life360 for life360 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/life360/init.py", line 233, in async_setup_entry await async_process_data() File "/config/custom_components/life360/init.py", line 214, in async_process_data await asyncio.gather(*coros) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 280, in async_config_entry_first_refresh await self._async_refresh( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/life360/coordinator.py", line 658, in _async_update_data raw_member_data = await self._coordinator.get_raw_member_data(self._mid) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/life360/coordinator.py", line 161, in get_raw_member_data raw_member_list = await asyncio.gather( ^^^^^^^^^^^^^^^^^^^^^ asyncio.exceptions.CancelledError

pnbruckner commented 6 months ago

There is at least one problem here, maybe two. I found and just fixed one of them. Hopefully that solves your problem, too. The fix is available when installing manually as version 0.5.0.dev0. I'll release it as 0.5.0b1 (which can be installed via HACS) shortly.

When you get a chance to try one of those, let me know if it fixes the problem for you. If not, share any new details and I'll try to figure out what's wrong.

pnbruckner commented 6 months ago

Just committed 0.5.0.dev1 with another (possibly related) fix.

pnbruckner commented 6 months ago

Released 0.5.0b1. @matthewharrington, please give it a try and let me know if it solves the problem or not.

matthewharrington commented 6 months ago

Thanks Phil.

I removed my manual installation and installed version 0.5.0b1 via HACS, reset password. Same issue using Bearer Token with Invalid Authorisation.

Cheers, Matt

pnbruckner commented 6 months ago

Ok, thanks for letting me know. I think I found at least one other bug. Also, I seem to be getting a lot of "login" errors recently, so either something else has changed in the way their API works, or it's just one of those times where they seem to happen more, but then it settles down a bit. I know, not very comforting, but it is what it is.

I'll let you know when I have another beta version to try...

pnbruckner commented 6 months ago

There are a couple more fixes available in 0.5.0b2. Also, it seems yesterday that Life360 was very likely to return HTTP error 403 "Forbidden" (aka login error) in response to any and all queries requesting the list of Circles. This happened on my test system for several hours until I disabled it. Then, about 1.5 hours later when I re-enabled it, it worked after a single "too many requests" error.

@matthewharrington, please give 0.5.0b2 a try and let me know how it goes for you.

matthewharrington commented 6 months ago

Hi Phil.

Login successful! Wahoo!

I only have the binary sensor in the integration however. Should it auto add my circle members?

Cheers, Matt

woodmj74 commented 6 months ago

@matthewharrington I had to disable my account in the integration and re-enable then walk away and have a coffee. Then suddenly my people arrived. (Sorry, not very scientific but what worked/happened for me).

pnbruckner commented 6 months ago

These, unfortunately, seem to be very common occurrences. Please see https://community.home-assistant.io/t/life360-device-tracker-platform/52406/2142 for more details/background.

I'm still trying to improve things, but it's all a guessing game.

pnbruckner commented 6 months ago

Released 0.5.0b3, which may help.

matthewharrington commented 6 months ago

Good morning Phil. 0.5.0b5 has done the trick for me. I now have all entities available. I had to attempt two logins via the manage accounts and then all circle entities appeared. Amazing work.

pnbruckner commented 6 months ago

Did you see this: https://github.com/pnbruckner/ha-life360/tree/new-api#note-on-updating-circles--members-lists

It's possible you did not have to "attempt two logins via the manage accounts", but rather just wait for the Circles & Members lists to finish being retrieved.

In any case, glad it's working for you!

If you're good now, feel free to close the incident.

matthewharrington commented 6 months ago

Closed as login working now