HiveInvalidDeviceAuthentication after recent backend change (worked until yesterday)
Hi,
My Hive integration was working normally until yesterday.
After that, login succeeds (didn't ask for 2FA) but integration fails with:
HiveInvalidDeviceAuthentication
Stack trace points to:
deviceLogin()
hiveRefreshTokens()
startSession()
Environment:
Home Assistant Green
HA Core 2026.2.2
Python 3.13
No subscription
2FA enabled
Rollback to previous HA version did not fix the issue.
All devices and schedules work correctly in the Hive app.
It appears that Hive may have changed device authentication handling.
Is this related to recent backend updates?
Thanks.
I'm having the same issue :( do we have any idea how what has happened?
I'm having the same issue :( do we have any idea how what has happened?
Same here - core HA Hive and HACS Custom exact same behaviour. Oddly, Hive app not asking for 2FA upon remove trusted, logout, then login. Posssibly something on their side?
I'm having the same issue :( do we have any idea how what has happened?
Same here - core HA Hive and HACS Custom exact same behaviour. Oddly, Hive app not asking for 2FA upon remove trusted, logout, then login. Posssibly something on their side?
Yeah exactly the same here, it's not sending or asking for the 2FA code.
I am having the same issue except I am a new user and have never used it before. Login accepted but never been asked for 2FA, here are my logs:
`Logger: homeassistant.config_entries Source: config_entries.py:762 First occurred: 19:59:08 (1 occurrence) Last logged: 19:59:08
Error setting up entry [email protected] for hive 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 "/config/custom_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`
Hope this helps.
I'm having the same issue :( do we have any idea how what has happened?
Same here - core HA Hive and HACS Custom exact same behaviour. Oddly, Hive app not asking for 2FA upon remove trusted, logout, then login. Posssibly something on their side?
I thought that was really strange I got in touch with Hive support about it but they were useless in diagnosing the issue. They just kept saying remove trust, logout, uninstall app, reinstall and log back in but no 2fa. I eventually asked to remove/disable 2FA/MFA but they said it wasn't possible... shame, I am certain that'll fix the issue (even if its a temporary fix).
I'm having the same issue :( do we have any idea how what has happened?
Same here - core HA Hive and HACS Custom exact same behaviour. Oddly, Hive app not asking for 2FA upon remove trusted, logout, then login. Posssibly something on their side?
I thought that was really strange I got in touch with Hive support about it but they were useless in diagnosing the issue. They just kept saying remove trust, logout, uninstall app, reinstall and log back in but no 2fa. I eventually asked to remove/disable 2FA/MFA but they said it wasn't possible... shame, I am certain that'll fix the issue (even if its a temporary fix).
I debated getting in touch with them, but expected an outcome similar to yours. Of note, their back end is broken as I can't add my Hive to Alexa or Google Home. Seems like existing authentication is working, but new logins won't work at all unless on the Hive app.
Same here unfortunately
Setup a new HA install and experiencing exactly the same problem. Tried contacting hive on Monday and they said an engineer would email once resolved... Heard nothing since so going to contact on Friday. Can login to everything without 2fa codes so slightly worrying. Have noted that the web dashboard https://my.hivehome.com is working again though....
Same problem for me
Same issue for me, new HA user trying to make sense of Hive, no 2FA since creating account, spoke to Hive Support, no real sense to their advise, delete trusted devices then after 24hrs delete app and try again.
I think I'm going to have to bite the bullet and do it via zigbee until hive fix it. Much prefer the independent app and using the integration but even the app is having issues for me at the minute. Keep getting emails saying my password was changed successfully (nothings changed).
I have no idea if this will make a difference but I have emailed the Complaints Team @ HiveHome ... definitely a problem at their end!
I have no idea if this will make a difference but I have emailed the Complaints Team @ HiveHome ... definitely a problem at their end!
I did the same on Tuesday - haven't heard back. Hive is basically now a product and marketing division of Centrica - they laid off almost all their technical staff a year or two ago.
If it wasn't for TRVs and on-demand heating I'd replace Hive with zigbee switches and temp sensors. There are several nice thermostat templates for run-on and thermostat emulation.
@KJonline I think I found a temporary fix for the recent Hive auth/reauth issue and wanted to share it directly. I couldn’t find a direct contact method, so apologies for posting here. I think Hive changed something upstream that messed up fallback auth handling? If this is not something you want/ want me to delete, please just say as I'm not sure if this is allowed here. I just I thought I'd try share that this got it working for me.
Full disclosure: I used Codex to help debug and package the patch as me trying this solo completely destroyed my HAOS, but this was tested on my live HA instance and resolved the loop for me. It's been driving me insane for the past 2 weeks as it broke all my heating related automations (Thanks again Hive).
Environment: Home Assistant: 2026.2.3 Hive custom component: 2025.11.2 pyhive-integration: 1.0.8.dev10 Observed behavior Initial login succeeds. Later, when refresh token expires, fallback auth loops.
Recurring errors:
Refresh token is invalid or expired Device login failed: expected DEVICE_SRP_AUTH challenge, got None Config entry ... could not authenticate Root cause (observed) When login returns AuthenticationResult + NewDeviceMetadata (without SMS step), device_data is not always persisted into the config entry.
Later, refresh fallback needs device auth, but valid persisted device credentials are missing, so it loops.
What worked for me In config_flow.py (async_step_user), after successful login:
If AuthenticationResult.NewDeviceMetadata exists:
set self.hive_auth.access_token set self.hive_auth.device_group_key and self.hive_auth.device_key call await self.hive_auth.device_registration(self.device_name) persist self.data["device_data"] = await self.hive_auth.get_device_data() then create/update config entry as normal This stopped the reauth loop on my setup.
Extra debug tooling included: Optional Disable 2FA (debug) toggle in config flow Sanitized auth payload logging (secrets/tokens masked) This made it much easier to confirm whether failures were MFA-challenge related or post-login persistence related.
RELEASE_NOTES_hive_debug_fix.md
@KJonline I think I found a temporary fix for the recent Hive auth/reauth issue and wanted to share it directly. I couldn’t find a direct contact method, so apologies for posting here. I think Hive changed something upstream that messed up fallback auth handling? If this is not something you want/ want me to delete, please just say as I'm not sure if this is allowed here. I just I thought I'd try share that this got it working for me.
Full disclosure: I used Codex to help debug and package the patch as me trying this solo completely destroyed my HAOS, but this was tested on my live HA instance and resolved the loop for me. It's been driving me insane for the past 2 weeks as it broke all my heating related automations (Thanks again Hive).
Environment: Home Assistant: 2026.2.3 Hive custom component: 2025.11.2 pyhive-integration: 1.0.8.dev10 Observed behavior Initial login succeeds. Later, when refresh token expires, fallback auth loops.
Recurring errors:
Refresh token is invalid or expired Device login failed: expected DEVICE_SRP_AUTH challenge, got None Config entry ... could not authenticate Root cause (observed) When login returns AuthenticationResult + NewDeviceMetadata (without SMS step), device_data is not always persisted into the config entry.
Later, refresh fallback needs device auth, but valid persisted device credentials are missing, so it loops.
What worked for me In config_flow.py (async_step_user), after successful login:
If AuthenticationResult.NewDeviceMetadata exists:
set self.hive_auth.access_token set self.hive_auth.device_group_key and self.hive_auth.device_key call await self.hive_auth.device_registration(self.device_name) persist self.data["device_data"] = await self.hive_auth.get_device_data() then create/update config entry as normal This stopped the reauth loop on my setup.
Extra debug tooling included: Optional Disable 2FA (debug) toggle in config flow Sanitized auth payload logging (secrets/tokens masked) This made it much easier to confirm whether failures were MFA-challenge related or post-login persistence related.
RELEASE_NOTES_hive_debug_fix.md
HUGE thanks for this - I overwrote the files from the .zip, restarted HA and logged in immediately. This has also been driving me mad for far too long! Hopefully @KJonline can do some digging in time and make this official. You, @tamunro93 are a hero.
@tamunro93 do you want to create a PR in the custom component repo and then we can get this merged in.
Link to repo
https://github.com/Pyhass/Hive-Custom-Component
The only thing would call out is I have been playing with the codebase recently trying to get rid of the some of the issues. Hive is creating a bit of a nightmare for me at the minute.
But upon reviewing your notes above I did spot you have used a dependency of 1.0.8.dev10 which is a test build I have been playing with.
There shouldn’t be any issue I just wanted to call out it is a dev branch and could change when I release into the official 1.0.8 build.
To add as well someone did create a PR going into 1.0.8 dev builds which does include changes for the device meta data
@KJonline - Thanks for the feedback and for taking a look! I’m still pretty new to all of this and mostly just tinker with my own setup, so apologies if I stepped outside normal process/rules at any point. I definitely wasn’t trying to conflict with existing work, just share what resolved the issue on my side. I understand 1.0.8.dev10 is a dev dependency and I’m happy to adjust this PR in whichever way you want.
Hive has been driving me nuts for the past year. I also just want to say thanks for all the work everyone’s does on this. It’s made getting into all of this a way better experience than if I was starting from the ground up!
No need to apologise at all I’m very supportive of people getting involved. Please feel free to open a PR anytime and contribute. This project was my first real project where I used python and it’s been a roller coaster with Hives changes over the years. Python made it easy to change and keep up to date so I was lucky in that respect.
Above was just a note if anyone does use it in their installation.
thanks for the fix files, this was driving me nuts after it broke my Hive call for heat automations for all my Kasa TRVs in HA and now it's all back. Much gratitude!