Hive Integration

Hello,

I have started a new topic for Hive Integration, as due to the work that @Khole has done with integrating Hive Active Lights we now have a Hive platform which supports Hive heating, hotwater and lights.

@Khole has integrated a light custom component into the Hive platform so that we can now have one platform and configuration to add to your setup which will detect which devices you have in your Hive installation and add them to Home Assistant.

To set this up Home Assistant please follow these steps:

  • Download and copy the hive_main.yaml (57.0 KB) file to “/custom_components/hive.py” taking care to change the file name from hive_main.yaml to hive.py
  • Download and copy the hive_climate.yaml (4.5 KB) file to “/custom_components/climate/hive.py” taking care to change the file name from hive_climate.yaml to hive.py
  • Download and copy the hive_sensor.yaml (11.6 KB) file to “/custom_components/sensor/hive.py” taking care to change the file name from hive_sensor.yaml to hive.py
  • Download and copy the hive_lights.yaml (2.7 KB) file to “/custom_components/light/hive.py” taking care to change the file name from hive_light.yaml to hive.py
  • Add the following to your configuration.yaml
hive:
  username: YourHiveUserName
  password: YourHivePassword

This configuration will then detect and add all your devices. To move these devices to a group you can use a configuration like this one:
> HiveHeating:
> name: Hive Heating
> entities:
> - sensor.hive_heating_mode
> - sensor.hive_heating_boost
> - sensor.hive_heating_state
> - sensor.hive_hot_water_mode
> - sensor.hive_hot_water_boost
> - sensor.hive_hot_water_state
> - sensor.hive_target_temperature
> - sensor.hive_current_temperature
> - sensor.hive_thermostat_battery_level
> - climate.hive_heating
> - climate.hive_hotwater
> - light.hive_active_light

This will add them to a group similar to below:

If you do not want to add all devices that are detected to Home Assistant, you can use the optional “devices” configuration and only include the devices you would like to add.

The below example shows the configuration to add all devices, but you can remove the devices you don’t want:

 hive:
   username: YourHiveUserName
   password: YourHivePassword
   devices:
     - hive_heating
     - hive_hotwater
     - hive_thermostat_batterylevel
     - hive_heating_currenttemperature
     - hive_heating_targettemperature
     - hive_heating_state
     - hive_heating_mode
     - hive_heating_boost
     - hive_hotwater_mode
     - hive_hotwater_state
     - hive_hotwater_boost
     - hive_active_light

At the moment this platform only supports one of each device type, but we are working on adding support for multiple devices of the same type, for example three active lights, or two heating zones. If anyone has multiple devices it would be great to have some people that could help with feedback and testing to assist with developing this.

One last note, from what I gather, Hive have released this now in the US and Canada, the platform as is now may support Hive installations there but as yet is untested. If you are from the US or Canada and have a Hive installation and try this out, please let @Khole or myself no how you get on.

7 Likes

Thanks for the work @rendili and @Khole , have this up and running with no problems with the heating, hot water and an active light showing.

I will say a lot of the code etc is over my head so great to have the simple instructions to follow.

I also have an active warm to white bulb, motion sensor and active plug so if I can offer any assistance let me know, will happily offer any feedback I can.

Thanks for trying this out @morning_call, is everything working ok with the lights no issues switching it on, turning it off and adjusting the brightness?

Just out of curiosity does HA identify the hive warm to white bulb?

Thanks
Khole

No problem.

Everything working ok, on, off and dimming. Don’t see other bulb listed in devices.

Hi @morning_call,
Great news that all is working with the Hive platform :slight_smile:
Thanks for offering to assist with testing and developing further, as you have each type of device this will be really helpful

Do you have one of each bulb or multiple of one out of interest.
I think @Khole that it will only ever see one bulb at the moment as the code will only take the first instance and add to HA regardless of how many it finds (which should be all with that device type)

@morning_call, would it be ok if you send an output from Hive of the nodes you have and send it to me? (I will PM you how if you don’t know)

I have a active dimmable and a cool/warm bulb plus one motion sensor and one plug, trying them out before deciding to add to it.

Hi guys! Amazing work here. I have been waiting for someone to attempt the Hive integration.

I have multiple bulbs, motion detectors and smart plugs.

It would be the icing on my home automation cake to have Hive integration fully working.

Let me know if I can be of any assistance, any logs etc, I’m more than happy to input.

