Hive Integration

fixed my issue

Hi there - I have Hive Colour change bulbs - and I’m able to change their colour. However, if I try to set up a scene with a bulb of a certain colour, it doesn’t ‘save’ the colour setting. For example, if I then set up another scene with the same bulb set to a different colour, all scenes then become that colour…

It’s like the ‘colour’ is being saved globally rather than against the scene. Are you able to help?

I’m running Home Assistant 2022.3.1 if that is useful to know!

Hi there, I’m just starting my HA journey and had some great early success with a few ZigBee sensors, Hue and Hive etc. When I’ve tried to extend with my first attempts at automations I’ve hit a problem with the Hive Door sensors.
The Hive Door sensors don’t seem to report their state reliably in HA, particularly for short open and close events. Looking at the state attributes of the entities, the Hive sensors (still connected to Hive Hub and using that integration) have an extra line that the Aqara ones (ZHA connected) don’t, “mode: null”

mode: null
device_class: door
icon: mdi:door
friendly_name: binary_sensor.front-door

If I remove that mode: null line they appear to report state much more dynamically, or am I barking up the wrong tree here? A day later the mode null line as reappeared in the entity state attributes…

I gave up on this, and just removed the Hive Door Sensors from Hive, and added them natively to ZHA as Zigbee devices. They’re much more responsive now. They show up as WDS00140002 by AlertMe.com

Maybe it was a polling time thing relating to the Hive integration?

Anyone else have trouble with give working for an hour or so then not? I’ve removed everything in both integrations and HACS and reinstalled. It always works at first but then get http token errors.

There’s an issue with a Hive Authentication chsnge.

See here

1 Like

Thank you for this.

Trying to setup the official hive app and I am getting “unknow error” when putting in the 2fa code. Here is the error from the log. Any ideas ? thanks

Logger: aiohttp.server
Source: components/hive/config_flow.py:108
First occurred: 6:45:51 AM (2 occurrences)
Last logged: 6:46:20 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 220, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 205, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 335, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 93, in async_step_2fa
    return await self.async_setup_hive_entry()
  File "/usr/src/homeassistant/homeassistant/components/hive/config_flow.py", line 108, in async_setup_hive_entry
    await self.hive_auth.device_registration("Home Assistant")
AttributeError: 'HiveAuthAsync' object has no attribute 'device_registration'

Fixed with upgrade to 6.6 ^

I’ve had issues with Hive being unavailable, I’m in UK, not using 2FA on the hive account. Last known working in Core 2022.5.4. Restoring backup of 5.4 resolves. The issue in logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/hive/__init__.py", line 89, in async_setup_entry
    devices = await hive.session.startSession(hive_config)
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 493, in startSession
    await self.getDevices("No_ID")
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 416, in getDevices
    await self.hiveRefreshTokens()
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/session.py", line 303, in hiveRefreshTokens
    result = await self.auth.refreshToken(
  File "/usr/local/lib/python3.9/site-packages/apyhiveapi/api/hive_auth_async.py", line 544, in refreshToken
    result = await self.loop.run_in_executor(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 391, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 691, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 739, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "/usr/local/lib/python3.9/site-packages/botocore/validate.py", line 360, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter AuthParameters, value: ({'REFRESH_TOKEN': 'eyJjds...snipped...MT8A'},), type: <class 'tuple'>, valid types: <class 'dict'>

I’ve snipped the refresh token as it is huge, but the the class being tuple not dict is the thing, I’m afraid I don’t have any insight into why my hive setup is causing this, I’m happy to help provide any info to get this working as it’s a big part of my home assistant!

1 Like

@nochanceofmeatballs a fix went into 2022.6.6 for this. If your still using the custom component then I am planning on getting around to updating this today as it uses the wrong version of the library

3 Likes

Thank you, I had been messing with enabling/disabling and restoring backups, etc. But I needed to delete Hive, upgraded to 6.6 then installed Hive from fresh, it is now working. Apologies! And thank you for all the work you put in.

Hi, when will the 2022.6.1 version of the custom component hit HACS ?

Thanks

@Holdestmade that should be available now

Brilliant, thanks. Do I need to uninstall the old one and restart and install this new one as with the official one ?

You will need to yes

All done and working fine, many thanks

A (hopefully) little bit of help please before I mess everything up.
I’m running HA 2022.6.6 with Hive custom component 2021.5.4 (via HACS) but currently WITHOUT 2FA

What do I need to do to keep this setup (and Alexa if anyone knows !) working after enabling 2FA in the Hive app ?
I’m wanting to do this since trying to upgrade Hive 2022.6.1 this morning which broke my setup, restoring, then reading above that I now need to use 2FA with HA 2022.6.6 (even though mine IS currently working).
A simple step by step checklist would be very much appreciated.
Thank you in advance, and many thanks to all who keep this great integration running, especially @Khole

I was in same position. Just enable 2fa, remove the integration, restart and then re add the integration.

1 Like

I am using 2fa, removing integration, restarting and re-adding is not working for me. What am I missing?