Yes it is, please check: https://github.com/999LV/SmartVirtualTh ... istory.txt
Python Plugin: Smart Virtual Thermostat
Moderator: leecollings
-
- Posts: 65
- Joined: Monday 25 March 2019 15:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Brunssum, Netherlands
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Raspberry Pi 4 With Domoticz - RFXCom - Tuya Wifi LED lights - Chuango Alarm - Zwave+ - Zigbee2MQTT - Anna Thermostat - Broadlink IR, P1 - Eufy Robo Vacuum - Worx Robo Mower
-
- Posts: 84
- Joined: Friday 12 August 2016 13:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Hello i have copied the files :To implement, copy files in the domoticz/plugins/SVT/viewer/ folder to the
domoticz/www/templates/ folder and reload/restart domoticz.
i see te new smart thermostats menu but it is empty how can i solve that
Gerwin
domoticz/www/templates/ folder and reload/restart domoticz.
i see te new smart thermostats menu but it is empty how can i solve that
Gerwin
-
- Posts: 5
- Joined: Sunday 02 May 2021 22:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Hi,
My heaters Switches are "off" when they heat
And "on" if stopped.
How to manage that with the plugin?
Thanks you for help..
Regards knasson
My heaters Switches are "off" when they heat
And "on" if stopped.
How to manage that with the plugin?
Thanks you for help..
Regards knasson
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Just create another heat switch that inverses the svt switch.knasson wrote:Hi,
My heaters Switches are "off" when they heat
And "on" if stopped.
How to manage that with the plugin?
Thanks you for help..
Regards knasson
Edit the svt heating switch in the GUI and put the code from this page in it: https://www.domoticz.com/wiki/Domoticz_ ... h_on.2Foff
-
- Posts: 5
- Joined: Sunday 02 May 2021 22:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Thank you Jake perfect!
Re: Python Plugin: Smart Virtual Thermostat
Hi. Guys please how check relay which turn On/Off boiler thermostat. How to make periodically check and sending to SVT thermostat or how to SVT thermostat should check all of his data (periodically) and send state to relay.
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
I don't fully understand your question, but svt only switches a (virtual) heating switch in domoticz, when the boiler is supposed to turn on/off. It is up to you as a user to connect it to a physical relay towards your boiler. SVT doesn't handle any communication from the boiler.Cdzn wrote:Hi. Guys please how check relay which turn On/Off boiler thermostat. How to make periodically check and sending to SVT thermostat or how to SVT thermostat should check all of his data (periodically) and send state to relay.
-
- Posts: 3
- Joined: Saturday 27 November 2021 17:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Hello,
2 weeks ago i have installed Domoticz on a raspberry pi in order to evaluate the capabilities as i am curious. I am currently using Home Assistant but i would like to have a look to this nice open source home automation.
So far so good: installation, adding some of my smart devices etc...
Regading the SVT, i am using it by controlling 2 inertia electrical convector NOIROT which have embedded thermostat as well. (in 1 bedroom and one room which is use as a office). Of course, i keep my current configuration with HA for the main living area: bedroom + Living room and kitchen.
After 5 days leaving the SVT in auto learning mode as described in the wiki, i am surprised by the results. I have some questions to be sure i have understood everything.
I noticed 3 points:
1. In the hardware configuration i have set "Apply minimum heating per cycle" at "only when heating required".
However, in the first days that even if the SETPOINT is reached ( i fix 20°C) the SVT will trigger ON the one actuator i have at the heater side but for only few minutes. as below:
My question, is it normal that even for very short period the SVT trigger the heater ON as i have defined in the hardware setting to trigger on when HEATING IS REQUIRED, or i am wrong ?
2. In the hardware setting page i have also setup :
- MINIMUM HEATING TIME IN PERCENTAGE BY CYCLE. I put 10%
- Periodic SVT calculation time at 30minutes.
and Whan i understand is: The minimum heating period will be 10% of 30min (3min) when HEATING is required which means under the SETPOINT that i setup at 20°C. However, during the auto-learning mode this value is never used.
Does it mean this configuration is used only when the auto learning is off ? What i noticed in the log is that WHEN HEATING is REQUIRED, SVT will trigger at max power during 30MIN. I have this behavior for already 5 days.
3. About the ConstantC and ConstantT. After this trial, i can see that the ConstantC is very very. By your experience is it normal to have such kind of high Value?
Will it be better if i setup the internal thermostat of both of my electrical convector 4 to 5°C up to SETPOINT specific in SVT ?
I hope that some of you have more expertise during several years than me on this plugin to have an objective answer
Thanks for your support.
2 weeks ago i have installed Domoticz on a raspberry pi in order to evaluate the capabilities as i am curious. I am currently using Home Assistant but i would like to have a look to this nice open source home automation.
So far so good: installation, adding some of my smart devices etc...
Regading the SVT, i am using it by controlling 2 inertia electrical convector NOIROT which have embedded thermostat as well. (in 1 bedroom and one room which is use as a office). Of course, i keep my current configuration with HA for the main living area: bedroom + Living room and kitchen.
After 5 days leaving the SVT in auto learning mode as described in the wiki, i am surprised by the results. I have some questions to be sure i have understood everything.
I noticed 3 points:
1. In the hardware configuration i have set "Apply minimum heating per cycle" at "only when heating required".
However, in the first days that even if the SETPOINT is reached ( i fix 20°C) the SVT will trigger ON the one actuator i have at the heater side but for only few minutes. as below:
Code: Select all
2021-12-06 14:41:25.090 Status: Thermostat: (Thermostat) Next calculation time will be : 2021-12-06 15:11:25.089578
2021-12-06 14:41:25.138 Status: Thermostat: (Thermostat) Temperatures: Inside = 20.1 / Outside = 7.6
2021-12-06 14:41:25.139 Status: Thermostat: (Thermostat) New calc for ConstT = 1.7004097903438664
2021-12-06 14:41:25.139 Status: Thermostat: (Thermostat) ConstT updated to 4.9
2021-12-06 14:41:25.139 Status: Thermostat: (Thermostat) Calculation: Power = 18.2 -> heat duration = 5 minutes
2. In the hardware setting page i have also setup :
- MINIMUM HEATING TIME IN PERCENTAGE BY CYCLE. I put 10%
- Periodic SVT calculation time at 30minutes.
and Whan i understand is: The minimum heating period will be 10% of 30min (3min) when HEATING is required which means under the SETPOINT that i setup at 20°C. However, during the auto-learning mode this value is never used.
Does it mean this configuration is used only when the auto learning is off ? What i noticed in the log is that WHEN HEATING is REQUIRED, SVT will trigger at max power during 30MIN. I have this behavior for already 5 days.
Code: Select all
2021-12-06 13:10:55.147 Status: Thermostat: (Thermostat) Temperatures: Inside = 19.9 / Outside = 7.1
2021-12-06 13:10:55.148 Status: Thermostat: (Thermostat) New calc for ConstT = 8.520338367556864
2021-12-06 13:10:55.148 Status: Thermostat: (Thermostat) ConstT updated to 5.5
2021-12-06 13:10:55.148 Status: Thermostat: (Thermostat) Calculation: Power = 100 -> heat duration = 30 minutes
2021-12-06 13:10:55.187 Status: User: Admin (IP: 127.0.0.1) initiated a switch command (15/Sonoff Pow R2 - Heater/On)
2021-12-06 13:41:15.053 Status: Thermostat: (Thermostat) Next calculation time will be : 2021-12-06 14:11:15.052878
2021-12-06 13:41:15.103 Status: Thermostat: (Thermostat) Temperatures: Inside = 20.0 / Outside = 7.2
2021-12-06 13:41:15.103 Status: Thermostat: (Thermostat) New calc for ConstC = 429.79469056766663
2021-12-06 13:41:15.103 Status: Thermostat: (Thermostat) ConstC updated to 426.0
2021-12-06 13:41:15.103 Status: Thermostat: (Thermostat) Calculation: Power = 70.4 -> heat duration = 21 minutes
2021-12-06 13:56:25.106 Status: Incoming connection from: 127.0.0.1
2021-12-06 14:02:25.105 Status: User: Admin (IP: 127.0.0.1) initiated a switch command (15/Sonoff Pow R2 - Heater/Off)
2021-12-06 14:11:15.084 Status: Thermostat: (Thermostat) Next calculation time will be : 2021-12-06 14:41:15.084039
2021-12-06 14:11:15.134 Status: Thermostat: (Thermostat) Temperatures: Inside = 20.2 / Outside = 7.4
2021-12-06 14:11:15.134 Status: Thermostat: (Thermostat) New calc for ConstT = -1.156170857187476
2021-12-06 14:11:15.134 Status: Thermostat: (Thermostat) ConstT updated to 5.1
2021-12-06 14:11:15.135 Status: Thermostat: (Thermostat) Calculated power is 0, applying minimum power of 10
2021-12-06 14:11:15.135 Status: Thermostat: (Thermostat) Calculation: Power = 10 -> heat duration = 3 minutes
2021-12-06 14:11:15.183 Status: User: Admin (IP: 127.0.0.1) initiated a switch command (15/Sonoff Pow R2 - Heater/On)
2021-12-06 14:14:25.112 Status: User: Admin (IP: 127.0.0.1) initiated a switch command (15/Sonoff Pow R2 - Heater/Off)
Code: Select all
{'ConstC': 426.0, 'ConstT': 4.9, 'nbCC': 5, 'nbCT': 22, 'LastPwr': 100, 'LastInT': 19.4, 'LastOutT': 6.0, 'LastSetPoint': 20.0, 'ALStatus': 1}
I hope that some of you have more expertise during several years than me on this plugin to have an objective answer
Thanks for your support.
-
- 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
It is my believe that the constT offset calculation is wrong. This constT should be a correction for differences in the outside temperature. But in reality it changes far too fast and by doing so it causes the constC calculation to go wrong: it grows far to high. As you've noticed too. That high constC value is what causes your power to go from 0 to 100%, at 100% power your room will overheat and until the room has cooled down your power will be at 0% again. Effectively the thermostat works like an on-of thermostat.
I don't know how to fix the constT bug yet. But I do know a workaround: remove the idx for the outside temperature sensor. The svt will then no longer calculate the constT and the constC calculation will no longer be influenced by the bug.
You still need to reset your high constC value or it will take a very long time to fall to a more reasonable value. To reset your constC value, disable the svt hardware, then edit the user variable to constC 60 and it's counter to 1, so it learns as fast as possible. Now re-enable the svt hardware and it will restart itself with the new constC value. The value for constT and it's counter are no longer used if you leave the outside temperature sensor idx empty so you don't need to edit these.
There is another thing I did, but this requires you to edit the plugin code. The plugin.py code has 2 things I didn't like
1- the code has a delta value of 0.2 degrees( in later versions it was raised a little but still not enough), which makes that the thermostat can't overshoot more than .2 degrees over the setpoint. This is actually a bug as the mechanism needs to make errors to learn the correct constC. I changed it to a much higher value. I think I used 5 degrees.
2- the constC value is rounded to 2 decimals, the error can however be much smaller and this rounding causes the constC calculation to be less accurate resulting in it bouncing around the proper value for your room & heating. I have removed the rounding completely resulting in much better behavior of the thermostat.
I don't know how to fix the constT bug yet. But I do know a workaround: remove the idx for the outside temperature sensor. The svt will then no longer calculate the constT and the constC calculation will no longer be influenced by the bug.
You still need to reset your high constC value or it will take a very long time to fall to a more reasonable value. To reset your constC value, disable the svt hardware, then edit the user variable to constC 60 and it's counter to 1, so it learns as fast as possible. Now re-enable the svt hardware and it will restart itself with the new constC value. The value for constT and it's counter are no longer used if you leave the outside temperature sensor idx empty so you don't need to edit these.
There is another thing I did, but this requires you to edit the plugin code. The plugin.py code has 2 things I didn't like
1- the code has a delta value of 0.2 degrees( in later versions it was raised a little but still not enough), which makes that the thermostat can't overshoot more than .2 degrees over the setpoint. This is actually a bug as the mechanism needs to make errors to learn the correct constC. I changed it to a much higher value. I think I used 5 degrees.
2- the constC value is rounded to 2 decimals, the error can however be much smaller and this rounding causes the constC calculation to be less accurate resulting in it bouncing around the proper value for your room & heating. I have removed the rounding completely resulting in much better behavior of the thermostat.
-
- Posts: 6
- Joined: Monday 28 March 2016 11:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Hi
I want to start using this amazing plugin in domoticz, so I am on the latest version of domoticz.
I followed the installation steps. but under hardware the virtual thermostat is not there.
any body have an idea what I do wrong?
thanks
I want to start using this amazing plugin in domoticz, so I am on the latest version of domoticz.
I followed the installation steps. but under hardware the virtual thermostat is not there.
any body have an idea what I do wrong?
thanks
-
- Posts: 6
- Joined: Monday 28 March 2016 11:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
found it... was ovelooking it.
-
- Posts: 39
- Joined: Tuesday 24 May 2016 22:39
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
I don't know if plugin maintenance is still working, or if someone would dare to fork, but I have a few questions:
-Making tests to check how long a radiator takes to heat up, I have put the thermostat in FORCED mode. When deactivating it, it does not turn off the radiator even if the setpoint has been exceeded by a long time. It is normal? A bug?
-I have a small radiator in the bathroom and I intend to use the plugin to keep it at a comfortable temperature without spending a lot of electricity. The radiator fulfills the function of maintaining the temperature and I hope that once the plugin learns it will do so efficiently. The problem is that although the radiator is more than enough to keep the bathroom warm, it costs more to raise the temperature. For that I intend to use an auxiliary heater, but I understand that if I use it with the active pluin it will break the learning in some way.
Does forced mode cancel learning? I mean, can I activate a little script in blockly that activates forced mode and auxiliary heater without breaking anything? Or should the script turn off the plugin and then turn on the auxiliary heater?
My idea would be: when going to shower, activate the "shower mode" that would turn off the plugin (or put it in FORCED mode), turn on the auxiliary heater, and once the desired temperature is reached, turn off the auxiliary heater and turn the plugin back on. . But I don't want to break the learning in the wrong direction.
-Making tests to check how long a radiator takes to heat up, I have put the thermostat in FORCED mode. When deactivating it, it does not turn off the radiator even if the setpoint has been exceeded by a long time. It is normal? A bug?
-I have a small radiator in the bathroom and I intend to use the plugin to keep it at a comfortable temperature without spending a lot of electricity. The radiator fulfills the function of maintaining the temperature and I hope that once the plugin learns it will do so efficiently. The problem is that although the radiator is more than enough to keep the bathroom warm, it costs more to raise the temperature. For that I intend to use an auxiliary heater, but I understand that if I use it with the active pluin it will break the learning in some way.
Does forced mode cancel learning? I mean, can I activate a little script in blockly that activates forced mode and auxiliary heater without breaking anything? Or should the script turn off the plugin and then turn on the auxiliary heater?
My idea would be: when going to shower, activate the "shower mode" that would turn off the plugin (or put it in FORCED mode), turn on the auxiliary heater, and once the desired temperature is reached, turn off the auxiliary heater and turn the plugin back on. . But I don't want to break the learning in the wrong direction.
-
- 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
The svt doesn't learn while in forced, off or paused mode. So theoretically switching svt to off or forced mode while applying the additional heat source would be a good way to add some heat in the rooom without affecting the constc learning. In practive however I wouldn't know how the svt will respond. As you indicate yourself the svt has some practical shortcomings. I'd say give it a try and let us know.
Can you share with us what your intentions are measuring the time for the radiator to heat up? I'm curious to know how that information relates to anything we can configure in svt?
Can you share with us what your intentions are measuring the time for the radiator to heat up? I'm curious to know how that information relates to anything we can configure in svt?
-
- 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
I don't know if it is a bug or by design (although in my opinion it's a bug), but it's caused by this bit of code in onCommand():
Code: Select all
if Unit in (1, 2, 4, 5): # force recalculation if control or mode or a setpoint changed
self.nextcalc = now
self.learn = False
self.onHeartbeat()
Sorry, I somehow misread your text that you used Pause mode to stop the heating, and for that the missing 3 is an explanation, not for force mode.
-
- Posts: 39
- Joined: Tuesday 24 May 2016 22:39
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Well, last week I did tests with the SVT, and I intended to continue testing and experimenting. But, thanks to the wonders of global warming, in Spain this year we have apparently only had a cold week. Right now the bathroom temperature does not drop below 19.5 degrees with the heating off, so I have to wait to continue testing.rrozema wrote: ↑Tuesday 28 December 2021 12:44 The svt doesn't learn while in forced, off or paused mode. So theoretically switching svt to off or forced mode while applying the additional heat source would be a good way to add some heat in the rooom without affecting the constc learning. In practive however I wouldn't know how the svt will respond. As you indicate yourself the svt has some practical shortcomings. I'd say give it a try and let us know.
Can you share with us what your intentions are measuring the time for the radiator to heat up? I'm curious to know how that information relates to anything we can configure in svt?
-
- Posts: 39
- Joined: Tuesday 24 May 2016 22:39
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
Well, after a drop in temperature in my area I am about to test the plugin.
I think this is beyond my abilities, because after looking at the log I don't understand anything about what is happening.
My settings:
1 outdoor temperature sensor.
2 sensors inside the bathroom.
1 electric radiator. It is not extremely powerful, but it has a respectable thermal performance.
After testing the radiator, I have come to the conclusion that for it to get hot enough to affect the surroundings and gain some inertia, it needs a minimum of 8 minutes on. Turning it on less is wasting energy.
So I have configured the following: 30,25,2,1,45,0.9
Min. Heatig = Calc. Cycle = 30, Heating time = 25 (8 minutes), Delta MAx = 0.9.
I have the setpoint at 21.5 degrees. So far, I think everything is OK. the problem is that the temperature does not rise. And that the pace was slow would not surprise me, but looking at the log I do not understand anything:
What am I missing? I do not understand?
I think this is beyond my abilities, because after looking at the log I don't understand anything about what is happening.
My settings:
1 outdoor temperature sensor.
2 sensors inside the bathroom.
1 electric radiator. It is not extremely powerful, but it has a respectable thermal performance.
After testing the radiator, I have come to the conclusion that for it to get hot enough to affect the surroundings and gain some inertia, it needs a minimum of 8 minutes on. Turning it on less is wasting energy.
So I have configured the following: 30,25,2,1,45,0.9
Min. Heatig = Calc. Cycle = 30, Heating time = 25 (8 minutes), Delta MAx = 0.9.
I have the setpoint at 21.5 degrees. So far, I think everything is OK. the problem is that the temperature does not rise. And that the pace was slow would not surprise me, but looking at the log I do not understand anything:
- Spoiler: show
What am I missing? I do not understand?
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
In your log I see that the ConstC value is 0. This means that the delta temperature (setpoint- inside temperature) is multiplied with 0, resulting in 0, meaning no influence on the hearing duration.
Solution: update the user variable of svt by changing the ConstC to 20 for a start. Then go to hardware in domoticz, select the svt and click on 'update'. This will restart the plugin and read the values from the user variable. This is important, without restarting the plugin will overwrite the user variable at the next heating interval.
Solution: update the user variable of svt by changing the ConstC to 20 for a start. Then go to hardware in domoticz, select the svt and click on 'update'. This will restart the plugin and read the values from the user variable. This is important, without restarting the plugin will overwrite the user variable at the next heating interval.
-
- Posts: 39
- Joined: Tuesday 24 May 2016 22:39
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
done, thanks for the help.
It seems that now the calculation is more correct. We will see how it works in the long term.
any idea how it could go to 0?
It seems that now the calculation is more correct. We will see how it works in the long term.
any idea how it could go to 0?
- Spoiler: show
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python Plugin: Smart Virtual Thermostat
I think that the recalculation algorithm is far from perfect. In my case the constT ended up with a negative value, totally impossible, the cooler it would be outside, the less best was required..... according SVT.
I made some adaptions trip the constT calculation and will let it go for a week or what to see if it performs well.
My way of reasoning now:
The heating is on for a certain percentage with the idea to reach setpoint.
At the next calculation I check the reached temperature.
When it differs from the setpoint, I make the same calculation, with the reached temperature acting as setpoint. My chosen variable is than constT, keeping the same heating percentage as a result.
This results in the 'perfect' constT value that matches with the calculated power and the reached temperature.
I have kept the averaging part of the calculation to smooth out big steps in constT results.
So far the results are ok, only slight adjustments to ConstT. Tonight the temperature dropped 0.3 degrees under the setpoint, so I sped up the learning process today by manually increasing the constT value
I made some adaptions trip the constT calculation and will let it go for a week or what to see if it performs well.
My way of reasoning now:
The heating is on for a certain percentage with the idea to reach setpoint.
At the next calculation I check the reached temperature.
When it differs from the setpoint, I make the same calculation, with the reached temperature acting as setpoint. My chosen variable is than constT, keeping the same heating percentage as a result.
This results in the 'perfect' constT value that matches with the calculated power and the reached temperature.
I have kept the averaging part of the calculation to smooth out big steps in constT results.
So far the results are ok, only slight adjustments to ConstT. Tonight the temperature dropped 0.3 degrees under the setpoint, so I sped up the learning process today by manually increasing the constT value
-
- 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
The source code for SVT has a sub folder called "viewer" with 2 files "Smart Thermostats.html" and "svt_viewer.js" in it. What are these files used for? I was hoping they could be opened from the "Custom" menu, but if this is what they are intended for, I haven't found how to activate them yet.
Who is online
Users browsing this forum: No registered users and 1 guest