ha-nest-protect: Nest Protects state won't update after device looses connectivity

The problem

I have 8 nest protects and some are showing constant occupancy. Since installation integration of devices (over 3 days).

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

0.3.3

What version of Home Assistant Core has the issue?

core-2022.3.5

Device / Model

Nest Protect wired (all)

Diagnostics information

nest_protect-35892183b4b12d5b93434ae1d74a1b83-Nest Protect (Master)-0cbce05c3735b0bf53ae08c61b68005a.json.txt

Home Assistant log

Seeing alot of this,

2022-03-17 15:12:29 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 15:12:47 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
E0317 15:12:58.128674263     216 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies
E0317 15:13:58.130622027     220 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies
E0317 15:14:58.132299334     220 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies
E0317 15:15:58.133009206     215 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies
E0317 15:16:58.135773953     213 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies
E0317 15:17:58.135772884     219 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies
E0317 15:18:58.137139927     214 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies
E0317 15:19:58.141251612     220 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies
E0317 15:20:58.140739172     213 fork_posix.cc:70]           Fork support is only compatible with the epoll1 and poll polling strategies

Additional information

occurs on 3 devices at a minimum right now.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 22 (9 by maintainers)

Most upvoted comments

Seeing same problem here. Interesting related to connectivity. I see it basically daily, reloading add-on fixes fir me. My internet us kind of flakey so makes sense on that front. (Basically state gets stuck and refuses to update)

Not sure if this is related, but adding in case it helps:

My Protect sensors in Home Assistant have been working well for about 2wk now.

Early this morning, my WAN connection went down for about 45min. I noticed that all my Protect occupancy sensors kept their values from when the internet became unavailable and then they did not update for about 6 hours after the internet connection was restored. I restarted Home Assistant and they began reporting occupancy correctly again. I didn’t have debug logging enabled, but this would be an easy scenario to test (temporarily disable WAN to HA).

Can confirm issue still present with latest releases. In terms of brooksben11’s comment, I would say either can loose connectivity and it be an issue. Every time I run my microwave for an extended period, it knocks out my wifi, causing the issue.

So I recently did a quick test to determine whether it’s the Nest devices or the Home Assistant instance losing connectivity that causes the sensors to stop updating (I also recently upgraded the Nest integration to the latest version, 0.3.5). I unplugged the ethernet cable to the Raspberry Pi running my Home Assistant instance for a few minutes and then reconnected. My logs look normal up until then and then just stop updating (as well as my motion sensor states staying stuck in their last state). So it’s definitely an issue of the integration losing connectivity, not the Nest devices. Hopefully this helps narrow down the issue…

Not sure if it helps, but I think it happens when the Smoke detector looses connectivity, rather than necessarily when the internet goes down (i.e. when home assistant looses connection). My microwave has a tendency to knock out my wifi, and just noticed the sensors seem to get stuck when the microwave runs (which shouldn’t impact home assistant’s connection)

Sounds good, I’m sure you know your code way better than Me, I just know I’ve had tunnel vision in the past trying to track down bugs, figured a place to start anyways.

@Ibycus314 Yeah, I only notice the issue when I restart my router nightly, but my internet is rock-solid (I don’t think it’s ever dropped even momentarily in the 5 years I’ve lived here. Google Fiber for the win!). Outside of this issue, the integration has been awesome for me; my only complaint is the 10 minute deal with the occupancy sensor, but that’s Google’s fault.

@iMicknl I’m fine doing a HA restart as a temporary fix, but is there a way to (easily) automate the reloading of an integration? A quick google search made it seem not easily doable and I don’t feel like putting in much effort for an adjustment to a bandaid. 😃

Hi,

Found these errors yesterday ,

2022-03-17 16:22:59 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:22:59 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: retrieving new Google access token
2022-03-17 16:28:16 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:29:11 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:39:43 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:42:48 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:48:06 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:51:05 ERROR (MainThread) [custom_components.nest_protect] Subscriber: pynest exception.
Traceback (most recent call last):
  File "/config/custom_components/nest_protect/pynest/client.py", line 238, in subscribe_for_data
    result = await response.json()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe05-front01-iad01.transport.home.nest.com/v6/subscribe')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/nest_protect/__init__.py", line 128, in _async_subscribe_for_data
    result = await entry_data.client.subscribe_for_data(
  File "/config/custom_components/nest_protect/pynest/client.py", line 242, in subscribe_for_data
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 200 error while subscribing - 
2022-03-17 16:52:05 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:52:06 ERROR (MainThread) [custom_components.nest_protect] Subscriber: pynest exception.
Traceback (most recent call last):
  File "/config/custom_components/nest_protect/pynest/client.py", line 238, in subscribe_for_data
    result = await response.json()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe13-front01-iad01.transport.home.nest.com/v6/subscribe')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/nest_protect/__init__.py", line 128, in _async_subscribe_for_data
    result = await entry_data.client.subscribe_for_data(
  File "/config/custom_components/nest_protect/pynest/client.py", line 242, in subscribe_for_data
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 400 error while subscribing - 
2022-03-17 16:53:06 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:53:16 ERROR (MainThread) [custom_components.nest_protect] Subscriber: pynest exception.
Traceback (most recent call last):
  File "/config/custom_components/nest_protect/pynest/client.py", line 238, in subscribe_for_data
    result = await response.json()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe01-front01-iad01.transport.home.nest.com/v6/subscribe')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/nest_protect/__init__.py", line 128, in _async_subscribe_for_data
    result = await entry_data.client.subscribe_for_data(
  File "/config/custom_components/nest_protect/pynest/client.py", line 242, in subscribe_for_data
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 400 error while subscribing - 
2022-03-17 16:54:16 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:54:18 ERROR (MainThread) [custom_components.nest_protect] Subscriber: pynest exception.
Traceback (most recent call last):
  File "/config/custom_components/nest_protect/pynest/client.py", line 238, in subscribe_for_data
    result = await response.json()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe32-front01-iad01.transport.home.nest.com/v6/subscribe')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/nest_protect/__init__.py", line 128, in _async_subscribe_for_data
    result = await entry_data.client.subscribe_for_data(
  File "/config/custom_components/nest_protect/pynest/client.py", line 242, in subscribe_for_data
    raise PynestException(
custom_components.nest_protect.pynest.exceptions.PynestException: 400 error while subscribing - 
2022-03-17 16:55:18 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:55:20 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:58:16 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 16:59:11 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:00:19 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:01:48 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:09:43 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:12:24 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:12:25 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:17:51 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:20:23 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:28:16 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data
2022-03-17 17:28:16 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: retrieving new Google access token
2022-03-17 17:29:12 DEBUG (MainThread) [custom_components.nest_protect] Subscriber: listening for new data