Boiler control from MAX! Cube to Drayton Boiler via Raspberry Pi/Vera/Mysensors.
-
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.
-
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.
