Pyhass / Hive-Custom-Component

A custom version of the home assistant hive component
MIT License
33 stars 17 forks source link

Hive stopped working #151

Closed virtusas closed 7 months ago

virtusas commented 7 months ago

Today out of a blue Hive stopped working as intergaration. Under devices states that Failed to setup. No system ammendments were performed before issue came up. Rebooting home assistant and whole networking system does not help. Is it just me or someone else has similar issues. Hive official app is working fine and their systems online are reporting no issues. Looking at logs seems that issue is with token but I am not very detailed techie to fully understand that. Don't want to delete and reinstal integration at this stage, not to break bunch of automations if there are any workarounds possible. Thank you for advice if anyone can help.

Logger: homeassistant.config_entries Source: config_entries.py:406 First occurred: 20:45:00 (1 occurrences) Last logged: 20:45:00

Error setting up entry *****@gmail.com for hive Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/apyhiveapi/api/hive_auth_async.py", line 548, in refresh_token result = await self.loop.run_in_executor( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 535, in _api_call return self._make_api_call(operation_name, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/botocore/client.py", line 980, in _make_api_call raise error_class(parsed_response, operation_name) botocore.errorfactory.NotAuthorizedException: An error occurred (NotAuthorizedException) when calling the InitiateAuth operation: Refresh Token has expired

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

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hive/init.py", line 89, in async_setup_entry devices = await hive.session.startSession(hive_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/apyhiveapi/session.py", line 503, in startSession await self.getDevices("No_ID") File "/usr/local/lib/python3.11/site-packages/apyhiveapi/session.py", line 426, in getDevices await self.hiveRefreshTokens() File "/usr/local/lib/python3.11/site-packages/apyhiveapi/session.py", line 304, in hiveRefreshTokens result = await self.auth.refresh_token( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/apyhiveapi/api/hive_auth_async.py", line 562, in refresh_token raise HiveInvalid2FACode from err apyhiveapi.helper.hive_exceptions.HiveInvalid2FACode

perjury commented 7 months ago

Mine's working ok at the moment

virtusas commented 7 months ago

Mine's working ok at the moment

Thanks for update. Very strange how mine just stopped.

virtusas commented 7 months ago

OK, just chanced to delete and add new component. Seems that all is back to normal. Thankfully no automations broke.... 😁

Mossi777 commented 5 months ago

Mine fails to setup every time Home assistant reboots.