Boiler control from MAX! Cube to Drayton Boiler via Raspberry Pi/Vera/Mysensors.
-
Registered just to post that this is fantastic, I'm only doing research at the moment, but this is exactly what I want to do, so thanks for sharing.
A question for the people who've purchased the radiator valves, which ones did you get? I see on the Conrad electronics page there are 3 (http://www.conrad-electronic.co.uk/ce/en/overview/0812043/MAX-Wireless-Heating-Control)
As far as I can see, the 2 non-plus versions offer the same functionality, but are physically different, while the plus version offers something more? What's the differnce between all of these?
-
@lhw455 As far as I know the new version of this radiator valve has a new design (that one that is available a '+' version). The old ones have the longer, more diagonal design.
The difference between plus and nonplus depends on how you want to use. The normal can only be programmed by wall mount thermostat or cube. You can only set actual setpoint the the valve, but no schedule.
The plus version can be programmed at the valve (if used alone), but more comfortable with wall mount thermostat or cube. I also read somewhere that this can be secured with keycode, so children/... can not change settings, but don't know that for sure. -
@stephenmhall Thanks for this, I found it really interesting, and whilst I'm not (yet) planning to control my CH in a similar way, I took the liberty of adapting your graphing.py script to graph a number of temperatures from my Domoticz controller (similar to your examples). I'm not using a database, but I'm writing values to a .csv file every 10 minutes, creating a new file every day. My version of the script then creates an html file, which produces a webpage like that below.

I've done a few tweaks, by following the Google Charts documentation. I prefer Google Charts, as you get 'live' tooltips and can combine several data series (as with plotly), but unlike plotly you create a local webpage rather than uploading / streaming.
(Sorry if this is a bit off-topic.)
-
nice, I need to rework my time plot more like yours, mine is just plotting the times as text points so if there are gaps in the data it just ignores them, I need to convert to a proper time field I think.
Just to update, my system isn't working too bad, I did have a problem with the cube last weekend, all of a sudden it was just empty, no attached devices. I had to re pair everything. Also I occasionally get the set points jumping to the open widow temp even though I have no window sensors although that seems to have gone since the rebuild. What replaced it after the rebuild was a couple of the valves picking seemingly random set points at the time of a change, hitting AUTO again would apply the correct temp. I have removed the bedroom 1 valve and wall thermostat and factory reset them before re adding them to see if that helps.
What I haven't managed to get working yet is sending messages to the cube, I have a test script to set a valve/Thermostat to Manual - at a lower temp but I have been unable to get it working. probably my conversion from openhab's Java to Ptyhon that is the problem.
-
Finally sorted out the Max send command, it was the base64encode function of Python giving a different encoding . So now I can set mode and temperature via the web UI. I have not implemented the Auto/eco/comfort buttons at the top yet as I am not sure if it's a single command or you have to send for each rfAddress separately. Next update probably.

