Python Plugin: Smart Virtual Thermostat

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
blauwebuis
Posts: 331
Joined: Wednesday 21 December 2016 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: current
Contact:

Python Plugin: Smart Virtual Thermostat

Post 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
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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 :D :oops:
Testers welcome !!!
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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.
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
blauwebuis
Posts: 331
Joined: Wednesday 21 December 2016 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: current
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Logread »

blauwebuis wrote: Friday 15 September 2017 0:19 @logread: I just came across this, might be interesting:
https://genetx.tweakblogs.net/blog/1271 ... slim-maken
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.
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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
Peggy
Posts: 32
Joined: Saturday 09 September 2017 23:38
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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?
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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 .... ;)
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
Peggy
Posts: 32
Joined: Saturday 09 September 2017 23:38
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Peggy »

oups, my bad Image
credenty
Posts: 16
Joined: Saturday 12 November 2016 11:07
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by credenty »

how can you install on windows?
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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.
MarnixO
Posts: 18
Joined: Sunday 24 September 2017 12:02
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10199
Location: Destelbergen Belgium
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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 ?
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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.
Electrocut
Posts: 22
Joined: Sunday 04 May 2014 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Electrocut »

Great idea to have developed a Thermostat plugin for Domoticz 8-)
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 :mrgreen:
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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 :D )
User avatar
Antori91
Posts: 136
Joined: Sunday 12 February 2017 17:12
Target OS: NAS (Synology & others)
Domoticz version: 4.10717
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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, ...
Domoticz High Availability Cluster: Synology Dz V4.10693 (Main) - Raspberry Dz V4.10717 (Backup) - Scripts Node.js
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation
Logread
Posts: 228
Joined: Sunday 28 August 2016 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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.
Electrocut
Posts: 22
Joined: Sunday 04 May 2014 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post 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 :D )
I will keep you updated ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest