Hive integration: Failed to set up

Hi

My Hive integration has been working fine for as long as Ive been using HA (well over a year). Recently I noticed that it stopped working - this may have coincided with Hive forcing me to set up 2FA but I cant be sure

Try as I might i cant get it working again. I can login to Hive fine, get prompted for the 2FA code fine, but still it Fails to set up.

I have tried installing a completely clean HA instance on a different machine, and the problem persists - logs below

If anyone can help to solve this, I’ll be very grateful!
Thanks

HA Test installation
Logger: homeassistant.config_entries
Source: config_entries.py:604
First occurred: 17:55:19 (2 occurrences)
Last logged: 17:55:32

Error setting up entry [redacted] for hive
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 604, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/hive/init.py”, line 87, in async_setup_entry
devices = await hive.session.startSession(hive_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/apyhiveapi/session.py”, line 509, in startSession
return await self.createDevices()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/apyhiveapi/session.py”, line 539, in createDevices
eval(“self.” + code)
File “”, line 1, in
File “/usr/local/lib/python3.12/site-packages/apyhiveapi/session.py”, line 131, in addList
device = self.helper.getDeviceData(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/apyhiveapi/helper/hive_helper.py”, line 98, in getDeviceData
device = self.session.data.devices[product[“props”][“trvs”][0]]
~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

HA Production installation
Logger: homeassistant.config_entries
Source: config_entries.py:604
First occurred: 19:43:35 (3 occurrences)
Last logged: 19:45:02

Error setting up entry [redacted] for hive
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 604, 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.12/site-packages/apyhiveapi/session.py”, line 509, in startSession
return await self.createDevices()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/apyhiveapi/session.py”, line 539, in createDevices
eval(“self.” + code)
File “”, line 1, in
File “/usr/local/lib/python3.12/site-packages/apyhiveapi/session.py”, line 131, in addList
device = self.helper.getDeviceData(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/apyhiveapi/helper/hive_helper.py”, line 98, in getDeviceData
device = self.session.data.devices[product[“props”][“trvs”][0]]
~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

I’m also having this issue!

I just had to delete my Hive integration and reconfigure. Has setup fine, hope it stays that way…

After restarting the integration failed again.

However, the fix by DavidBSteele here worked for me!

I had 5 or 6 Home Assistant entries in as trusted devices. Deleted them all and setup again.

Sadly the issues have returned. Cannot get it to work for anything more than a few seconds. :frowning:

1 Like

Yes, I am having the same problem. It was working fine yesterday, but now it says that it failed to set up. Do you have any ideas?

The issue appears to be when you have an offline or broken device. I’ve submitted a pull request to the Pyhiveapi project that fixes it. Until then the best way to get round is it to contact Hive and get them to remove any broken devices from your account and/or make sure everything is online when you load the integration.

I just tried updating my HA to the latest version and it broke Hive. None of my device on my hive account are offline/broken so it’s not that. When I roll back to HA 8.3 Hive works fine but anything after at hive fails.

@SuperChick3n, I’m so glad I saw this post. I’ve cleared down the 39 extraneous trusted devices from my Hive app (Manage … Account security … Your trusted devices) and have set it all up again. Now it works. How long it works for is the next question. Thanks.