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
339 stars 64 forks source link

Attempt to decode JSON with unexpected mimetype: text/plain #326

Open IMakeTP opened 6 months ago

IMakeTP commented 6 months ago

The problem

Unknown pynest exception.

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

0.4.0b4

What version of Home Assistant Core has the issue?

2024.4.3

Device / Model

Nest Protect Battery

Diagnostics information

No response

Home Assistant log

Logs This error originated from a custom integration. Logger: custom_components.nest_protect Source: custom_components/nest_protect/__init__.py:168 integration: Nest Protect (documentation, issues) First occurred: 6:51:07 PM (4 occurrences) Last logged: 9:54:12 PM Unknown pynest exception. Please create an issue on GitHub with your logfile. Updates paused for 1 minute. Traceback (most recent call last): File "/config/custom_components/nest_protect/pynest/client.py", line 298, in subscribe_for_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 73, in json return await super().json(*args, loads=loads, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1176, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe73-front01-iad01.transport.home.nest.com/v6/subscribe') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/nest_protect/__init__.py", line 168, in _async_subscribe_for_data result = await entry_data.client.subscribe_for_data( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nest_protect/pynest/client.py", line 302, in subscribe_for_data raise PynestException( custom_components.nest_protect.pynest.exceptions.PynestException: 200 error while subscribing -

Additional information

No response

martymart8864 commented 6 months ago

Having the same issue and device/versions as @IMakeTP

bmos commented 6 months ago

I have this issue also

Logs Logger: custom_components.nest_protect Source: custom_components/nest_protect/__init__.py:168 integration: Nest Protect (documentation, issues) First occurred: 1:00:23 PM (1 occurrences) Last logged: 1:00:23 PM Unknown pynest exception. Please create an issue on GitHub with your logfile. Updates paused for 1 minute. Traceback (most recent call last): File "/config/custom_components/nest_protect/pynest/client.py", line 298, in subscribe_for_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 73, in json return await super().json(*args, loads=loads, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1176, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe74-front01-iad01.transport.home.nest.com/v6/subscribe') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/nest_protect/__init__.py", line 168, in _async_subscribe_for_data result = await entry_data.client.subscribe_for_data( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nest_protect/pynest/client.py", line 302, in subscribe_for_data raise PynestException( custom_components.nest_protect.pynest.exceptions.PynestException: 500 error while subscribing -
iMicknl commented 4 months ago

Please update to v0.4.0b5 and let me know if this issue is still present.

martymart8864 commented 4 months ago

Hi @iMicknl, thanks for the update but stupid question. How do I upgrade? I uninstalled the v0.4.0b4 package from HA, went to the integration again but it reinstalled v0.4.0b4 and not v0.4.0b5. I'm obviously doing something wrong here.. thanks!

iMicknl commented 4 months ago

@martymart8864 have you pressed "Update information"? Selecting "Redownload" should show the latest version.

image

martymart8864 commented 4 months ago

Thanks again @iMicknl, got it now. I'll let it run for a a few days and check if I still get the error!

martymart8864 commented 4 months ago

Hi @iMicknl

Still given me an error message running version 0.4.0b5


Logger: custom_components.nest_protect Source: custom_components/nest_protect/init.py:169 integration: Nest Protect (documentation, issues) First occurred: 1:36:35 PM (1 occurrences) Last logged: 1:36:35 PM

Unknown pynest exception. Please create an issue on GitHub with your logfile. Updates paused for 1 minute. Traceback (most recent call last): File "/config/custom_components/nest_protect/pynest/client.py", line 309, in subscribe_for_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 79, in json return await super().json(*args, loads=loads, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1176, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain', url=URL('https://czfe09-front01-iad01.transport.home.nest.com/v6/subscribe')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/nest_protect/init.py", line 169, in _async_subscribe_for_data result = await entry_data.client.subscribe_for_data( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nest_protect/pynest/client.py", line 313, in subscribe_for_data raise PynestException( custom_components.nest_protect.pynest.exceptions.PynestException: 200 error while subscribing -