I seem to have fixed the random temperature changes by factory resetting and re-adding some of the valves and wall thermostats, no random changes seen lately.
-
Hi, This is all very interesting. I bought the MAX! System 2 months ago and only one thing is missing is to control my boiler when there is no heating demand from my zones. What do I need to do to make it all work and is there any way I can access your system to control it ? What do I need to buy to make it all work like you have, please?
-
The eco auto message is the one I have yet to find as well. I wondered if pressing it while the MAX software is connected would save a copy of the message in the logs
-
I read few documentation and finnaly I manage to post something that is understood by the Cube. I got short python3 script
import socket import binascii def getBits(value): return "{0:b}".format(value) def toHex(value): return hex(int(value,2)) def get_S_String(rfAddress, roomId, temp=None, mode=None): if temp: msgH = toHex(getBits(int(int(temp) * 2)))[2:] else: msgH = mode cmdStr = "00 04 40 00 00 00 " + rfAddress.lower() + " " + roomId + " " + msgH base = binascii.b2a_base64(binascii.unhexlify(cmdStr.replace(" ",""))) return "s:" + base.decode() + "\r\n" def send_raw_data(host, port, data): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) s.settimeout(2) return s.send(data.encode()) host = "10.0.0.110" port = 62910 address = "12E023" room = "02" address = "126010" room = "01" temp = "14" ## auto MODE x = get_S_String(address, room, mode="00") print(x) ## setup MANUAL temp #x = get_S_String(address, room, temp) #print(x) send_raw_data(host, port, x) -
Stephen the work you have done is fantastic !
This is very useful for everybody using a MAX! Cube, regardless of the Vera. As you can read in the comments (and on other sites) the main missing feature with the MAX! Cube is a direct link with the boiler, in order to have the boiler running only when at least one valve requires it.
I strongly suggest you to work in this direction, and provide example on how to switch on/off the boiler from the Raspberry Pi directly (either wired or wireless link) when needed.
Also, you instructions in installation.txt worked fine for me but it took me a while to find them and "decode" them. First I would suggest to explicitly point to that file from README.md and second to explain what's the NeoPixel thing. I still don't know, I just assumed it could work without it but I wonder what it is.For those of you still wonder whether the MAX! Cube is worth its money: yes yes yes! I've never found such a good solution for that price! It gave me all I need and, with Stephen's code, it's more than I can dream of.
-
Hi, This is all very interesting. I bought the MAX! System 2 months ago and only one thing is missing is to control my boiler when there is no heating demand from my zones. What do I need to do to make it all work and is there any way I can access your system to control it ? What do I need to buy to make it all work like you have, please?
@Lawrence-Helm they are not noisy to me but you can hear them if there's silence in the house. Noise it's very subjective of course. It sounds like a small motor turning for say 3 or 4 seconds. Once a week when they run the de-scale program, but you can set it at any point in the week. At that time they make the same noise, but for a longer time.
-
Hi, This is all very interesting. I bought the MAX! System 2 months ago and only one thing is missing is to control my boiler when there is no heating demand from my zones. What do I need to do to make it all work and is there any way I can access your system to control it ? What do I need to buy to make it all work like you have, please?
@sebgudek
At the very minimum you need to buy a Raspberry Pi (around £ 30 ), a charger and an SD card and follow the instructions on www.raspberrypi.org/downloads/ to install Raspbian on the Raspberry PI, then follow Stephen's instructions on the file installation.txt:
https://github.com/stephenmhall/PiHeating/blob/master/PiHeating/src/heating/installation.txtYou need to know a little bit how to work on Linux do to so. If you have even a very limited linux experience, the instructions are enough, although they are very very condensed.
When the code is running you can control it simply with a browser within the same network, again this is explained in installation.txt . It is in fact nicer (and easier) to use this interface than the MAX! Cube application, although they are not exactly the same thing and you still need the official application (I believe) to set the weekly program and other things.
-
Thanks for all that @p_battino , Any recent updates have been in the Neopixel branch rather than the master, I have added direct relay support in that branch for those with no Vera. The main changes have been to change the local display from individual led's to a neopixel ring controlled by a WeMos D1 mini ESP2866 board. I only use the serial and I2C connections on the GPIO to talk to the ESP and an I2C real time clock board (which is not necessary if the RPi can see the interwebs ) All the buttons and outputs are done by the ESP. The neopixel Libraries are much better for the Arduino based boards.
I will post some pictures when I remember how to do that :(
ah got it :)
The connector by the WeMos is for the Relay.


-
Thanks for all that @p_battino , Any recent updates have been in the Neopixel branch rather than the master, I have added direct relay support in that branch for those with no Vera. The main changes have been to change the local display from individual led's to a neopixel ring controlled by a WeMos D1 mini ESP2866 board. I only use the serial and I2C connections on the GPIO to talk to the ESP and an I2C real time clock board (which is not necessary if the RPi can see the interwebs ) All the buttons and outputs are done by the ESP. The neopixel Libraries are much better for the Arduino based boards.
I will post some pictures when I remember how to do that :(
ah got it :)
The connector by the WeMos is for the Relay.


@stephenmhall what I still don't get is the purpose of the Neopixel ! what's for? what are you displaying with that led wheel?
-
North is Boiler function On/Off, East is Max Cube state, West is Vera state, South is heating normal/On/Off. The others are a Red-Heating on, Blue Heating off heartbeat.
An update to the Mk1 version. as in this link
-
So, I finally got most of my bits and I have this up and running. This is quite simply awesome, but tbh I am now looking to see if there is some way to get this into node-red. I could be wrong but I am starting to see my home automation fracture into multiple different systems and my original plan was to try and keep everything to one interface where possible. Therefore I am starting to see node-red as maybe being my glue between each of them, the benefit of this is I might be able to drag in emoncms and better data analysis.
-
@twisted Glad to be of service :) I was unaware of node-red before your post, It may have brushed past my awareness but not stuck. I don't see why you could not use it if you can create decoders for the MAX messages as the Cube is happy to spit out data all day. How are you physically switching your boiler?
-
THANK YOU THANK YOU THANK YOU!
I've got a system running that does exactly what you've got here, but I've not had time to finish it up, make it pretty and write the web interface. THANK YOU!
:satisfied: