Hive Integration

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

Thanks for the update. I look forward to hearing if there is something I can do temporarily rather than waiting for the next formal release.

It sounds like you are saying that AWS have made breaking changes to the boto3 library stopping the other integrations moving to it which seems poor. I’m actually an AWS Solution Architect so this is actually surprising to me.

I don’t think it’s aws that made the breaking change it was more that they introduced new functionality in the later version that hive needs that doesn’t exist in the older version.

The problem that has occurred is that the other integration within home assistant route53 and Amazon polly were developed using this older version. As I only do development for the hive integration I wasn’t aware of this conflict.

The reason this issue wasn’t identified in development was because I developed and released the custom component version first as this is the quickest way of getting people up and running again after hive moved there authentication model to aws.

On the back of that as I mentioned in the previous post because I had already ran the custom component version I didn’t see this issue as the custom component resolved the conflict.

With regards to getting up and running before the next official release. Tomorrow I we be creating a new version of the custom component which you can use.

Are you familiar with how to install custom components?

I am using the custom component successfully and have not yet upgraded to 2021.4. I’m not clear from this discussion whether it is ok to go ahead with the 2021.4 upgrade. Will it break the custom component? Or should I wait for the next point release?

What I meant was why the other components couldn’t use the newer version of boto3 if the library is backward compatible?

I’ve not installed a custom component before but I’m sure I can work it out if you point me to a link.

Thanks for doing this.

@perjury1 your are fine to upgrade to 2021.4.0 with the custom component installed. This issue is for users who don’t use the custom component and want to use the offical integration on 2021.4.0

1 Like

@Khole If we have the latest custom component installed then upgrade our HA to 2021.4.X will this automatically switch us from the custom component of hive to hive official version ?

Or do we still need to delete the custom component then install hive official via the integrations page ?

Thanks and sorry for all the questions !