Hive Heating UK

glad to hear it is all working now for you, glad I could help :slight_smile:

just to check, and you could have the device somewhere else or you could have decided not to add it, but in this version you can add “- hive_hotwater” to your config to add hotwater control. you can then add “- climate.hive_hotwater” to your group config

@rendili Yeah, sure thing.

First you’ll have to get token by sending a POST request to https://beekeeper.hivehome.com/1.0/gateway/login with the content type set as application/json (otherwise you get a MALFORMED_REQUEST error) and the username and password in the body: {"username":"[email]","password":"[password]"}. Not going to post the response for privacy purposes :wink:.

Then after that you can request all the products the user owns by sending a GET request to https://beekeeper.hivehome.com/1.0/products with the content type set as application/json again and the authorization header as the token you got from the first request. You should get a list of products they own (heating, hot water, e.t.c) and their individual IDs, schedules, statuses, e.t.c.

You can set modes/temperature of a product by sending a POST request to https://beekeeper.hivehome.com/1.0/nodes/heating/ + the ID of the product. You’ll have to set the content type and authorization headers again, but this time you can send what to set the product to in the body. E.g.: {"mode":"SCHEDULE"} or {"target": 20} or {"target": 22, "mode": "MANUAL"}.

One last thing you can request are all the individual devices (hub, thermostat, boiler controller) by a GET request to https://beekeeper.hivehome.com/1.0/devices, although it’s not that useful, apart from getting the battery percentage from the thermostat.

That should be most of it, just ask if you need help with any of it. :cat2:

1 Like

@Syx All mine does is add the thermostat to Home Assistant with full control e.t.c. it’s entity name should be: climate.hive_thermostat. You can check by going to “States” in the HA dev tools.

Thanks GreenTurtwig. I’m still fairly new to HA so getting to grips with groups and really couldn’t figure out how to get the climate sensor into the same group as the rest so thats very helpful!

I get the following, should you get any more info for the water?

No, that is everything for hotwater.
It would be great if we could change the HotWater device type from a climate to something better suited, but I don’t know Home Assistant enough to know what we could use instead

Hoping GreenTurtwig has some ideas on what component type could be used instead of climate :wink:

thanks @GreenTurtwig I will look in to that
How did you hear about the new API, is this an official one from British gas now?

It’s the one the new web dashboard uses, just sign into Hive on the web and check the traffic. :cat:

No problem :smile:

ah ok I see, thanks
that sort of stuff is beyond me, I need nice documentation :slight_smile:

Heh, I’m still waiting for their official API to come out. Hive have said a few times they will release one, but no news yet… :crying_cat_face:

I have the following script which I use when everyone has left home. It used to turn off the heating:

sequence:
  service: climate.set_operation_mode
  entity_id: climate.hive_heating
  data:
    operation_mode: "off"

It doesn’t do anything now. I can only assume operation_mode doesn’t work with this new hive.py script.

Any idea how to fix as use this daily? Ta

That’s odd, it should still support operation _mode.

If you click on the Hive Heating and then change the Operation drop down menu there, does it change in the Home Assistant GUI and also change if you use the Hive app / web portal?

Also, I don’t know if case matters, but have you tried it with uppercase for “OFF”?
for example:

sequence:
  service: climate.set_operation_mode
  entity_id: climate.hive_heating
  data:
    operation_mode: "OFF"

Under the Developer Tools → States it is listed in uppercase:

I was just wondering also, do you think the Operation Modes should be “SCHEDULE”, “MANUAL” and “OFF” as it shows in the Hive website GUI or “SCHEDULE”, “ON” and “OFF”?

Didn’t think it would be case sensitive, but that seems to have solved it! Changed it:

sequence:
  service: climate.set_operation_mode
  entity_id: climate.hive_heating
  data:
    operation_mode: "OFF"

and when I come back home:

sequence:
  service: climate.set_operation_mode
  entity_id: climate.hive_heating
  data:
    operation_mode: "SCHEDULE"

SCHEDULE, MANUAL and OFF all work. I wouldn’t recommend “SCHEDULE”, “ON” and “OFF”.

Thanks for your help.

Excellent, glad I could help :slight_smile:

just saw your last comment : I will stick to SCHEDULE, MANUAL and OFF then :slight_smile:
Thanks for your feedback, it is appreciated

Hello,

I have made a small update to my Hive custom component to add some more information to some of the sensors when you click on them in the console, such as time since the current state changed.

At the moment I have updated “Hive Heating State”, “Hive HotWater State” and “Hive Target Temperature”. I have not decided on the format of the information and at the moment “Hive Target Temperature” displays two ideas of presenting the information, but the same data:

Any feedback with the format of the time is very much welcomed and also any suggestions for what extra info might be good to include for the different devices.

To update you only need to copy the three files for the new versions below and copy them to the correct locations and file name, overwriting the previous files:

  1. Copy the hive.yaml (49.3 KB) file to “/custom_components/hive.py” taking care to change the file name from hive.yaml to hive.py
  2. Copy the hive_climate.yaml (4.8 KB) file to “/custom_components/climate/hive.py” taking care to change the file name from hive_climate.yaml to hive.py
  3. Copy the hive_sensor.yaml (10.7 KB) file to “/custom_components/sensor/hive.py” taking care to change the file name from hive_sensor.yaml to hive.py
  4. Restart the Home Assistant service

(to install from scratch please follow the original steps but instead use the files in this post)

More updates coming soon for ideas I have already for extra information for other devices :slight_smile:

Hi @rendili. All looks good here

Thanks for continually updating the plugin. It might be better to alter the names at the bottom of the chart as they are truncated and difficult to understand, but that’s just a minor issue.

1 Like

Hi @gr4z,

Unfortunately I don’t think the date / time labels for the chart is anything I have control over, they look to be standard for a lot of the graphs in HA. I think they were a different format a few HA versions ago, and then they changed to what you have in your screenshot.

Hi @rendili

I mentioned on the previous thread about wanting to learn the hive api, python and to attempt to add hive lights to your component. After lots of googling and looking at how your custom component works with HA, i decided to have a go at adding hive lights to HA amending the component you have already created. I have managed to get the hive light to show on the HA front end

currently i can get the state, get the brightness and switch the light off

But i seem to be having issues with switching the light on for some reason the command fails and the brightness slider does not show on the front end.

I know you don’t have any of the lights yourself, but would you mind looking over the changes i have added to your file?. Any advice and ideas you can give about the formatting of the amendments i have made or getting the switch light on command and brightness working would be much appreciated.

Here are the files
Hive_Main.yaml (61.0 KB)
Hive_Lights.yaml (2.4 KB)

Everybody please be aware these files are modified versions of rendili files and my attempt at adding hive active lights to HA. Currently the light functionality is not fully working, please do not use these files until any issues have been corrected

1 Like