dahlb / ha_hatch

Home Assistant Integration for Hatch Rest Mini
MIT License
77 stars 16 forks source link

Failed to setup #74

Closed namankanakiya closed 8 months ago

namankanakiya commented 8 months ago

The integration was working well until today - I noticed that the device wasn't responding in my automations. I took a look at my devices and entities and saw that they all had an error. After trying the "reload" button a few times, and looking at the logs, the integration was erroring out with: Attempt to decode JSON with unexpected mimetype: text/html

I removed the integration, and attempted to add it once again. I enabled the advanced debugging as requested, and this is the error which is gotten:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ha_hatch/__init__.py", line 105, in async_setup_entry await setup_connection("initial setup") File "/config/custom_components/ha_hatch/__init__.py", line 77, in setup_connection _, mqtt_connection, rest_devices, expiration_time = await get_rest_devices( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/util_bootstrap.py", line 31, in get_rest_devices token = await api.login(email=email, password=password) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/hatch.py", line 66, in login await self._post_request_with_logging_and_errors_raised( File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/hatch.py", line 16, in request_with_logging_wrapper response = await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/util_http.py", line 22, in request_with_logging_wrapper response = await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hatch_rest_api/hatch.py", line 47, in _post_request_with_logging_and_errors_raised return await self.api_session.post(url=url, json=json_body, headers=headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 560, in _request await resp.start(conn) File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 899, in start message, payload = await protocol.read() # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/streams.py", line 616, in read await self._waiter asyncio.exceptions.CancelledError: aiohttp connection lost

Not sure if the hatch response data / type has changed on their side. Let me know if I can help in debugging

dahlb commented 8 months ago

thanks for writing this up, I think the hatch api is down atm, when I attempt to use the official hatch app on android it fails to load ...

FuzzyMistborn commented 8 months ago

Confirmed by Hatch. Got this email about 30 minutes ago.

image

namankanakiya commented 8 months ago

Confirmed - also working now, closing issue