Regards

@morning_call, thanks for confirming what you have, it will be good to test the different types.

@benhuson1 thanks for trying it out, it would be great to have a second person on board to provide some Hive data and test stuff out, thank you. I will send you a PM

No problem.

You should have got a pm with some data.

yes, thank you :slight_smile:

Hi,

I’ve got 2 x Hive Active Light Dimmable and 1 x Motion Sensor alongside the Hive Heating, I’ll happily send anything across if you send me a PM. I’d like to get them showing up in HA

Hi @Craig86

Thanks for the offer to help.

We are in the testing phase for releasing a new version which includes support for multiple dimmable and cool/warm lights, which I am hoping I can post in next day.

After this we will be working on plugs and sensors, but I am not sure the sensors will be that useful in Home Assistant, as the sensors push a trigger to Hive which can make something happen in the Hive system, whereas with the Home Assistant custom component we are pulling information from the API every minute or two.

Having another output for the sensor data will help in seeing how much we can integrate it and use in HA, I will PM you when I get on to writing for the sensor, thank you

Thanks Rendii, looking forward to the new release :slight_smile:

I know what you mean about the motion sensors, it might be useful to get last movement etc for time delayed automation or similar.

@Craig86, I will see what information I can get out of the sensor data, but so far it has not looked too promising to be honest, only battery level is obvious.

Sorry for the delay in releasing the new version, there were a couple of last minute bugs that I needed to fix

We have a new version of the Hive Integration, thanks to @morning_call and @benhuson1 for providing some Hive data and testing the new code and for the development by @Khole on the Light devices.

The new version will add all detected lights and supports the Hive lights “Dimmable” & “Cool to Warm White” lights at the moment.
If anyone has a “Colour Changing” light it will be added but as a “Dimmable” light. If you would like to try and help as enable full support for the “Colour Changing” light, then please let me or @Khole know.

The new files are below, please download all four files as something has (probably) changed in each one, then copy them to the relevant location (as detailed at the beginning of this topic) and rename to hive.py:

hive_climate.yaml (4.5 KB)
hive_light.yaml (4.9 KB)
hive_sensor.yaml (13.9 KB)
hive_main.yaml (82.0 KB)

Cheers guys, it’s picked up my lights and working fine however it seems to have broken the thermostat component (It reads what I presume is the current temp but I’m unable to change the temp or anything

Log:

2017-05-27 20:57:40 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 239, in _step
result = coro.send(None)
File “/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py”, line 361, in async_process_entity
new_entity, self, update_before_add=update_before_add
File “/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py”, line 217, in async_add_entity
yield from entity.async_update_ha_state()
File “/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity.py”, line 239, in async_update_ha_state
state = self.state
File “/root/.homeassistant/custom_components/sensor/hive.py”, line 190, in state
return self.HiveObjects.Get_Heating_Mode()
File “/root/.homeassistant/custom_components/hive.py”, line 1313, in Get_Heating_Mode
return Private_Get_Heating_Mode()
File “/root/.homeassistant/custom_components/hive.py”, line 343, in Private_Get_Heating_Mode
if HiveSession_Current.Nodes.Heating[0][“features”][“heating_thermostat_v1”][“operatingMode”][“targetValue”] == “SCHEDULE” and HiveSession_Current.Nodes.Heating[0][“features”][“heating_thermostat_v1”][“operatingMode”][“displayValue”] == “MANUAL”:

Hi @Craig86,
This is behaving oddly on my setup tonight now also, for me it is not returning the expected value for target temperature, but it is changing modes ok.
Is there any more of the error log? it looks like there should be a little bit more output saying what the error in that bit of code is

thanks

Hi @Craig86

I don’t know if the Hive people were updating the Hive system yesterday, but my HA Hive integration is functioning as expected today, are you still getting that error?

Hi @rendili

I had major issues relating to an external homebridge killing my HA last night (Although I didn’t know what until I’d rebuilt HA!)

I’m still seeing the errors in the log (I’ll PM you the full log) it looks like it’s just taken out the ability to set the heating levels but is still pulling the data. On the plus side both my active lights work fine :slight_smile:

Hi @Craig86 good news on the lights :slight_smile:

I sent you a PM regarding the heating.
Were you getting this error on changing the Heating Mode, Heating Temperature or Hotwater Mode?