Boiler control from MAX! Cube to Drayton Boiler via Raspberry Pi/Vera/Mysensors.



  • Hi Guys. A rather specific project that may not be much use to many others but maybe of interest if you are looking for individual radiator heater control.

    I tried the Stella-Z radiator controllers with Vera and in all honesty they were crap, they talk to the system only rarely and they only hold one setpoint at a time, all in all no good.

    So I ended up getting a full set of the eq-3 MAX! kit with 7 radiator controllers, 3 wall thermostats an eco button and the central Cube controller. Apart from the supplied software being a little annoying with it sometimes messing with the heating times it is great. I solved the software problem in the app store with MAX! Remote unofficial replacement software, very good. The only problem I was left with was my Boiler.

    British Gas Boiler fitted with a single wireless wall thermostat in the living room. I had already upgraded the simple thermostat to a Drayton +3RF giving me daily timings but it still just took the one temperature. The problem being if the temp was up in the living room at night the heat would go off and the bedrooms would not heat up for going to bed.

    So to my solution. I already have a Vera automation controller and Mysensors nodes, so I now have a Raspberry Pi that polls the Cube to get all the valve open percentages if it decides the boiler needs to be on it sends a message to the Vera which transmits out on a Mysensors 433Mhz transmitter node to turn the boiler on. The Rpi has a web interface accessible in the house so I can see current temps and boiler state and also a graph of past temps for each room. I hope to implement the Cube controls in the web interface eventually so I don't need 2 pieces of software.

    Web UI
    2015-11-29.png

    Graph
    2015-11-29 (1).png

    Rpi2 very stock and I code in Python
    Heating Pi2.jpg

    And Finally the Mysensor Board, Just done today, has been running on a breadboard until now.
    heating_Mysensor.jpg

    It still needs a box printing.

    I could wire the RPi into the boiler switch direct but I want to have the old Thermostat as backup just in case.

    So if you have a Vera and MAX! radiator valves and an Rpi and a Drayton controlled Boiler, this is for you :)

    If anyone is interested I will post the code. It is very much my code as in an actual Python developer would go "What the!!" but it works. So far.



  • @stephenmhall Wow, wow, wow.

    So you may have just solved my issue with heating controls. I have been evaluating a number of heating solutions and somehow the MAX! slipped by. Although without your work here I'm not sure I would have the ability to get this far. I was sat patiently waiting (IIRC last summer) for heat genius to make their API available, but even then the cost was very high and would mean me doubling up on some sensors around the house.
    I would be over the moon if you were happy to share your work here, as I am tempted to buy a set to get me started tonight although I may just wait for your reply in case you have any suggestions. (btw I'm in the UK).

    I will wait excitedly for more info. thank you.



  • Hey twisted,

    More than happy to help, how close to my system is yours? Boiler switching method, Vera etc, I realise this is the Mysensors forum and I am using that for my switching but it could be switched direct from the Pi with a relay if nesesary, we just wont mention that to the moderators :smirk:

    I got all my MAX! stuff from http://www.conrad-electronic.co.uk/ I think they are the only distributor. Nearly everything came in a few days. I started off with a cube, 3 radiator valves and 2 wall thermostats. I have a mix of the + Valve and the standard, I was going to try the cheap one but they were out of stock. They are quite bulky compared to a standard thermostat and my plumbing was not great so some ended up mounted facing the wall to clear skirting and pipes but it's not an issue if you are using the software to adjust them. They come with mountings for 3 or so different fittings.

    I got all the details to interface with the cube at Github Max_Cube_protocol

    And the vera supports sending in commands to activate switches. Found that in their documentation.

    The 433Mhz Mysensor node just uses the cheapo Tx units off fleabay.

    I will post all the code to github when I work out how to use it :)

    This is definitely a work in progress, butt seems to be working fine so far.



  • Ok Sort of got my head around Github Here is the first upload

    https://github.com/stephenmhall/PiHeating

    Started a new Repository, the original got confused, or I did.



  • My system is not that close, but I am in the process of getting the eq-3 ordered from conrad. I am planning on the following:
    A cube gateway
    Start with 7 thermostat heads (non +)
    Not sure if I need the wall mount thermostats as they don't look wife friendly and was thinking about putting a mysensors temp sensor in each room.

    I held off getting a device to switch my heating and water as I wasn't sure the best route, so far I have considered:
    Secure dual channel zwave.
    fibaro dual relay
    custom home made.

    I liked the idea of the horst dual channel as it automatically shuts down if the signal controlling it doesn't 'phone home' every, IIRC 20min.
    Still not sure though as I need something bullet proof to make it wife friendly.

    Thanks for the posting of you work I am just trying to go through it now.



  • Just a question, are the eq-3 radiator valves quiet? As I have a wood burner and my thought was ramp up the heat when the fire is lit, but then once the rooms are at temperature, close the valves to minimum to keep the fire going for as long as possible, this is usually when we are sleeping :)



  • Lawrence, 6 out of 7 are quiet. One sounds like a World War 2 tank, But I have it in the bathroom, I am not sure if it was the fitting that caused the noise as it was a tight fit between the valve and the wall to get it on i.e. some amount of forced contact was made during installation. It seems to work OK.



  • @twisted I would prefer wall thermostats everywhere if possible as you get a live temperature to 0.1 deg. The radiator valves report temps when they open and close, at that point they know what temperature they are at. Plus you can get the thermostat where you are looking for the heat to be. I think they would be wife usable as my 75 year old Dad can work them. I have them set to show the actual temp, a push of either + or - will show the set temp and further pushes change it. The Boost gives you 5 mins of 80% valve. The sun and moon jump to pre-set comfort and eco temps and the menu/mode goes between auto/manual/holiday set points.

    Pretty much if you keep it on auto and use + and - you cant go wrong. You can change the current auto set-point but it will change to the next timed temperature change when it comes around.



  • Just for info on how it's working, this is a day in the life of the downstairs Dining room / Extension which are almost one big room also connected to the living room by a large opening. A single wall thermostat controls a radiator in each of the two rooms. As you can see once the room is up to temp the boiler is off about 60 or 65% of the time. The heating switches to the Living room about 10pm that is why the boiler is on with no valve use shown. I set the boiler on value to 12 and the valve % is /10 to keep the temps clearly visible.

    Temps.PNG



  • 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.

    Screen Shot 2015-12-11 at 13.50.31.png

    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.

    2015-12-13.png

    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.



  • Just an update, I hope my kit will be delivered by the end of the month now, so very much looking forward to trying this out! Thanks for all your hard work.



  • 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?



  • Hi,
    did any one of you manage to send S: command that works to the cube ?
    I want to control changing the ECO/AUTO mode but i can't.



  • 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.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.