Hive Heating Integration


#1

Hi, I have created a Hive Heating custom component which at the moment will display current information about your Hive Heating and Hot Water:

I was wondering if anyone would be interested in this and could also help with a bit of testing to see if it works on other Hive installations.

Let me know if interested and I will finish tidying up the code.

My plan for the future is to enable controlling the heating and hotwater also.


#2

I have made some nice progress on this and it now monitors the mode and boost for heating and hotwater reliably, all you need to enter in your config file is:

  • platform: hiveheating
    username: YourHiveUserName
    password: YourHivePassword

but I am having difficulty getting to grips with how this should be added to Home Assistant.

If I add it as a sensor then I get all the nice readings from each component and it tracks them very well :

but when I do this then there is only information in the Hive Heating device and no control:

if I add it as climate then none of the information comes through :

but I do get a little more on the Hive Heating device, but still no control:

Is it possible to have one component that is able to add devices for sensors to display and track the various modes / states / temperatures and also add devices for climate to control heating and hotwater?

Is anyone able to help me see where I am going wrong?
Thanks,


#3

I don’t know if you are aware but there is some discussion around Hive integration here.

If you’re looking for people to help testing.


#4

Hi
I have been using my Hive for about 5 months that was written by


It was a bit fun trying to get the ID out of the Hive.

I would love to test your code and see if it works on my Hive version 2.


#5

hiveheating.yaml (48.0 KB)
Hi guys,
Ah, interesting, thanks for link, I thought I had done a full search for Hive here, but it looks like I missed that post, and I guess wasted my time on this.

Nevertheless, I have attached my custom component as it is so far and it would be great if you could try it out.

It contains sensors and a climate device for the thermostat and I have not worked out yet if you can have those in one file so they all integrate in to component, so at the moment if you would like the sensors then copy the file to “/custom_components/sensor” if you would like the thermostat copy to “/custom_components/climate” (you can do both)
the file will also need to be rename to “hiveheating.py

you will then need to add to your configuration file for the thermostat :

climate:
  - platform: hiveheating
    username: YourHiveUserName
    password: YourHivePassword

if you would like the sensors then add :

sensor:
 - platform: hiveheating
   username: YourHiveUserName
   password: YourHivePassword

there are also options for how often it should get new data from the Hive API and which devices to add. if you don’t add the devices option you get all devices, if you add the devices option you then need to include each device you would like added.
I am running with the following configuration, which does mean that it calls the API for more data twice, one for the sensor and one for the climate, until I find a way of integrating them all in to one component :

sensor:
 - platform: hiveheating
   username: YourHiveUserName
   password: YourHivePassword
   minutes_between_updates: 5
   devices:
     - 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

climate:
  - platform: hiveheating
    username: YourHiveUserName
    password: YourHivePassword
    minutes_between_updates: 5
    devices:
     - hive_heating

After adding to a group configuration as below :

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

I get the following in Home Assistant:


Hive Heating UK
#6

Thanks for sharing.

This is fantastic just what i was looking for it works really well.
Thank you.

:grinning:


#7

Glad you like it, and good news that it works on another Hive installation

Thank you very much for testing it :slight_smile:

I am trying to figure out how to enable controlling the Hotwater, do you know what sort of component could be used to add this to Home Assistant? I think it would only need a three state input, Schedule, Manual and Off


#8

Yes I think the hot water has only the three states as British Gas have not yet a remote temperature sensor for the hot water tank.


#9

Cameron, out of interest, how is the temperature selection displayed for my hiveheating component on your Home Assistant installation?

On my HA installation hiveheating temperature selection is an up arrow and down arrow, but in the screenshots in the post where GreenTurtwig shows hit hiveheat component the temperature selection is displayed as a blue slider


#10

No your ok there are Up/Down arrows.


#11

This is excellent thanks for your hard work! I will endeavour to get this into my config this week and replace the existing Hive stuff I have as this is much more detailed.


#12

thanks Cameron, its good that ours are constant, I have no idea how you get target temperature on the blue slider (I have seen only humidity with a blue slider).

gr4z, thanks, i would be interested in how you got on :slight_smile:

I am actively trying to figure out how to get hotwater control in there, as soon as i find out which type of device / component can take three states it wont take long to get it running. at the moment i cant find anywhere a list of all component types and their presentation and capabilities

Also, i have started working on a setup which hopefully when finished will allow only one entry in the config file and one API call to update all data


#13

