Skip to content

hive hub not authenticating #163584

Description

@wipeout88

The problem

had to reset my hive hub. got it all working again tried to reconnect it to HA using the hive hub integration and kept getting this error

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/api/hive_auth_async.py", line 569, in refresh_token
    result = await self.loop.run_in_executor(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.13/site-packages/botocore/client.py", line 569, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/botocore/client.py", line 1023, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.NotAuthorizedException: An error occurred (NotAuthorizedException) when calling the InitiateAuth operation: Invalid Refresh Token.

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/session.py", line 314, in hiveRefreshTokens
    result = await self.auth.refresh_token(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.tokens.tokenData["refreshToken"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/api/hive_auth_async.py", line 579, in refresh_token
    raise HiveFailedToRefreshTokens from err
apyhiveapi.helper.hive_exceptions.HiveFailedToRefreshTokens

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/session.py", line 291, in deviceLogin
    result = await self.auth.device_login()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/api/hive_auth_async.py", line 441, in device_login
    raise HiveInvalidDeviceAuthentication
apyhiveapi.helper.hive_exceptions.HiveInvalidDeviceAuthentication

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 762, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hive/__init__.py", line 42, in async_setup_entry
    devices = await hive.session.startSession(hive_config)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/session.py", line 520, in startSession
    await self.getDevices("No_ID")
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/session.py", line 437, in getDevices
    await self.hiveRefreshTokens()
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/session.py", line 321, in hiveRefreshTokens
    await self.deviceLogin()
  File "/usr/local/lib/python3.13/site-packages/apyhiveapi/session.py", line 293, in deviceLogin
    raise HiveInvalidDeviceAuthentication
apyhiveapi.helper.hive_exceptions.HiveInvalidDeviceAuthentication

any help with this issue would be greatly apricated

What version of Home Assistant Core has the issue?

core-2026.2.2

What was the last working version of Home Assistant Core?

core-2026.2.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

home-assistant_hive_2026-02-20T00-33-17.380Z.log

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions