roadsnail / Hive-SLR2-SLT2-Zigbee2MQTT-with-node-RED

Exploration of Hive Active SLR2/SLT2/SLT3 integration (without Centrica cloud) using node-RED, Zigbee2MQTT and Domoticz
GNU General Public License v3.0
1 stars 1 forks source link

Hotwater boost / emergency_heating functionality #2

Closed russdan closed 3 years ago

russdan commented 3 years ago

Hi @roadsnail thanks for your awesome work so far, I've used your groundwork to update my own code to get Hive running via Zigbee2MQTT and your write up really helped with that. I found that the hotwater boost (top left button on SLT3 + tick) can be emulated also with the following code:

        msg = json.dumps({"temperature_setpoint_hold_duration": duration})
        client.publish('zigbee2mqtt/Hive Controller/water/set', '{"system_mode": "emergency_heating"}')
        client.publish('zigbee2mqtt/Hive Controller/water/set', msg)
        client.publish('zigbee2mqtt/Hive Controller/water/get', '{"system_mode": ""}')
        client.publish('zigbee2mqtt/Hive Controller/water/set', '{"temperature_setpoint_hold": true}')

Set duration in minutes - this can be as little as 1 minute (instead of Hive's minimum of 30 mins if done via the SLT3).

I have my hotwater tank hooked up to a Pi Zero W with 8x DS1820 one-wire temp sensors, using an idea originally in Hackspace magazine https://hackspace.raspberrypi.org/issues/4/pdf - I modified the Hackspace code to push status (temp/water level) via MQTT to Domoticz and a few other improvements and it automatically boosts my Hive hotwater based on the water level/temperature in the tank so (in theory) there's always the "right" level of hotwater in the tank...

An observation is I think the client.publish('zigbee2mqtt/Hive Controller/water/get', '{"system_mode": ""}') may be unnecessary as my hotwater system starts up following the {"temperature_setpoint_hold": true}if I omit the /get command, but obviously its a trivial overhead to include the /get.

roadsnail commented 3 years ago

Hi, and thanks for the feedback on my experimentation. I'm glad it kickstarted your particular Hot Water project.

It's interesting that you have explored further the "temperature_setpoint_hold_duration_heat": and "temperature_setpoint_hold_duration_water": topics to control HW boost. I didn't explore these as I aimed to effectively switch the HW and CH relays on/off and leave boost functions to my Home Automation software (in my case Domoticz).

Also, I have achieved my other aim of breaking away from reliance on British Gas' cloud servers. My HW/CH has worked with hardly a single issue since January and no more worries that the unofficial BG APIs would change without notice! Also moving to a more powerful Zigbee USB controller has worked miracles for the speed and reliability of my Zigbee network.

Also, I did expand on this as a basis for my Pi Zero W controlled SLR/SLT project with Node-RED dashboard, MQTT and HTTP controls including a boost function (coded in node-RED). See https://github.com/roadsnail/Pi-ve

I take your point regarding a possibly superfluous /get. I may take a look at it myself and modify the node-RED flow, time permitting. But as you say, it does no harm.

I'll add your comments to my main README as an update if that is okay with you (with attribution of course). Let me know.

russdan commented 3 years ago

The nice thing about using the "emergency heating" function is the remaining time shows on the SLT3 (as it would if initiated by the SLT3 itself). Like you I initially coded a timer function to switch on, wait x minutes then switch off, but I then saw the emergency heating commands in the zigbee2mqtt log and used those instead. I think the same will work for heat as well as water but I don't use that functionality personally so haven't tried!

Love the Pi-ve node-red dashboard - I work with one of the creators of node-red so great to see it being used here :)

Like you I'm using Domoticz - I've integrated reading CH/HW relay status (on/off/boost) at present just using a dummy switch (and my backend python code running as a service to poll mqtt and update switch status) - next is enabling control of the CH/HW relays / temp setpoints from Domoticz which should be pretty straighforward. Would like to write a Domoticz plug-in to do all that, if I ever find/make the time!

Again, thanks for your 2 projects - since switching to zigbee2mqtt I saw that the SLR/SLT stuff could be added and wanted to do that so took the plunge a couple of months back as I was fed up of the random changes which BG make to the API which as you say could change at any time, and your experiments were a really big help - I just need to de-register Hive now to remove that data trail..... I'm using a TI LAUNCHXL-CC26X2R1 board which as you established is one of a class of controllers way above the CC2531-based boards....

Thanks again and awesome work :)

roadsnail commented 3 years ago

@russdan

It appears we have followed similar routes with our Domoticz evolution :)

A Domoticz plugin would be good, but I make do with MQTT and handling it in dzVents. Maybe one day, if time permits...

I feel a bit of a fraud really with my stuff here. It's all built on fantastic work from Koenkk and the Node-RED developers, so I guess I have to admit to standing on the shoulders of giants as Newton once remarked... I have found Node-RED to be fun once I was able to get my head around it. It enables some really quick prototype flows to be knocked up. Proper Node-RED coders may wince though at my attempts, but hey-ho, it gets the job done :)

If I can find time, I may check out the boost CH "emergency heating" and check it also works on the older SLT2 thermostat. My guess is it should but maybe worth checking.

Thanks again for your feedback and I'll add a link to your feedback in the main README. Cheers!