Hive Integration

Whoops, typo. I do mean 2021.3.1 and I went through the uninstall - reboot etc as mentioned in my post because it was flagged as ‘breaking’.

Sorry for the confusion.

@PanMan

Yes a uninstall of the component and reboot won’t do it you needs to go into the integrations page within home assistant configuration (Not HACS) and delete the hive integration and then set it back up

1 Like

Thank you, you are wonderful!! Yes, just needed me to uninstall from HA as well. 2FA working too.

Again, many thanks for your patience and brilliant work.

Can someone help, please?

I’ve tried everything that’s been mentioned recently in here but still not working. It started with “Unavailable” so uninstalled everything, rebooted, added latest version (2021.3.1) in HACS, added the integration in HA, signed in with an account that doesn’t have 2FA enabled (worked before) but nothing is getting discovered. Have checked for any left over devices/entities after the removal but there was none.

EDIT: Hmm tried the 2FA account and without asking for anything more than the username and password all 7 devices were pulled in.

I’m new to Home Assistant and loving it but I just can’t for the life of me get the Hive integration working.

I’ve added
hive:
username:
password:

into my configuration.yaml, confirmed it validates but I don’t see anything following a restart. I’ve tried this on the core and standalone versions (both 20210302.6) and I can’t see anything.
The error is showing this:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/usr/src/homeassistant/homeassistant/components/hive/__init__.py", line 113, in async_setup
config["username"] = config[DOMAIN][CONF_USERNAME]
KeyError: 'hive'

I even tried hardwiring the username and password into the python file but that just gives this error:

`Traceback (most recent call last):`
`  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/setup.py", line 213, in ``_async_setup_component`
`    result = await task`
`  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/hive/__init__.py", `line 120, in async_setup`
`    devices = await hive.session.startSession(config)`
`  File "/srv/homeassistant/lib/python3.8/site-packages/pyhiveapi/session.py", line 203, in startSession`
`    await self.logger.checkDebugging(config["options"].get("debug", []))`
`KeyError: 'options'`

I must be doing some stupid but I can't just see it. I've tried lots of other things that are probably not relevant but hopefully the errors above will cast some light on it.

Would anyone be able to help me out of my misery?

Thanks.

Are you using the integration from the official release of home assistant as this has been broken due to a change hive made in there auth. The 2021.4.0 release will fix this.

There is a custom component if you are familiar with them that can be used temporarily in until 2021.4.0 is officially released next week.

I’m just using the official one.

Thanks for your reply. I’m happy to stick with that one if the new release will be out next week.

I’m so glad it wasn’t me doing something stupid!

Just removed hive and re-added (all via HACS) to get past the breaking change. All working fine but any ideas why I’m seeing the target and current temperatures twice ?

Looking at the data it’s not plotting any data for the last 2.

If you find the last 2 entities and delete them as I think they are hang round from the previous setup but will have a state as unavailable.

If I select “Thermostat 1 current temperature” the red line vanishes and I see an identical blue line below it so it is plotting both. Same for the target temperature. There are no additional entities that I can find. I made sure all “Hive” entities had gone after removing Hive and restarting. I’ve also checked core.entity_registry and only found single entries.

I can see 2021.4.0 on the github but no option to install yet?

Do none of the other versions even from here: https://github.com/Pyhive/HA-Hive-Custom-Component work yet?

The latest custom component version works but 2021.4 will be officially released tonight.

Just tried 2021.4. I removed the ‘hive’ setting from the configuration.xml that I’d failed to get working with 2021.3 and added it via Integrations/Add Integration.
After I enter my username/password I get ‘Unknown Error Occurred’.
In my home assistant log file I get

2021-04-07 20:11:41 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 129, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 107, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 156, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 214, in _async_handle_step
    result: dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 49, in async_step_user
    self.tokens = await self.hive_auth.login()
  File "/usr/local/lib/python3.8/site-packages/apyhiveapi/api/hive_auth_async.py", line 224, in login
    response = await self.loop.run_in_executor(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)

I have the same issue as @robbobkirk

Submitted here -

1 Like

Sorry if I missed this but should we remove the hive custom component install before switching over to the new 2021.4 official ?

Thanks

Make sure you remove the integration as well as the hive folder under custom_components (I don’t use HACS, I manually installed it, hence had to remove manually). Reboot after that and install the integration via the UI. I just did that and it worked.

1 Like

Cheers for the reply. I’ve never had Hive working or HACS installed (although seems like I might as well at this point) so I don’t have a custom_components folder anywhere that I can see?

I think something else is going on with the new integration :frowning:

I have got HACS installed but never installed the Hive custom component. I’ve checked in the customer_components folder and can’t see anything Hive related.

Hi all

I wanted to summarise the issue in which was an edge case missed.

Home Assistant official integrations and home assistant custom version act differently.

The official version installs all integration dependencies up front when you upgrade home assistant.

The custom component version installs dependencies when you setup the integration for the first time.

Because there are other integrations which use a dependency called boto3 (used to communicate with aws) and the hive integration dependency pyhiveapi also uses boto3.

The other integrations use an older version of boto3 unlike pyhiveapi which uses a newer one for hive authentication.

This creates a conflict when upgrading to home assistant 2021.4.0 and the older version of boto3 is winning which causes hive to break.

For people who have used the custom component version migrating to the official version, this isn’t a problem as the custom component installed the correct version of boto3 after the upgrade completed.

I am currently trying to work out how this dependency conflict can be fixed.

I hope this makes sense

4 Likes

UPDATE

It looks like the Home Assistant team are already investigating this and a PR has been created for anyone who wants to follow it. I believe that once this PR is merged and released it will address the problem from 2021.4.0

1 Like