Page 1 of 21
Python Plugin: Smart Virtual Thermostat
Posted: Thursday 14 September 2017 13:20
by blauwebuis
So I just discovered the Smart Virtual Thermostat plugin. It looks amazing.
"Easily implement in Domoticz an advanced virtual thermostat based on time modulation and self learning of relevant room thermal characteristics (including insulation level) rather than more conventional hysteresis methods, so as to achieve a greater comfort. It is a port to Domoticz of the original Vera plugin from Antor"
https://www.domoticz.com/wiki/Plugins/S ... ostat.html
Has anyone tried working with it?
While in beta it's already come quite some way and is actively being developed by @Logread:
Version: 0.0.1: alpha
0.0.2: beta, with new connection object from Domoticz Python plugin framework
0.0.3: bug fixes + added thermostat temp update even if in Off or Forced modes
0.0.4: more logging parameters
0.1.0: Use the standard urllib.request module to call the Domoticz API due to ongoing changes to
the Domoticz.Connection method
0.1.1: Address strange behavior of python plugin framework where no more than a couple of devices can be
created and updated in one pass in the same function... so devices are created in "OnStart()" as
required but are only updated after all required devices are created
0.2.0: First incremental update:
- Code cleanup for calls to Domoticz API
- Timeout for temperature sensors, based on Domoticz preferences setting
0.2.1: Fixed possible TypeError in datetime.strptime method in embedded Python
(known python 3.x bug, see
https://bugs.python.org/issue27400)
0.3.0: Fixed major bug in auto-learning + cosmetic improvements
0.3.1: Force immediate recalculation when setpoint changes
Re: Python Plugin: Smart Virtual Thermostat
Posted: Thursday 14 September 2017 14:36
by Logread
blauwebuis wrote: ↑Thursday 14 September 2017 13:20
So I just discovered the Smart Virtual Thermostat plugin. It looks amazing.
[...]
While in beta it's already come quite some way and is actively being developed by @Logread:
Many thanks for your interest and kind note... I am indeed developing this plugin and prepared for a public release (hence the wiki entry) once I had a chance to thoroughly test it now that the heating season is coming in the northern hemisphere. But you spotted it before that
Testers welcome !!!
Re: Python Plugin: Smart Virtual Thermostat
Posted: Thursday 14 September 2017 15:39
by woody4165
Hi Logread
Just installed as written in the wiki, but I don't see it in the HW List.
Should I change anything in python script?
Restarted Domoticz and cleared the browser cache.
I've also tried a "clean" browser, but no way.
I see a Thermosmart Thermostat but shouldn't be yours, right?
Thanks
Re: Python Plugin: Smart Virtual Thermostat
Posted: Thursday 14 September 2017 16:03
by Logread
@woody4165,
Did you indeed install the plugin.py file in a directory named SVT in the domoticz/plugins/ directory and make it executable ? the plugin should appear in the hardware list as "Smart Virtual Thermostat".
Otherwise may be you are running a very recent beta version of domoticz ? python plugins have been deactivated since August 26 pending some fixes by the developers.
Re: Python Plugin: Smart Virtual Thermostat
Posted: Thursday 14 September 2017 16:10
by woody4165
Ops, so no more python plugin in latest beta...
I didn't know it.
Yes, I am on very latest beta
I'll wait for reactivation and then I will try it...
Thanks
Re: Python Plugin: Smart Virtual Thermostat
Posted: Friday 15 September 2017 0:19
by blauwebuis
Waiting for that too

But then I will try this!
@logread: I just came across this, might be interesting:
https://genetx.tweakblogs.net/blog/1271 ... slim-maken
Re: Python Plugin: Smart Virtual Thermostat
Posted: Friday 15 September 2017 9:57
by Logread
Thanks @blauwebuis, I cannot read Dutch but I had a quick look at the code and it seems to rely on the same principle with the addition of cooling (which I am planning to add at a later point, though I do not need it for my own) and a few interesting tweaks that I need to digest a bit. Note that a similar plugin has also been developed for Jeedom but it does not seem to be open source.
Re: Python Plugin: Smart Virtual Thermostat
Posted: Tuesday 19 September 2017 16:12
by Logread
if anyone interested to test this plugin (assuming you run a version of domoticz with the python plugin framework enabled, i.e. not a beta built later than Aug. 26th), I committed version 0.3.3 on Github. Looking for testers and feedback
Again installation and instructions are at
https://www.domoticz.com/wiki/Plugins/S ... ostat.html
Re: Python Plugin: Smart Virtual Thermostat
Posted: Friday 22 September 2017 9:45
by Peggy
I'm following this thread as I start controlling my house with max! cube valves, and a main ON/OFF thermostat on the boiler. Playing with all this will be a nice challenge.
Can you explain "assuming you run a version of domoticz with the python plugin framework enabled, i.e. not a beta built later than Aug. 26th"? I do use a recent build, what's the problem?
Re: Python Plugin: Smart Virtual Thermostat
Posted: Friday 22 September 2017 10:27
by woody4165
From versions later than that date, Python plugins have been disabled in Domoticz pending some fixes by the developers.
It was written in one on the post in this thread, answering my question similar to your ....

Re: Python Plugin: Smart Virtual Thermostat
Posted: Friday 22 September 2017 11:48
by Peggy
oups, my bad

Re: Python Plugin: Smart Virtual Thermostat
Posted: Saturday 23 September 2017 21:53
by credenty
how can you install on windows?
Re: Python Plugin: Smart Virtual Thermostat
Posted: Sunday 24 September 2017 8:12
by Logread
credenty wrote: ↑Saturday 23 September 2017 21:53
how can you install on windows?
I don't know, but did you search the forum about installing python plugins on that OS ? I would expect that you can locate from the file manager the base folder of domoticz and then its 'plugins' sub-directory... there you should create the ´SVT' sub-directory and drop the ´plugin.py' in it (having downloaded it from GitHub obviously). This is not relying on any command line method since I do not know how to install git on windows. Hope this helps.
PS: you can run a Linux shell on some recent windows 10 versions. the instructions in the wiki would then work, but need to be adapted to the domoticz directory structure in windows.
Re: Python Plugin: Smart Virtual Thermostat
Posted: Sunday 24 September 2017 12:09
by MarnixO
I have installed the script on a synology ds216j with phyton 3 installed
The script dont show up in the hardware list , any idee ?
Re: Python Plugin: Smart Virtual Thermostat
Posted: Sunday 24 September 2017 14:41
by Logread
Windows and Synology users, while I appreciate your interest in the plugin, I cannot help you with set up instructions for your platforms and I kindly suggest you open or check forum threads relevant to installing python plugins with your platforms. My test and production systems are all on linux (physical or virtual) machines.
Re: Python Plugin: Smart Virtual Thermostat
Posted: Saturday 30 September 2017 11:18
by Electrocut
Great idea to have developed a Thermostat plugin for Domoticz

That was really a missing feature in Domoticz.
For the time being, I was controlling my heater with a simple lua script.
3 modes: Comfort (= day), Eco (= night), Standby (= vacations).
- In "Comfort mode", heater relay is always on (my heater regulates the water temperature automatically, according to the external temperature, to get around 19°C ambient)
- In Eco and Standby, I'm controlling the heater relay with an hysteresis, to reduce the ambient temperature (to 17 and 15°C)
I have installed the plugin (Latest Domoticz beta 3.8450 on RaspberryPi2), and tried it around 5 minutes. It seems to work

With Domoticz stable 3.8153, Domoticz was crashing with segfault during autostart (cf.
this post).
In a few weeks, temperature will be colder in France, and I will start using the plugin in "Auto" mode. Let's see

Re: Python Plugin: Smart Virtual Thermostat
Posted: Saturday 30 September 2017 14:41
by Logread
@Electrocut,
Thanks for the heads up... bear in mind you will need 2 to 3 days of ‘auto’ mode operation for the autolearning to work (insulation and thermal coefficients). Also, while 30 minutes (for electric convectors) or 60+ minutes (central heating boiler) calculation intervals are given as guidance, you may need to tailor that to your needs... Please do share your feedback on this and if I can help pls reach out to me by pm (in French will do

)
Re: Python Plugin: Smart Virtual Thermostat
Posted: Saturday 30 September 2017 18:36
by Antori91
Hello Logread,
For electric heaters with their own thermostat, has your smart virtual thermostat the objectives to do better job? If yes, in which areas : energy saving, better temperature control, ...
Re: Python Plugin: Smart Virtual Thermostat
Posted: Saturday 30 September 2017 18:50
by Logread
Antori91 wrote: ↑Saturday 30 September 2017 18:36
Hello Logread,
For electric heaters with their own thermostat, has your smart virtual thermostat the objectives to do better job? If yes, in which areas : energy saving, better regulation, ...
Well, it is not « my » thermostat, but a port to domoticz of a Vera plugin that I found through my experience in my vacation place to offer better regulation / comfort than the built in thermostat of electrical heaters... but this is empirical more than anything else... no commitment, no bragging from me and I am only making this plugin public in the hope others can find it useful.
Re: Python Plugin: Smart Virtual Thermostat
Posted: Sunday 01 October 2017 16:18
by Electrocut
Logread wrote: ↑Saturday 30 September 2017 14:41
@Electrocut,
Thanks for the heads up... bear in mind you will need 2 to 3 days of ‘auto’ mode operation for the autolearning to work (insulation and thermal coefficients).
You are welcome
Also, while 30 minutes (for electric convectors) or 60+ minutes (central heating boiler) calculation intervals are given as guidance, you may need to tailor that to your needs...
You are right. For the time being, I have set calculation intervals to 60 minutes, but I suppose I will have to increase that value:
in my house, ambient temperature increase very slowly when the heater is on (low temperature heater + climate regulation based on external temperature).
Please do share your feedback on this and if I can help pls reach out to me by pm (in French will do

)
I will keep you updated
