Python Plugin: Smart Virtual Thermostat
Moderator: leecollings
-
- Posts: 350
- Joined: Sunday 19 April 2015 0:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2022.2
- Location: UK
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
If I understand it correctly (and, yes, I've read all through this thread), the principle behind SVT is to maintain room temperature very close to setpoint temperature (e.g., within +/- 0.1C), by learning the room's heating characteristics and taking into account the outside temperature. It does this through a series of cycles, over a number of days.
I currently have a 'smart' thermostat (Drayton Wiser, which appears to be doing time modulation), with four separate schedules each day (on / off / on / off), with different setpoints for each schedule. Will this work with SVT, with the setpoint changing at specific times throughout the day, or will the learning restart each time the setpoint changes?
I currently have a 'smart' thermostat (Drayton Wiser, which appears to be doing time modulation), with four separate schedules each day (on / off / on / off), with different setpoints for each schedule. Will this work with SVT, with the setpoint changing at specific times throughout the day, or will the learning restart each time the setpoint changes?
-
- Posts: 11
- Joined: Monday 28 January 2019 15:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Hi Guys,
Since the last Domoticz update I have these records in the log each second
Since the last Domoticz update I have these records in the log each second
Code: Select all
2022-02-04 09:52:03.235 (calefaccion) Releasing lock for 'calefaccion'
2022-02-04 09:52:03.285 (calefaccion) Acquiring lock for 'calefaccion'
2022-02-04 09:52:03.285 (calefaccion) Releasing lock for 'calefaccion'
-
- Posts: 470
- Joined: Thursday 26 October 2017 13:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Delft
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Why would you use SVT if you've got a physical thermostat that does exactly what SVT does? My advice, don't use SVT for this, it will completely mess up your system.MikeF wrote: ↑Tuesday 01 February 2022 18:05 If I understand it correctly (and, yes, I've read all through this thread), the principle behind SVT is to maintain room temperature very close to setpoint temperature (e.g., within +/- 0.1C), by learning the room's heating characteristics and taking into account the outside temperature. It does this through a series of cycles, over a number of days.
I currently have a 'smart' thermostat (Drayton Wiser, which appears to be doing time modulation), with four separate schedules each day (on / off / on / off), with different setpoints for each schedule. Will this work with SVT, with the setpoint changing at specific times throughout the day, or will the learning restart each time the setpoint changes?
-
- Posts: 350
- Joined: Sunday 19 April 2015 0:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2022.2
- Location: UK
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Exactly what I was wondering - thanks!
-
- Posts: 2
- Joined: Friday 11 February 2022 13:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Hello.
I plan to use SVT for zone control of underfloor heating. I only have underfloor heating. I plan to regulate 8 zones. I have a gas boiler with equithermal regulation. This means that the boiler actually has an outdoor temperature sensor and automatically adapts the heating water temperature to the outdoor temperature and probably also to the required indoor temperature.
I plan to use RASPBERRY PI 4B 4GB, 8 x SVT, 8 x combo thermal sensor, or 8 x thermostat - I assume that the current temperature can be read from the thermostat and using scripts to write back the required temperature to the SVT. Each zone will switch thermoelectric actuators to close / open the floor heating zones. At the same time, if any zone requires the boiler to be switched on, I will use the scripts to set the temperature on the central thermostat by 1 degree higher and vice versa to switch off the boiler I will set the temperature on the central thermostat lower. The central thermostat controls the boiler via the EMS bus, so I will also use the EMS bus gateway.
SVT will be without an external thermo sensor, so I will not take into account the outdoor temperature. This probably does not matter during heating, because the external temperature is compensated by the boiler itself by changing the heating water temperature. This may be a problem for room cooling calculations.
Regarding Domoticz and SVT and Linux, I am a complete beginner. That's why I want to ask you: Do you think that my logical design has a chance to work? Or do you see a mistake, an obstacle, or a possible problem?
Thank you for your comments and suggestions.
I plan to use SVT for zone control of underfloor heating. I only have underfloor heating. I plan to regulate 8 zones. I have a gas boiler with equithermal regulation. This means that the boiler actually has an outdoor temperature sensor and automatically adapts the heating water temperature to the outdoor temperature and probably also to the required indoor temperature.
I plan to use RASPBERRY PI 4B 4GB, 8 x SVT, 8 x combo thermal sensor, or 8 x thermostat - I assume that the current temperature can be read from the thermostat and using scripts to write back the required temperature to the SVT. Each zone will switch thermoelectric actuators to close / open the floor heating zones. At the same time, if any zone requires the boiler to be switched on, I will use the scripts to set the temperature on the central thermostat by 1 degree higher and vice versa to switch off the boiler I will set the temperature on the central thermostat lower. The central thermostat controls the boiler via the EMS bus, so I will also use the EMS bus gateway.
SVT will be without an external thermo sensor, so I will not take into account the outdoor temperature. This probably does not matter during heating, because the external temperature is compensated by the boiler itself by changing the heating water temperature. This may be a problem for room cooling calculations.
Regarding Domoticz and SVT and Linux, I am a complete beginner. That's why I want to ask you: Do you think that my logical design has a chance to work? Or do you see a mistake, an obstacle, or a possible problem?
Thank you for your comments and suggestions.
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
cool setup!saki2 wrote:Hello.
I plan to use SVT for zone control of underfloor heating. I only have underfloor heating. I plan to regulate 8 zones. I have a gas boiler with equithermal regulation. This means that the boiler actually has an outdoor temperature sensor and automatically adapts the heating water temperature to the outdoor temperature and probably also to the required indoor temperature.
I plan to use RASPBERRY PI 4B 4GB, 8 x SVT, 8 x combo thermal sensor, or 8 x thermostat - I assume that the current temperature can be read from the thermostat and using scripts to write back the required temperature to the SVT. Each zone will switch thermoelectric actuators to close / open the floor heating zones. At the same time, if any zone requires the boiler to be switched on, I will use the scripts to set the temperature on the central thermostat by 1 degree higher and vice versa to switch off the boiler I will set the temperature on the central thermostat lower. The central thermostat controls the boiler via the EMS bus, so I will also use the EMS bus gateway.
SVT will be without an external thermo sensor, so I will not take into account the outdoor temperature. This probably does not matter during heating, because the external temperature is compensated by the boiler itself by changing the heating water temperature. This may be a problem for room cooling calculations.
Regarding Domoticz and SVT and Linux, I am a complete beginner. That's why I want to ask you: Do you think that my logical design has a chance to work? Or do you see a mistake, an obstacle, or a possible problem?
Thank you for your comments and suggestions.
Are those 8 zones in 1 room? If not, the temperature of the central room thermostat makes no sense
For 8 rooms, I would buy 8 thermometers that you can read from Domoticz (aqara zigbee for instance)
For just 1 room, it would not make sense to use 8 motor operated valves, since you can simply switch the pump on/off
You can add SVT multiple times to Domoticz, so each room can have it's own thermostat and parameters
For outside temperature I have added OpenWeather to Domoticz and use the temperature of my area. This temperature can be fed to SVT
When your boiler compensates for outside temperatuer, I would not let SVT deal with outside temperature. SVT will extend the heating period, based on the Delta T between setpoint and outside temperature. When SVT increases the 'on' time, while the boiler increases the temperature, it doubles the increased energy amount.
Personally I would let SVT deal with the outside temperature. My experience with a Remeha iSense thermostat is, that it is quite dumb in it's reaction, not able to keep the room temperature stable, while SVT does an excellent job.
I also use the room thermostat to increase the setpoint (in my case 1 degree above setpoint), to fire the boiler (OpenTherm Gateway in Domoticz), but as soon as I would introduce SVT in the bed rooms above, this method won't be safe, since the room temperature can already be above the increased setpoint, resulting in not firing the boiler.
My experience with floor heating is that you need a long calculation time (110 minutes in my case). I also modified SVT to cut the next calculation time in half when in the previous cycle no heat was added to the floor. The cooling characteristics of the room is then totally different.
-
- Posts: 2
- Joined: Friday 11 February 2022 13:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
@jake thanks for your advice
My 8 zones = 8 rooms. My equithermal control is able to maintain the desired temperature where the thermostat is. But it is difficult to regulate the temperature in other areas. And it's almost impossible to change it. That's why I want to improve my system with zone control. The condensing boiler is more efficient if it heats the water to a lower temperature. Therefore, I want to keep the equithermal regulation that regulates the water temperature and use SVT without an external temperature sensor (if it will work well).
I planned to buy an RB Pi 4B with 4GB of RAM, but it is unavailable and I would have to wait another 30 days. Will a version with 2GB of RAM be enough for me? Because it is available.
My 8 zones = 8 rooms. My equithermal control is able to maintain the desired temperature where the thermostat is. But it is difficult to regulate the temperature in other areas. And it's almost impossible to change it. That's why I want to improve my system with zone control. The condensing boiler is more efficient if it heats the water to a lower temperature. Therefore, I want to keep the equithermal regulation that regulates the water temperature and use SVT without an external temperature sensor (if it will work well).
I planned to buy an RB Pi 4B with 4GB of RAM, but it is unavailable and I would have to wait another 30 days. Will a version with 2GB of RAM be enough for me? Because it is available.
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
yes, the simples of Pi's is more than enough. I used to have a Pi 1 and upgraded it to a Pi3, where the CPU usage is already minimal, while I use it with MQTT, Zigbee, Zwave, Wifi devices, OpenThermGateway in Domoticz, but also monitoring the gateway from my solar panels (enecsys micro inverters), use it as a VPN server (OpenVPN), as a webserver for Dashticz and ad-blocker with Pi-hole.saki2 wrote:@jake thanks for your advice
My 8 zones = 8 rooms. My equithermal control is able to maintain the desired temperature where the thermostat is. But it is difficult to regulate the temperature in other areas. And it's almost impossible to change it. That's why I want to improve my system with zone control. The condensing boiler is more efficient if it heats the water to a lower temperature. Therefore, I want to keep the equithermal regulation that regulates the water temperature and use SVT without an external temperature sensor (if it will work well).
I planned to buy an RB Pi 4B with 4GB of RAM, but it is unavailable and I would have to wait another 30 days. Will a version with 2GB of RAM be enough for me? Because it is available.
So yes, I think a 2Gb version can handle it
-
- Posts: 153
- Joined: Wednesday 02 October 2019 11:47
- Target OS: Linux
- Domoticz version: 2023.1
- Location: DE / BY / LT
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
After reading this thread, I implemented a 'test room' today (guest bathroom, so I don't really care if it gets cold there )
I have central floor heating and all required sensors (i.e. temp inside/outside, window opening sensor) and heating ist being switched via a z-wave controlled valve which until now was connected to a simple hysteresis logic
.
Since I log all sensor values in influxDB, I will be able to see how temperature develops.
Are there any recommended/tested parameter values for this constellation?
So far I've set min heating time to 30 mins and window opening time min to 30 mins.
I have central floor heating and all required sensors (i.e. temp inside/outside, window opening sensor) and heating ist being switched via a z-wave controlled valve which until now was connected to a simple hysteresis logic
.
Since I log all sensor values in influxDB, I will be able to see how temperature develops.
Are there any recommended/tested parameter values for this constellation?
So far I've set min heating time to 30 mins and window opening time min to 30 mins.
-
- Posts: 153
- Joined: Wednesday 02 October 2019 11:47
- Target OS: Linux
- Domoticz version: 2023.1
- Location: DE / BY / LT
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
And a quick question:
Everytime I change the parameters in the HW tab and click on 'update', I get a 'Error adding new hardware' popup and need to restart domoticz.
After restart, the new parameters are saved.
Any solution to that or am I doing something wrong here?
Everytime I change the parameters in the HW tab and click on 'update', I get a 'Error adding new hardware' popup and need to restart domoticz.
After restart, the new parameters are saved.
Any solution to that or am I doing something wrong here?
-
- Posts: 2
- Joined: Friday 11 February 2022 20:29
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
I've seen in all the posts that the "heat for 10 sec" issue has been reported multiple times.
But this problem persists in the latest version 0.4.11
As it cost me a contactor, I searched a bit to find where this error came from.
I changed this line (lin 367) in the program:
by
this solved the problem for me.
But this problem persists in the latest version 0.4.11
As it cost me a contactor, I searched a bit to find where this error came from.
I changed this line (lin 367) in the program:
Code: Select all
if power == 0:
Code: Select all
if heatduration < 1:
-
- Posts: 153
- Joined: Wednesday 02 October 2019 11:47
- Target OS: Linux
- Domoticz version: 2023.1
- Location: DE / BY / LT
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
After testing this for a while in 2 rooms, I removed it from the system.
there's no advantage over simple hysteresis control(at least not with my floor heating), plus the plugin died on me a few times, leading to a cold bathroom in the morning.
there's no advantage over simple hysteresis control(at least not with my floor heating), plus the plugin died on me a few times, leading to a cold bathroom in the morning.
-
- Posts: 86
- Joined: Friday 08 November 2019 23:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Why SVT makes set point device 1280 (Unknown) as in this picture, SVT does not work until I delete this device
- Attachments
-
- Screenshot_20220325-181804_Chrome.jpg (333.98 KiB) Viewed 2866 times
-
- Posts: 2
- Joined: Wednesday 04 May 2022 20:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
I have the same problem every time I change the set point
-
- Posts: 8
- Joined: Sunday 25 October 2020 15:36
- Target OS: Linux
- Domoticz version: 2023.1
- Location: CZ
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Thanks for a great plugin, which I used in one zone for about two years. Now I would like to regulate 7 areas - zones. Each zone has a controlled valve on the radiator and a thermometer, plus one central switch for the boiler. It should work so that if one zone requires heating, the boiler is switched on. If there is no demand, the boiler is switched off.
But requests can come at any time and for each room the boilers will be switched on for a different period of time. Does anyone have experience with how it will work? Isn't some additional logic needed for switching the boiler?
Thanks.
But requests can come at any time and for each room the boilers will be switched on for a different period of time. Does anyone have experience with how it will work? Isn't some additional logic needed for switching the boiler?
Thanks.
-
- Posts: 470
- Joined: Thursday 26 October 2017 13:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Delft
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Yes, you will need additional logic. But it doesn't have to be very complicated. I would suggest to create a dummy switch for each room. This is the 'boiler switch' you configure for that room's SVT. Then you create a small script that switches On the real boiler switch if any of the room's dummy switches are On and Off when all of the dummy switches are off. This will work as you intend it to: the boiler will go on when any of the rooms requests heat.
BUT, unless you also have a way of closing the radiators in each room, I don't think it will be very comfortable nor very energy efficient. Because the central boiler delivers heat to all rooms if at least one room requests the boiler to be On, you will most likely find that some rooms will get to hot and the boiler will be On much more than it used to be when you had only 1 SVT instance. You may even find it will be On 100% of the time, when the room's svt instances are out of sync. (1 zone switches on for 10s, then at the moment the 1st zone switches off, the 2nd zone requests heat for 10s, then when this switches off the 3rd zone requests heat for 10 seconds, etc and effectively the boiler will be On all the time)
I have tried making a multi zone system like you intend to with svt controlling the boiler, plus controlling the radiator valves in each room with eurotronic spirit Z thermostatic valves, but I never got it to work. This was mostly due to zwave thermostat software issues in Domoticz. But in hindsight I think I would not have succeeded also because the inputs to SVT would vary too much in such a system: SVT would never be able to adjust to the quickly changing characteristics of the rooms each opening and closing their radiators unsynchronized. i.e. my suggestion to you: try it if you want to, but don't spend too much money on the components, because I don't think your chances of making this work to your liking are very high.
BUT, unless you also have a way of closing the radiators in each room, I don't think it will be very comfortable nor very energy efficient. Because the central boiler delivers heat to all rooms if at least one room requests the boiler to be On, you will most likely find that some rooms will get to hot and the boiler will be On much more than it used to be when you had only 1 SVT instance. You may even find it will be On 100% of the time, when the room's svt instances are out of sync. (1 zone switches on for 10s, then at the moment the 1st zone switches off, the 2nd zone requests heat for 10s, then when this switches off the 3rd zone requests heat for 10 seconds, etc and effectively the boiler will be On all the time)
I have tried making a multi zone system like you intend to with svt controlling the boiler, plus controlling the radiator valves in each room with eurotronic spirit Z thermostatic valves, but I never got it to work. This was mostly due to zwave thermostat software issues in Domoticz. But in hindsight I think I would not have succeeded also because the inputs to SVT would vary too much in such a system: SVT would never be able to adjust to the quickly changing characteristics of the rooms each opening and closing their radiators unsynchronized. i.e. my suggestion to you: try it if you want to, but don't spend too much money on the components, because I don't think your chances of making this work to your liking are very high.
-
- Posts: 18
- Joined: Wednesday 05 October 2022 2:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.2
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
The more I mull this over, the more it intrigues me. What would be expected to break if the "calculated power" percentage was used to set the heater power for the whole cycle, rather than converted to a duration?
-
- Posts: 18
- Joined: Wednesday 05 October 2022 2:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.2
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Does anyone else find SVT is too aggressive when it switches from economy to normal? As in, it always seems to select 100% heating for the first decision, rather than try a lower % and test how that works, even for a few tenths of a degree undershoot.
I've a system with fairly high inertia so picked a 45 min calculation cycle, but that's a long time to run the heater if it isn't needed that much. Would it be best to shorten the cycle length and hope it doesn't often run heating for less than two cycles, scale the % down, pause SVT and use another algorithm to bring the temperature up first, or something else?
I've a system with fairly high inertia so picked a 45 min calculation cycle, but that's a long time to run the heater if it isn't needed that much. Would it be best to shorten the cycle length and hope it doesn't often run heating for less than two cycles, scale the % down, pause SVT and use another algorithm to bring the temperature up first, or something else?
-
- Posts: 153
- Joined: Wednesday 02 October 2019 11:47
- Target OS: Linux
- Domoticz version: 2023.1
- Location: DE / BY / LT
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Frankly, I think the best you can do for your system is to use decent temp sensors, that read data in an fixed interval.
I moved to control my heating with DHT11 sensors in conjunction with ESP8266 boards that report data every 300 seconds.
After that, the range around the setpoint has reduced to +-0.2 degrees over-/undershoot with simple hysteresis and an inert floor heating.
No offense, but I think that is a lot better than fiddling with a piece of software that nobody really seems to understand and that tends to erratic decisions or dies unexpectedly, leaving you with a cold or overheated room.
I moved to control my heating with DHT11 sensors in conjunction with ESP8266 boards that report data every 300 seconds.
After that, the range around the setpoint has reduced to +-0.2 degrees over-/undershoot with simple hysteresis and an inert floor heating.
No offense, but I think that is a lot better than fiddling with a piece of software that nobody really seems to understand and that tends to erratic decisions or dies unexpectedly, leaving you with a cold or overheated room.
-
- Posts: 18
- Joined: Wednesday 05 October 2022 2:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.2
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
I've switched back to my hysteresis-based controller described in other posts on this site, but that actually uses only the ecodan's rather crude (0.5°c step) temperature sensor, but the room sensor connected to my Pi.thomasbaetge wrote: ↑Wednesday 23 November 2022 16:46 Frankly, I think the best you can do for your system is to use decent temp sensors, that read data in an fixed interval.
I moved to control my heating with DHT11 sensors in conjunction with ESP8266 boards that report data every 300 seconds.
After that, the range around the setpoint has reduced to +-0.2 degrees over-/undershoot with simple hysteresis and an inert floor heating.
Well, I didn't have it die unexpectedly and the decisions aren't erratic: they just don't seem very good because running the heater at 100% when 67% would suffice is a bit too much like setting fire to money right now!No offense, but I think that is a lot better than fiddling with a piece of software that nobody really seems to understand and that tends to erratic decisions or dies unexpectedly, leaving you with a cold or overheated room.
Is it that difficult to understand? The key calculation is
Code: Select all
power = round((self.setpoint - self.intemp) * self.Internals["ConstC"] +
(self.setpoint - self.outtemp) * self.Internals["ConstT"], 1)
I think the key problem I'm hitting is that I've a four-hour window to get from the economy setpoint to the normal one, a cycle time of 45 minutes and the above calculation is always going to try to return to the setpoint within one cycle, no matter how impossible it is. There's no way to tell this algorithm that I'm not in that much of a hurry.
Who is online
Users browsing this forum: No registered users and 1 guest