I decided to just go ahead and add HotWater control as a climate device, it works well but the presentation is not so good :

Does anyone know of a better component / device type other than climate that could present just a three state selection and display current operation (schedule / on / off) as above and maybe instead of current temperature the current state (hotwater on / off)?


#14

Hi

I finally got round to trying this today. This is what I see in my console which doesn’t look right. Any suggestions?

I can’t see any errors in my log.


#15

Hi gr4t,

At the moment the Hive climate controls and the Hive sensor information are two separate integrations that happen to work from the same code, so you need to add things twice, once as a climate custom component and once as a sensor custom component.

  • Copy the file to “/custom_components/sensor” and name the file “hiveheating.py
  • Copy the file to “/custom_components/climate” and name the file “hiveheating.py
  • Add the climate configuration details
climate:
  - platform: hiveheating
    username: YourHiveUserName
    password: YourHivePassword
  • Add the sensor configuration details
sensor:
 - platform: hiveheating
   username: YourHiveUserName
   password: YourHivePassword

To add them to a group you need a mix of the climate device and sensor device.

The configuration I am using is :

sensor:
 - platform: hiveheating
   username: YourHiveUserName
   password: YourHivePassword
   minutes_between_updates: 5
   devices:
     - 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
climate:
  - platform: hiveheating
    username: YourHiveUserName
    password: YourHivePassword
    minutes_between_updates: 5
    devices:
     - hive_heating

The groups configuration I am using is :

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

I am now have hotwater as a climate device so hotwater can be controlled, but the presentation is not that nice as a climate device.
I am also working on moving all this to one integration so it need only be specified once in the configuration file


#16

Hi Rendili,

Thanks for this custom component, after looking at different posts on this blog I managed to work out how to set the sensor and climate up, everything works great. How did you find working with the hive api? I am new to HA and have never worked with api’s before. Do you have any advice or tips for working with the hive api. I would like to create something similar for hive active lights.

Thanks
Khole


#17

Hi Khole,

I am really pleased that this works for you :slight_smile: its difficult to tell how scalable something like this is when you only have one system to test on
I found the Hive API less than obvious in how it hangs together, they don’t really have any single value for example to say the heating is in a certain state, you have to combine a number of attributes from the heating node and check.
I started with writing stuff for the Hive by writing a Windows 10 app to be able to quickly boost the heating / hotwater or increase the temp without having to log on to a phone or website, so to do that I have a windows app which can output the Hive node details repeatedly whilst I changed the state of something, like heating on / off / schedule, or Boost on / off. I then had to compare each snapshot of heating node information to see what was going on so I could reliably get the correct state. I would imagine something similar would have to be done for lights and switches.

I am actually currently working on a new version of my Hive heating Custom Component which will make setting up much easier by having only one section in the config file to add a Hive Platform, it will then detect all the components in Hive that you have and add them. At the moment I am only working on Heating and Hotwater, but it will / should scale up to be able to include all the Hive devices, including plugs, lights, sensors.

I don’t have anything other that Heating and Hotwater, but if you would like to work together somehow on this it would be great to have one Hive custom component to include all aspects of the Hive system

Thanks,
Rendili


#18

Hi Rendili,

I would love to get involved and help in anyway I can, but I am afraid the scripts I have previously wrote are basic windows batch scripts. Building something for lights was going to be a learning curve for me if I was to do it on my own.

My hive setup currently is hive heating without hot water and 1 dimmable hive active light with future prospect of investing in hive door sensors and more lights.

I am happy to do any testing with custom component when you have upgraded it and help in any other way I can.

Khole


#19

Hi Khole,

If you are looking for a challenge and the learning curve in developing the lights, if you would like, I am happy to help where I can from my experience to date in getting the heating and hotwater working. A good start is to read through this page which gives a good start in how to connect and get data out and also to send to the system to make changes (turn the heating to On / Off / Schedule for example).

Or if you prefer we could try and work with you sending me the node data from your hive installation I could try and work on adding the support for the lights and you testing on your system?

Its is entirely up to you, I dont want to railroad you in to a certain direction :slight_smile:
Either way we could add it to what I am working on, if you would like of course.

I am hoping that I will have something I can post shortly for the newer version of my heating and hotwater, should be better as it requires only one entry in the config file to setup and only 1 API call to get new data instead of one per device type (Climate, sensor, lights…)


#20

If anyone is interested in this and is following this, any future posts by me on this topic will be in the original topic