Hive Integration Error in 2022.7.*

I am getting the same here. Hive mini installed a few days ago. 2FA is enabled in the app but it never sends a text even if I log out there. Tried turning 2FA off and on - no change.

Setting up integration asks for username and password but no code - then fails with error.

System is:
Home Assistant 2022.11.2
Supervisor 2022.11.2
Operating System 9.3
Frontend 20221108.0 - latest

logs show:

2022-11-25 10:48:48.196 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hive which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-11-25 22:55:23.058 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [email protected] for hive
File "/config/custom_components/hive/__init__.py", line 89, in async_setup_entry
File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 503, in startSession
File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 426, in getDevices
await self.hiveRefreshTokens()
File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 304, in hiveRefreshTokens
File "/usr/local/lib/python3.10/site-packages/apyhiveapi/api/hive_auth_async.py", line 548, in refresh_token

Is this a ‘mini’ issue? or a Hive issue? or an integration issue? Not sure how to find out.

[Tried going back to the ‘official’ integration, but it does not turn up - even if I have deleted the custom component version from custom components folder and restarted etc. (I also cannot get rid of Hive custom component from HACS, only the main integration page - should I be able to?]

Any help welcome. TIA

@hawk100

The integration only works with 2FA enabled. So if you have disabled it then it won’t work.

Along side that when you have enabled 2fa you need to log out and login to the toffical hive app on the latest version. So that hive enables the latest account security for you

Thanks. I think 2FA is the issue as you and others have suggested, but it is apparently switched on in the app (and Google Play thinks it is the latest version).

As switching it off and on does not make a difference in the app (it stays on even after removing my phone as a trusted device), I will raise an issue with Hive about 2FA, and confirm with them my app version is the latest. Until 2FA works on the app, it would seem unlikely the integration will work in HA.

@Hawk100 Hi! Any luck? :slight_smile:

Not yet. Hive have just issued a new App version, but it does not resolve the 2FA issue as far as I can see.

There are several requests on the Hive forum to disable the 2FA as it appeared to have been over zealous (guessing maybe not working as it should), so maybe they disabled it behind the scenes.

I have tried raising a case on Hive community without success, yet.

Properly configured 2FA on the app should work fine (the banks have worked out how), but if not then overzealous 2FA would indeed be a pain for an app that is supposed to be easy for non technical people to use.

I asked on Github if 2FA is now required but no answer yet.

It seems strange/interesting that the app will work happily without 2FA but the integration will not (beyond my tech understanding).

Someone has suggested that it is possible to rollback the app to a previous version to get 2FA to work, but I am unsure how to do that as the non working version was the first to be installed on my phone following Hive heating Mini physical installation.

It seems to rollback to an old version of the app these links may help :

https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s=hive

In case it is of help - I downloaded v10.50.3 of the Hive app to a different device from the second URL above.

2FA worked on that version - I received a text code when logging in (after switching on 2FA) [note: I had already verified my account/phone on the original device in order to receive texts. I do not know yet if having different versions on each device will impact direct use of the Hive app]

Then in HA I set the default Hive integration to ‘ignore’ before downloading the custom Hive Integration using HACS, restarting HA and then adding/configuring the Custom integration.

After logging in I was asked for a 2FA code that had been sent to my phone - i.e. after some machination I managed to get it to work. I do not know yet if this 2FA code will expire at any time - I hope not.

Now it is installed OK it looks potentially very useful to help us manage different energy sources for heating water depending on sunshine/battery levels etc. - the reason to get this working - though not had much time to look at the specific entities/data yet.

Thank you to the devs and other contributors who have got us this far.

1.make sure 2fa is enabled in the app
2 log out of the app
3 log back in youll get the text enter that on the app
4 install the HA hive intergration log in and youll now get the 2fa promt
(if you have it already installed uninstall it and restart HA and then reinstall