iMicknl / ha-nest-protect

Nest Protect integration for Home Assistant. This will allow you to integrate your smoke, heat, co and occupancy status real-time in HA.
MIT License
330 stars 60 forks source link

Nest Protect integration for Home Assistant looses authentication after home assistant restarts #341

Open channafam opened 2 months ago

channafam commented 2 months ago

The problem

Nest Protect integration for Home Assistant looses authentication after every home assistant restart. This issue only started recently.

It’s seems I need to gather issue token and cookies after each restart. Gathering the details now seems to work intermittently. Following the instructions provided https://github.com/iMicknl/ha-nest-protect/tree/beta#retrieving-issue_token-and-cookies, the gathered token and cookie does not always work. Seems I need to follow procedure multiple times before on combination is finally accepted and allows authentication

What version of this integration (ha-nest-protect) has the issue?

0.4.0b5

What version of Home Assistant Core has the issue?

2024.7.0 And previous 2 versions

Device / Model

Nest Protect

Diagnostics information

No response

Home Assistant log

Logs ``` Copy/paste any log here, between the starting and ending backticks (`) ```

Additional information

@iMicknl - any thoughts? No response

atharayanil commented 2 months ago

I am having an identical issue; HA is running off a dedicated NUC [no docker]

horse-pants commented 2 months ago

I'm having the same issue, except tonight no combinations of token / cookie will work

prenazol commented 1 month ago

Same hre: tried several times and the cookies moethod works randomly and whe it works HA looses authentication after a restart. Never had such issue in the past year.

channafam commented 1 month ago

@ViPeR5000 , and @iMicknl - any suggestions?

atharayanil commented 1 month ago

follow up -- I was able to eventually get this reauthenticated and it's been stable/signed in for 7+days

jaburges commented 2 weeks ago

using the beta (and master) but after restart I get the LOGGED_OUT issue

iMicknl commented 2 weeks ago

@channafam I don't have any suggestions at the moment.

millerim commented 1 week ago

This has been happening to me also. I was able to authenticate using the documented procedure, but only once and not since. I keep getting "Unexpected error". Any advice is appreciated.

This seems to be the relevant log entry:

2024-09-01 12:34:04.285 ERROR (MainThread) [custom_components.nest_protect] Flow aborted: already_in_progress Traceback (most recent call last): File "/config/custom_components/nest_protect/config_flow.py", line 102, in async_step_account_link [issue_token, cookies, email] = await self.async_validate_input( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nest_protect/config_flow.py", line 64, in async_validate_input await self.async_set_unique_id(nest.user) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2389, in async_set_unique_id raise data_entry_flow.AbortFlow("already_in_progress") homeassistant.data_entry_flow.AbortFlow: Flow aborted: already_in_progress

UPDATE: I was able to authenticate by deleting all the re-authentication prompts. I didn't have to delete the integration itself. I'm guessing that it can't support more than one authentication flow at a time?

hausmanconsulting commented 1 week ago

This just happened to me as well (I've restarted HA many times in the last month or so and this is the first time I've lost my Nest authentication; I'm still on HA 2024.5.3, no recent updates there).

I wasn't 100% sure what @millerim meant by "deleting all the re-authentication prompts" but when I obtained a new issue token and cookies, I got an error about "invalid flow" when I tried entering them in the authentication popup that showed up when I initially restarted HA. So I closed that popup (which I think is what @millerim was referring to) and I went to settings - integrations - Nest Protect, and selected "Add Entry". Entering my new credentials there worked.

millerim commented 1 week ago

To clarify: each re-authentication entry in the integration page had a “kebab” menu with the option to delete the integration. I deleted both of them and was able to re-authenticate once they were gone.

On Sep 2, 2024, at 7:53 PM, Haus @.***> wrote:

This just happened to me as well (I've restarted HA many times in the last month or so and this is the first time I've lost my Nest authentication; I'm still on HA 2024.5.3, no recent updates there).

I wasn't 100% sure what @millerim https://github.com/millerim meant by "deleting all the re-authentication prompts" but when I obtained a new issue token and cookies, I got an error about "invalid flow" when I tried entering them in the authentication popup that showed up when I initially restarted HA. So I closed that popup (which I think is what @millerim https://github.com/millerim was referring to) and I went to settings - integrations - Nest Protect, and selected "Add Entry". Entering my new credentials there worked.

— Reply to this email directly, view it on GitHub https://github.com/iMicknl/ha-nest-protect/issues/341#issuecomment-2325390905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHGOIXHW5NJL4NW3PLCVDYLZUT253AVCNFSM6AAAAABKKLW2H2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRVGM4TAOJQGU. You are receiving this because you were mentioned.