Boiler control from MAX! Cube to Drayton Boiler via Raspberry Pi/Vera/Mysensors.
-
Thanks for that Stuart, always good to see it is getting used. Here is my latest live unit in its natural environment.
and a link to a video of it running on my gdrive
The video does not pick it up that good, it is less glowie than the film.
-
Cool. Does it say: "I'm sorry Dave..." ??
-
its programmed never to apologise, but I make sure it has no connection to the doors.
-
@Stuart-Middleton Just to let you know I have updated the master branch on Github I found an error in the MAX code I borrowed that messed up the reported temps if the actual temperature went over 25.5 as you can understand in Scotland we don't see that very often. Anyway it's fixed in the Master. Also cleaned up some errors that popped up if not using the neopixel display.
-
Ah, excellent thanks. I've noticed some of the temps have been reporting zero on the hot days. I'll grab it and give it a go.
-
I'm seeing 0.0 readings from radiators for some reason. They were all valid last night but just seem to drop out randomly. Do you know if this is a bug or just the MAX system being a bit crappy? I've not had time to look at the code yet, just thought someone may know.
And while I'm here, I can't get to the graphs on any rooms with a ' in them (i.e. Luke's Room) due to a database error (I'm guessing the DB lookup isn't escaped. I'll try and take a look at this at some point over the weekend.
![alt text]( image url)
-
This is problem of Max System - very often the temp is sended as 0.0 in comunication with the box
-
BTW, I fixed the ' issue by changing graphing.py to use urllib.unquote() on the room name then replaced a single ' with a double ''. I then had to replace the single ' again for the html print or the page just came out empty.
-
If they are radiators without wall thermostats 0.0's are usual. It only seems to know when it is at temperature as it crosses the preset threshold. Then it will send out a correct temp.
I have tried to save a copy of the last correct temperature to use until a new one comes in but not managed to get it working yet. I was doing a backward search through the database to find a good temperature but it was taking upwards of 3 seconds a room as my DB is about 56MB now. I tried creating a global dictionary to save them but ended up getting lost in the code
I might create a new text file like the variables to save them in as it does annoy me also. If you have wall thermostats its not a problem.
-
@Stuart-Middleton said:
BTW, I fixed the ' issue by changing graphing.py to use urllib.unquote() on the room name then replaced a single ' with a double ''. I then had to replace the single ' again for the html print or the page just came out empty.
Good find Stuart I will get that into the files on Github.
If you are interested I have a new branch that sends temperatures to Vera if you have one, to populate "Virtual" Thermometers, i.e ones with no hardware. It's pretty easy to add them from the developer page. You can turn the feature on and off in the variables so it will become the main branch at some point.
Stephen
-
@Stuart-Middleton said:
BTW, I fixed the ' issue by changing graphing.py to use urllib.unquote() on the room name then replaced a single ' with a double ''. I then had to replace the single ' again for the html print or the page just came out empty.
Stuart, I have made changes could you backup your graphing.py and try my one. This should be a link.
This shows you never know what you don't know about Python I was manually removing the html %20 spaces and never thought of other non text characters. And didn't know about the urllib functions. Old dog learning new tricks.
Stephen
-
Stuart
I have added a new table to the DB to store good heating values. I only have one room without a wall thermostat so it is a bit hard for me to test for a 0.0 temp, it seems to work fine if there is a good temp from the room. would you be able to give it a go for me? the main changes are in the database.py and webui.py scripts. in the vera_virtual_thermostats branch.make sure you back up your current files before you try just in case I breaks it :). your DB too just in case. I tend to make a copy of the whole heating folder onto my PC before using changes on my live system just in case I muck it up.
Stephen
-
Corrected an error in the webui.py code for the 0.0 temps was causing a crash.
-
I'm going to try and find time to test this later. Just super busy at the moment. Stupid day job!
-
hehe know what you mean, 2 weeks off for me atm, good job as I just noticed the heating has been off for a while, oops.
-
Another tiny update to fix a problem if any of the temperatures went over 25.5 and buy tiny I mean one extra character of code in a binary format string. yesh.
-
Hey, just got around to trying your fix and there's a little issue. The converted name works for the web page but not for the DB query. I've changed the following line in graphing from
tempData = DB.getTemps(cleanName, currentTime)
to
tempData = DB.getTemps(cleanName.replace(''', "''"), currentTime)to get it to work. Hope that helps
Now it's all happy I should really get around to connecting it to my boiler instead of just looking at the pretty graphs!
-
grrr, can you send me a copy of your database? I am wondering if it set the room name before the other changes if there is something extra in there.
And just to check, you are replacing one ' (quote) with two of them?
-
Ah, yes. My room names are already set up. Yes, replacing a single quote with two single quotes. I'll PM you my DB. It may have worked if I'd started from scratch.
-
OK, I have no idea how to PM you
-
This is my rooms table from the database
1 Living Room 12DA70
3 Hall 137F27
2 Kitchen 12DBCB
5 Master Bedroom 1245D7
4 Landing 12E19F
7 Lara's Room 12DA58
6 Luke's Room 12DA35
-
LOL me either maybe you cant. You could save it to google drive or dropbox and post a link i think.
-
kk cheers, I wonder why it is needing 2 quotes? I will have a better look.
-
Here is how to open a private chat. Click the persons name at the top of a post. Then click the blue three-dot menu.
-
Ah, sql syntax (according to a website I found) uses double single-quote to escape a single quote when used in a table.
-
Ok after faffing about for ages I ended up just moving your replace quote code into the database file, keeps it out of the way and seems to work ok if I simulate a room with a quote in it and without.
It is happy saving names with a quote in to the DB it is just searching after that needs it doubled. Something else learned.
-
Cool, thanks. I'll grab it so the version I'm running is in sync.
-
For @simrob problem.
I think the problem is in the database, and my code of course, With the way I developed it over time I think I added features later that cause a problem with a fresh install because It asks for the room names before it creates them. Where my database already had room names populated before I got to that point.
Could you install "DB Browser for SQLite" and have a look at the heating.db file that was created. Under brows data there should be a rooms table like mine."4" "Living Room" "1051D6"
"5" "Dining-Extension" "106FD5"
"2" "Bathroom" "1051DA"
"3" "Bedroom 1" "116B63"
"1" "Bedroom 2" "1163A5"If it is empty possibly just adding one record with the correct name and a random GroupID might be enough to get it past the point where it fails so it can fully populate the table. Also I think you must be using an older version as your line numbers don't quite match what I have. Try downloading the vera Virtual Thermostats branch and see if that helps, not saying it will but that will become the main branch when I sync it up.
I will look at getting in installed again on a blank Pi so I can test and fix this properly. But hopefully putting a line of data in the DB rooms table will get you past the problem.
-
I have now changed the folder layout on github to make installing easier, also updated some of the files to hopefully stop the error on first run.
I tried on a blank Raspberry and it all seemed to work ok.
Give the README instructions a once over and see how it goes.
-
After many delays and other items got in the way I finally have almost sully working system. I do have one issue I am struggling with and that is that I can't seem to turn the boiler off once the temperatures have been met.
Also is there any way some of the configuration page could be clarified as there are a number of options I am a little unsure about.
Thanks
-
@twisted I have added a text file to explain the variables. As for not turning the heating off, not sure, remember that normally the Max system will gradually close the valves on the radiators as the temp goes over the requested temp, you will normally get a half degree or so higher. if it never shuts off I don't understand that it just sends the same vera command with a 1 or a 0.
-
Just saw the explanation txt appear, thank you so much, it means I can double check what I set was correct.
Funnily I noticed as it just appeared when I was searching the code to work out a couple of bits.
-
Is the Max Boiler Controller from eq-3 not an option to do this more easily? It was introduced by eq-3 for the British market, but is now not available anymore. Google for BC-TS-Sw2-WM to get the manual from eq-3. Maybe we should push eq-3 to reintroduce this product again.
-
Never seen that before, reading the instructions it looks like it switches the boiler on using a daily timer function like the room heating and and a thermostat temperature, possibly if it switches on if any of the rooms are cold that would work. Not saying mine is better but it monitors the valves and gives you heat on demand when any of the radiators call for it.
-
I have to say using Vera and the boiler switch attached to that is a great solution, if I could just get past one problem. I wonder if anyone else is experiencing this, but I find the time taken for the valves to respond to the temperature changes is a little slow. Lets say I set the required temperature to 19c most rooms jump to 20/21 before the valves close enough to actually prevent further heating to the room.
My thoughts at the moment are to see if I can somehow directly communicate with the valves or maybe set offsets for each temp on the valves so they read a couple of degrees high.
Anyone have any thoughts?
-
What I do is only supply heat if valve is open more than 80% or more than 2 valves open 60% so heat shuts off at about 21.9 if you are looking for 22, then the residual heat in the radiator takes temp to about 22.2 before the room starts to slowly cool over the next hour or so down to 21.7 when the valve opens up enough to bring the heat back on.
-
twisted, unfortunately you can't directly communicate with the valves. AFAIK the way the work is that they initiate communication with the cube every 2(?) minutes and not the other way around. The cube just listens for the data and then sends data back to the valve. This is to conserve battery so the valve doesn't need to be active all the time. I'm sure stephenmhall will correct me if I'm wrong
-
As far as Cube to valves and valves to cube comms, I think it must be bi-directional as if you change anything on the cube app it happens pretty much instantly. How the cube and valves communicate could be magic for all I know they are on the 868Mhz band but what the protocol is I don't know.
I recently read about a company in Germany called busware.de that makes a Raspberry interface card that has firmware that speaks MAX protocol, I have sent them an email looking to confirm this but not heard anything back yet. If I could cut the Cube out of my system I would be very happy as it is the least reliable part, it seems to factory reset itself every couple of months.
-
Ah, well, I think the cube tells you it happens instantly but queues the requests up and waits to be contacted by a valve. I think that's what the memory slot parameters are for when you get the cube data. It fills them up with outgoing data ready for when the device makes contact. I'm not 100% sure about this but when researching it a while ago (I was going to go down the 868Mhz radio route before I found your project) I'm sure I read that's how it worked. I'll see if I can find the article.
-
I'm having a small issue, and I can't see why. I had to reload and now every time I try to load it I get the following before it terminates. This is from fresh install.
Traceback (most recent call last):
File "main.py", line 204, in <module>
Main()
File "main.py", line 96, in init
self.doLoop()
File "main.py", line 111, in doLoop
buttonCheckHeat("main")
File "/home/pi/PiHeating/heatinggpio.py", line 173, in buttonCheckHeat
MaxInterface().checkHeat(0)
File "/home/pi/PiHeating/max.py", line 56, in checkHeat
self.switchHeat()
File "/home/pi/PiHeating/max.py", line 486, in switchHeat
roomTemps = CreateUIPage().createRooms()
File "/home/pi/PiHeating/webui.py", line 224, in createRooms
actualTemp, roomOpen, roomMode)
UnboundLocalError: local variable 'roomOpen' referenced before assignment
-
That error suggests you don't have a settings file?
-
@stephenmhall - I'm getting a lot of issues that seem to plague the MAX system (not your excellent software of course ) where the cube forgets the valves randomly or updating timings don't get sent to the valves. I also hate that the realtime temp isn't reported.
With this said, I was wondering if you (or anyone else) had seen the BlueTooth version of the valves that they sell. And if so, has anyone taken a peek at the messages to see if the temp is reported? I'd rather control the whole thing via BT than go via the dodgy cube!
-
Looks eq-3 at least have plans for eq-3 MAX! compatible boiler/hot water controller, the manual is already there, just cannot see the product anywhere.
-
For anyone looking in having a setup like above, theres a way without extra buying the cube or the ccu2 when using homematic thermostats. Please have a look at https://www.homegear.eu , which eliminates the need of those boxes as it runs on a raspberry pi which most of us already have. You will have to add a CUL or better build yourself a NanoCUL (arduino nano + CC1101 ). Homegear does all the pairing and communication (also scripts) and best of all its converting and outputs all the communication via MQTT, so you can use Node Red.
-
Damn, just weeks after I changed to a Honeywell system. Talk about bad timing.
-
FYI, I bought a CC1101 connected it up to an RPI, setup openhab, homegear, the homeatic binding, and within minutes I had all of the devices listed and complete control over them all. Well I can say that is where it has ended, I am struggling to either find pre-written logic or writing my own to control everything. The issue isn't so much writing it as such, but choosing which system should host it. This dilemma exists, as I have everything else in my vera, I am getting into node-red, and now also have openhab/homegear in the loop, I don't want to fracture my set up too much from a control interface point. I like the idea of keeping the WAF where it is, so I will probably still need to have some sort of control via the vera and therefore one of the apps that the other half is still happy with.
-
I've got a CC1101 on its way from China. I'm hoping it'll be here soon. My plan was to rewrite the excellent Python code from this page to talk to them directly rather than through the cube. Currently, I don't have an off the shelf home system. I'm kind of writing it all myself as I go (maybe a mistake, I know). I'll let you know how I get on when mine arrives.
-
@Stuart-Middleton Although I mentioned my difficulties, I would suggest that you at least have a look at homegear and openhab (or the openhabian bundle to make it easier) as it does give great access to the devices and opens up very easy use of MQTT.
-
Thanks. I'll take a look at that first.
-
@Stuart-Middleton attached is an example of the items that get loaded when connected to openhab2 via homegear and the homematic binding.
-
That pretty much covers all the settings. When my radio arrives I'll hopefully be able to get it working quickly and I may come to you for help with setting it up with openhab so I can at least see a working system before I start playing with the code. Thanks
-
For a beginner, what shall I read (links) to understand what it means to do this. I have MAX cube and 3 actuators and I need a boiler control device. I called eq-3 and they reply they are not selling boiler controller device BC-TS-Sw2-WM (The MAX! boiler controller has been withdrawn from the market due to poor customer uptake. We do not believe there to be any devices available in the sales channel.) Thanks a lot !
-
@Maciej-Jablonski
They are not selling any more this. (Their answer: The MAX! boiler controller has been withdrawn from the market due to poor customer uptake. We do not believe there to be any devices available in the sales channel.)
-
It depends on how much of a beginner you are. If you're OK with very basic electronics, happy to install some software on a Raspberry Pi and can connect a mains voltage wire to your boiler without killing yourself, then it's pretty simple.
At a minimum, you'll need a Raspberry Pi PC, a mains relay board controllable from the Pi (very cheap on eBay) and some cable.
-
@Stuart-Middleton
Thanks. Of course, I can do these. I have Raspberry Pi B and other required things. What I need to know is a schematic of connections and what software to install (on PC, on Raspberry Pi...)Again, Thanks a lot !
-
The software is all written in python and is linked somewhere near the top of this post. There are instructions of how to install and use it included if I remember right.
The wiring is very simple. The boiler on output pin is defined in the software, so just change it to any GPIO pin that you want and connect your relay (3.3v I believe) to the pin and GND. I used a solid state 250v AC relay that accepts 3.3v input. Then just connect the "call for heat" wire on your boiler to the mains side of the relay. This is on your boiler schemaic, but is usually just the two wired to your wall thermostat.
I've got a combi boiler so just set it to be on all the time and let the Pi contol the heating.
-
Thank you a lot! I will try it and let you now the progress. I need some time to do it...
-
if you need any help with my software let me know, I have swapped to a Honywell system myself so no longer use it but if I can help I will.
-
@twisted It's arrived! I've got a CC1101 module! I presume It's just connected to the Pi via SPI? I think there's a wiring diagram on the website. I'll dig out a spare Pi and let you know what happens.
-
I use a diagram from homegear to connect it and it is working. No problem with connection.
-
I believe I used this one: [https://forum.homegear.eu/t/CC1101-no-physical-device-found/921/2]
-
OK, so I've got my module, connected it to my Pi and installed homegear (used the Rasbian version with homegear and openhad installed). I connected to the Pi, ran homegear -r, families select 0, pairing on and started pairing on a device. However, I don't see anything in the peers list.
So, any ideas or obvious things I'm missing?
-
it should be families select 4 I believe, did you go into the max.conf and uncomment all the lines under ti cc1101 module? you may need to set gpio to 25 (not 23) and don't uncomment the the additional section. Reboot, then you should see 4 max! when "sudo homegear -r", "ls"
-
OK, so I uncommented the settings in max.conf (I hadn't got to those) and I do get the following
But no pairing when I do 'families select 4' then 'pon' and try to pair. The device just times out and an 'ls' doesn't show any devices.
I may try a cleaner install and start again. I've been following a few posts and translating them into English, but it's still not working. It could, of course, be my hardware.
Is there a log output somewhere that shows the hardware initializing?
-
Sorry on the road ATM, but will look when i get home. Here is some pics of my wiring I have on my phone in case that is some use.
-
Quick thought did you factory reset the max! devices before trying to pair? I found mine wouldn't work until they had been reset due to the pairing with the cube.
-
Thanks. I'm using a different module, but the wiring looks the same. I'll try again later.
I didn't factory reset them. I'll try that.
-
You dont need to do reset. IT is enought to unpair with the cube. Try to set log debug in console of homegear with the option 10. Then logs should tell you what is wrong
-
It looks like I've got the wrong module. I ordered from ebay about 3 months ago and the title said "CC1101 315/433/868/915Mhz Wireless Module SMA Antenna Transceiver fr Arduino New", but the description talks about a default "433 mhz". I'm not sure if it's switchable, but it doesn't seem to work. I've ordered another for the grand price of £1.95, but it'll take a month or so to get here.
-
I've had a Honeywell wireless programmable thermostat for several years and the LCD is now a little temperamental so was looking for something new.
Found the Honeywell evoHome, then saw a link mention the MAX! products and then I found this thread which looks like what I'm after.
Its been 8 months since the last post on here so I was wondering what ever happened to this project? Its just seems to have stopped. Is it complete?
Did the CC1101 work so that the MAX! Cube is not required?
Did @Stuart-Middleton switch over to openhab2 and homegear?Just wondering do I use @stephenmhall code or go the openhab2/homegear route?
Thanks
Anthony
-
Hey, @demusss. I'm still using the python script talking to the MAX! Cube. It's a little temperamental but works most of the time. I finally got my hardware (CC1101) but, if I remember right, the homegear instructions listed above don't seem to work anymore. There's a missing module? I can't recall now. I'm sure I could sort it out but I just haven't had time.
Ideally, I'd like to talk to the system myself via the CC1101 and write the software myself instead of relying on OpenHAB but time is the limiting factor, unfortunately.
Maybe I'll pick it up again this weekend and try and get the CC1101 comms working.
Stu
-
Wow Stu, quick reply.
What you've built is basically what I'm after, but from what I've read the Cube can be temperamental.
I do have RPi somewhere, so to have a play I may get a CC1101,
MAX! Wireless wall mount thermostat - BC-TC-C-WM-4 / 131651
MAX! TRV - BC-RT-TRX-CyN / 142016A0AI would like to control the system from my mobile so if I'm out late there's no point in the heating being on. There are some HomeMatic apps out there which work with openhab etc, but maybe using your web interface would be easier.
Anthony
-
Hey, Anthony.
Yeah, the cube is the temperamental bit. It forgets the sensors every few weeks/months.
I have opened up the python web page to the web, secured behind a password, and it's OK to use. I mainly use it to monitor the system and look at the pretty graphs. I think the CC1101 with OpenHAB or custom software is the way to go.
Let me know if you get the Pi and CC1101 installed. I can't recall exactly what was wrong but I think it may be one of the packages that it tries to download no longer exists. It's something I really want to get fully working the way I want it, but to be honest it does a good job anyway.
Stu
-
Hi Anthony.
Funnily enough I went from the MAX system to a Honeywell Evo system and Domoticz as I have elderly parents and could not risk the times the max just forgot about all its radiators and either left the heating off or on all day.
Had the Evo for maybe a year now with no problems. The only thing I miss with the evo is notification as to when the heating is actually on. And being able to work on my code as I did enjoy writing it.
If you need any help with the code just ask, although it has been a while since I looked at it
Stephen
-
NIce post.. I was looking at adding boiler control to my max eq3 system and this looks fab
-
Hey all,
I want to revive an old thread here. Ive been chatting to Stephen via github and plan to extend , perhaps take over?, development of his PiHeating package on github..
Ive created my own fork (based on twistedsanity as he added some nice docker defns) and I plan to make massive changes to it.. By trade Im a Java/Javascript developer and Im using this project as an excuse to learn/play with Python
- Please review my github issues Ive logged, Id love to know if people agree/disagree
- Are there many MAX! Users out there? if there are then I'll invest time in making the code read-able, and pluggable with HA controllers like HomeAssistant.. If there isnt much interest then I'll trim the code down to my needs (remove vera etc)
- Any other suggestions?? please log a Github issue and I'll look at it..
@twisted : are you twistedsanity on github?
My github repo is here https://github.com/asantaga/PiHeating
-
This post is deleted!
-
Hey all,
Well after long sessions of trial and error Ive given up on the Max! +Raspberry pi based on Stephens code. Regardless of how frequently you scan the max!cube it eventually looses its memory after 4-8 weeks.. Usually when Im not at home and thats not acceptable..
Shame as my setup with HomeAssistant was "perfect":-(
-
@angelos I was looking into the MAX setup initially but reports of the Cube falling over put me off completely, even where some appeared to have ZERO problems. Some seemed to have circumvented the problems by reflashing the Cube (hazy recollection) but cannot remember the details of who where what, as I discarded it when a plug-in card for the Pi3 was released by the parent company (ELV?).
I took it no further as I had set a target to cover all improvements from energy savings, so the budget didn't stretch to it having added insulation and improved Rad Valves, as well as the increased pricing on the market.
If any of that info is potentially any help, pm me and I'll dig out what I found.
-
Hi
I have just installed a Max system, 17 TRV's, 4 Room stats and a cube. I also have a Danfoss wireless stat for controlling the boiler. I was wondering how to get boiler control with the Max because currently the boiler runs all day. I then found your project. It looks a bit advanced for me though. I was thinking of using a Sonoff device just so I could switch the boiler on/off at my leisure for a quick fix. I have never used a RPi before. I see you have now changed to an Evo system was the Max that unreliable?
-
@w1ldf1re While you are waiting...
Pardon my interest and confusion, but if your Danfoss stat (presumably from a single area sensor) is controlling the boiler, how does the Cube connect to it, and if the Danfoss is connected, why does the boiler run all day?
The discontinuation of the Cube compatible boiler relay due to lack of sales put me off the Cube, and quite a few complaints over reliability sealed it.
My next notion was to go for a Pi3 Homematic controller which was allegedly Max compatible (see https://www.elv.de/funk-system-homematic.html - Bausatz) but when prices shot up I abandoned it for better valves/TRVs instead.
Right now I'm looking at paralleling the existing commercial (Danfoss type) boiler relay with an Arduino fired one fed temperatures for all the rooms to cope with deep winters where the top floor can plunge, but they are quite separate controls.
If you can find a relay (Schaltaktor) which can be called by the Cube, you should be good to go, the parallel system I would suggest better in case your Cube has a brainfart... Just my 2c...
-
Hi folks,
i bought a MAX! set month ago including MAX Cube, 4 Valves and some window sensors. Now i want to use this project to be able to switch on and off gas boiler, which is operated by remote thermostat at this moment.
So far, i've got it runing, but i have a problem with room temperature reading.
I have four rooms, two are read correclty, but another two shows temperature and set temperature as 255, the Valve % seems to coresponds to other rooms somehow.
I hope this thread/project is not completely dead and somebody can help me with it ... thanks guys!
EDIT: I have resolved the relay issue described in my original post, so i removed that question. It was caused by wrong configuration in variables.txt
(sorry for my poor english)
-
Ok, it works. Looks like the problem was caused by windows sensors that were not connected but initialized, so they were missing.
I removed them in the MAX software and then everything was displayed correctly.
Thank you for this great project!
-
This post is deleted!