ha-nest-protect: HA Restart Causes Nest Protect Integration to Fail

The problem

I am able to setup the integration fine using the integration at https://github.com/iMicknl/ha-nest-protect which leverages https://github.com/chrisjshull/homebridge-nest with the issueToken and Cookie. But when I restart HA, it breaks - log entry below. This started happening with the 2023.8.1 (likely any 8.x) version when upgraded from 2023.7 latest. I also confirmed that the user is not logged out to home.nest.com in the browser. It has been working fine for years before the 2023.8.1 update.

This error originated from a custom integration.

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/pynest/client.py:158
Integration: Nest Protect (documentation, issues)
First occurred: August 8, 2023 at 10:04:11 PM (635 occurrences)
Last logged: 12:10:38 PM

USER_LOGGED_OUT
Traceback (most recent call last):
  File "/config/custom_components/nest_protect/__init__.py", line 78, in async_setup_entry
    auth = await client.get_access_token_from_cookies(issue_token, cookies)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nest_protect/pynest/client.py", line 158, in get_access_token_from_cookies
    raise Exception(result["error"])
Exception: USER_LOGGED_OUT

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

v0.4.0b2

What version of Home Assistant Core has the issue?

2023.8.1

Device / Model

Device info Topaz-2.9 by Google Firmware: 3.5rc3 Hardware: Wired

Diagnostics information

No response

Home Assistant log

Logger: custom_components.nest_protect
Source: custom_components/nest_protect/pynest/client.py:158
Integration: Nest Protect ([documentation](https://github.com/imicknl/ha-nest-protect), [issues](https://github.com/imicknl/ha-nest-protect/issues))
First occurred: August 8, 2023 at 10:04:11 PM (643 occurrences)
Last logged: 12:21:21 PM

USER_LOGGED_OUT
Traceback (most recent call last):
  File "/config/custom_components/nest_protect/__init__.py", line 78, in async_setup_entry
    auth = await client.get_access_token_from_cookies(issue_token, cookies)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nest_protect/pynest/client.py", line 158, in get_access_token_from_cookies
    raise Exception(result["error"])
Exception: USER_LOGGED_OUT

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 16
  • Comments: 29 (4 by maintainers)

Most upvoted comments

@ahahamyan unfortunately not. This beta version has not been built by me, but by another contributor, and since it has so many open issues (https://github.com/iMicknl/ha-nest-protect/labels/beta (cookie-method)), it is still in beta.

I just returned from holidays, hopefully the coming months I am able to work on this project again. I am still on the old authentication method and this works like a charm…

@ilyassw sorry I should have been more clear. If you have never used the previous authentication method, you can’t use it now. Hence this sub optimal cookie method has been found by another user. This is currently the only way.