Python Plugin: Smart Virtual Thermostat

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
garethhowell
Posts: 115
Joined: Tuesday 17 November 2015 21:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9317
Location: St Neots, UK
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by garethhowell »

It seems to be, yes. However, by compiling from source the build takes into account the specific library versions you have available.

I'm guessing that the python3 libraries changed their interface at some point and that the reference machine on which the binary distributables are built has a version that has a slightly different interface to the current 3.5.*
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by renerene »

Just found this software: GREAT.

But it is not working on V3.8823 (beta): no 'smart thermostat' visible in hardware pull down list
wiki shell procedure went well

Do I need to repeat the shell procedure for future updates in your script or after Domoticz updates?
Which Domoticz version do you recommend?
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Wob76 »

Hi Logread,

Just wondering if you have explored adding cooling yet, I was it mentioned early in the thread? I followed your thread awhile ago but I was hoping for something to do both heat and cool, I am in the MUCH warmer part of the year at the moment (Australia). I currently have a very basic heating\cooling script that just turns on\off based on the active zone temperatures. It controls Zone state and System ON\OFF to keep inside a target range, it works, but very basic, and only uses the AC's Heat and Cool function, I would like to incorporate the Dehumidifier function, and maybe even the Fan function, but despite my best efforts I haven't been able to find where to start for some smart cooling, I found a few formulas for Humidex, Dew Point, etc, but no good guides on when to activate cooling\dry\etc, so something that would learn like your heating script would be great.

Thanks,
Wob
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 »

renerene wrote: Thursday 18 January 2018 7:58 Just found this software: GREAT.
Thank you :D
renerene wrote: Thursday 18 January 2018 7:58 But it is not working on V3.8823 (beta): no 'smart thermostat' visible in hardware pull down list
wiki shell procedure went well
Seems some users are having this issue with python plugins in latest betas, but not sure a solution has been found: see viewtopic.php?f=65&t=21379
I am running the plugin on my two productions systems with domoticz version 3.8564 without problems and may be more recent betas work as well ?
renerene wrote: Thursday 18 January 2018 7:58 Do I need to repeat the shell procedure for future updates in your script or after Domoticz updates?
The procedure for plugin updates is described in the wiki (end of article). Domoticz updates should not require any action for the plugin.
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 »

Wob76 wrote: Thursday 18 January 2018 12:27 Just wondering if you have explored adding cooling yet
Not yet ... I have been too busy to find time to work on that and heating was my priority in cold France... plus I'll need testers, but I trust you will volunteer ?
Let me think about it. Needs significant coding work so will take some time :(
Bear with me please
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Quax1507 »

I am willing to test cooling, too :D
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by renerene »

renerene wrote: Thursday 18 January 2018 7:58 But it is not working on V3.8823 (beta): no 'smart thermostat' visible in hardware pull down list
wiki shell procedure went well
Seems some users are having this issue with python plugins in latest betas, but not sure a solution has been found: see viewtopic.php?f=65&t=21379
I am running the plugin on my two productions systems with domoticz version 3.8564 without problems and may be more recent betas work as well ?
UPDATE:
after this line it works, Hardware is visible now

Code: Select all

# Domoticz Beta versions since V3.6129 also require...
sudo apt-get install -y python3-dev
source: https://www.domoticz.com/wiki/Using_Python_plugins


Next week I start testing ;-)
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by renerene »

Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Wob76 »

Logread wrote: Thursday 18 January 2018 15:08
Wob76 wrote: Thursday 18 January 2018 12:27 Just wondering if you have explored adding cooling yet
Not yet ... I have been too busy to find time to work on that and heating was my priority in cold France... plus I'll need testers, but I trust you will volunteer ?
Let me think about it. Needs significant coding work so will take some time :(
Bear with me please
Definitely happy to help test. I don't know python, otherwise I would offer to help code. All my scripts are currently in dzVents.

Also happy to read up if you could point me to some data on formulas\coefficients for cooling, I have been looking but haven't found much.

Edit:
Just looking for more information on how to monitor the environment, humidex is one that keeps popping, this is the most interesting read I have found to date, they lost me on some of the formulas, but thought it might be useful.
https://publications.csiro.au/rpr/downl ... 6&dsid=DS1
mphilipp
Posts: 6
Joined: Thursday 29 December 2016 15:58
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Rotterdam, Netherlands
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by mphilipp »

Interesting work!
Wonder if this plugin is also suited for my setup (I hope this is not a stupid question)
I have a modulating heater (Remeha) and an OpenTherm thermostat in the living room to control it. It's not a smart thermostat, but has the usual static programming options. The thermostat enables me to override the programmed temp and it displays the operation of the heater. Domoticz is connected to the heater through the OpenTherm Gateway and I can override the setpoint of the thermostat. I can't, however, change the program. On the thermostat I can make different programs (program A and B and an optional holiday schedule with from/to dates) but I can only select those programs through the thermostat, not from Domoticz.

Now my question is: will this plugin work for me? I can set the setpoint from Domoticz, but I can't switch the heater on/off. It's a modulating heater/thermostat combo, so it will decide by itself when to start heating and at which level (which I can see in Domoticz too). Could I enable this plugin and bypass the thermostat? Do I have to disconnect the thermostat or could I render it useless by not entering any program? Because if change the setpoint from Domoticz, it is displayed on the thermostat and it will only interfere when the next programming block becomes active. I guess when I don't enter any program, it is just a device to show the actual setpoint and room temperature.
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 »

@mphilipp,

The plugin has been designed to drive on/off heaters (and possibly coolers if I find the time to work on this). Unless you are very dissatisfied with your current setup, I think trying to hack it for using the plugin will be difficult if at all possible and may not yield good results.
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by renerene »

How to program the thermostate using time blocks?
I'm thinking about writing my own Lua, or use the Weekly Programming method (http://www.domoticz.com/forum/viewtopic ... 46#p167046). With Lua I will be more flexible on programming when to start the boiler in the morning, so it it is warm when I wake up. Therefore I need to be sure: does the Smart Virtual Thermostat think ahead?
Let's say the 'setvalue' device goes from 17 to 20 degrees at 7:00 AM --> does Smart Virtual Thermostat start heating at 7:00 AM , or earlier (5:00 AM), start time depending on house (and outside) temperature?
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 »

renerene wrote: Saturday 20 January 2018 16:23 Therefore I need to be sure: does the Smart Virtual Thermostat think ahead?
No...
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: Thursday 30 November 2017 18:51 @etampes,

Thznks for posting the log... I’ll look into this... bear with me pls

EDIT: @etampes,
I just pushed a new version that should fix the bug you uncovered. I indeed think it is related to the fact you have no outside temperature sensor in your setup. Can you please update to version 0.3.6 (use update instructions from the wiki) and report if this has fixed the bug ?
Thanks
Same bug for me this night, because my outside temp sensor has stop working for some hours.
I was still on the 0.3.5 version.

Code: Select all

2018-02-05 01:30:08.634 Error: (Thermostat) skipping timed out temperature sensor Température Extérieure
2018-02-05 01:30:08.639 Error: (Thermostat) 'onHeartbeat' failed 'TypeError':'unorderable types: float() > NoneType()'.
2018-02-05 01:30:08.639 Error: (Thermostat) ----> Line 503 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function onHeartbeat
2018-02-05 01:30:08.639 Error: (Thermostat) ----> Line 288 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function onHeartbeat
2018-02-05 01:30:08.639 Error: (Thermostat) ----> Line 306 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function AutoMode
2018-02-05 01:30:08.639 Error: (Thermostat) ----> Line 362 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function AutoCallib
2018-02-05 02:00:09.004 Error: (Thermostat) skipping timed out temperature sensor Température Extérieure
2018-02-05 02:00:09.008 Error: (Thermostat) 'onHeartbeat' failed 'TypeError':'unorderable types: float() > NoneType()'.
2018-02-05 02:00:09.008 Error: (Thermostat) ----> Line 503 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function onHeartbeat
2018-02-05 02:00:09.008 Error: (Thermostat) ----> Line 288 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function onHeartbeat
2018-02-05 02:00:09.008 Error: (Thermostat) ----> Line 306 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function AutoMode
2018-02-05 02:00:09.009 Error: (Thermostat) ----> Line 362 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function AutoCallib
Let's go for a "git pull" to upgrade to latest version ;)
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 »

By the way, I get this error even when the thermostat is "Off".
opentoideas
Posts: 14
Joined: Friday 02 March 2018 16:31
Target OS: Windows
Domoticz version: 3.8153
Location: Bristol UK
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by opentoideas »

Hi, first off thank you for this plugin. I have just started down the road of working with Domiticz and a pile of Sonoff devices loaded with tasmota and have not been looking forward to working out a thermostat solution from scratch!

It has been an interesting learning curve as my Domoticz is running windows as I already have a server for media so it made sense to add Domitics to this and with a bit of perseverance I have it working as a test so all is good.

I do have a couple of general questions if you have a chance though and if I can be of any help testing then I am more than happy to assist in any way I can.

I will be trying to control a 2 zone heating area.

Each zone will have a thermostat and when heat is needed I will need to switch a zone valve and common switch for the boiler.

Would this be best done with 2 seperate instances of the SVT? Or is there a different way to deal with zones?

I also have another heated area that will be all automated. Is it possible to set the thermostat mode based on another switch? So if "switch" is on mode is normal and if "switch" is off then mode is economy?

Can accomplish this with a simple blocky rule but figured there may be a better way.

Thanks again for this great plugin 8-)
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 »

opentoideas wrote: Friday 02 March 2018 18:13 Hi, first off thank you for this plugin.
You'r welcome :D
I will be trying to control a 2 zone heating area.
Each zone will have a thermostat and when heat is needed I will need to switch a zone valve and common switch for the boiler.
Would this be best done with 2 seperate instances of the SVT? Or is there a different way to deal with zones?
My guess is that you should try running two instances of the plugin, each driving its relevant zone valve. For the common heater switch, my best suggestion is to write a "device changed" script (lua or blockly should be doable) that does a OR check: if one or both valves are "On" then the common switch must be "On" else it must be "Off". That being said, it might be better to drive the boiler switch with the status of the SVT (if SVT is "Off" then boiler is off, else it is "On") ? Really depends on how your boiler should behave if both zone valves are off (also depends on whether your boiler only heats these two zones)...
I also have another heated area that will be all automated. Is it possible to set the thermostat mode based on another switch? So if "switch" is on mode is normal and if "switch" is off then mode is economy?
Can accomplish this with a simple blocky rule but figured there may be a better way.
I this is the most simple way of doing this.

Please share your findings...
opentoideas
Posts: 14
Joined: Friday 02 March 2018 16:31
Target OS: Windows
Domoticz version: 3.8153
Location: Bristol UK
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by opentoideas »

Logread wrote: Friday 02 March 2018 18:40
I this is the most simple way of doing this.

Please share your findings...
Simple Blocky worked after a bit of trial and error to figure out how to set a selector switch lol

The zoned heating should happen in the next few days as I am still waiting in the temperature sensors as they were posted separately to the Sonoff devices but I am testing with my other system which has an electrical heater and is also humidity controlled with a fan to reduce humidity and different temperatures required dependant on other devices in the room.

so far it seems to be working though I am confused by the setting for the calculation period. I set it to 1 min as the heater is too powerful for the room so can change the temperature rapidly however the SVT threw an error that 5 min is the minimum. I have set to this but was worried that he temperature would overshoot but it seems that the heater is controlled on a faster rate than this setting suggests so how does this work?

I realise this is an unfair situation for the SVT but it is interesting that it can cope well with a less than ideal setup. good work :D
opentoideas
Posts: 14
Joined: Friday 02 March 2018 16:31
Target OS: Windows
Domoticz version: 3.8153
Location: Bristol UK
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by opentoideas »

renerene wrote: Thursday 18 January 2018 23:08 Anyone tried to implement this?
http://www.domoticz.com/forum/viewtopic ... 46#p167046
Image
Oh dear I think my life could get complex.

Not sure if I will be able to get my head around both of these but this looks interesting. If the planning aspect could be integrated with SVT this could be an elegant complete heating control.

SVT has saved me a ton of coding so might as well try a test of this to see if they can play nicely together.
opentoideas
Posts: 14
Joined: Friday 02 March 2018 16:31
Target OS: Windows
Domoticz version: 3.8153
Location: Bristol UK
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by opentoideas »

well for what its worth SVT and weekly programmer seem to work together. I have a bit more testing to do but I dont see any issues with them so far.
Logread wrote: Tuesday 14 November 2017 7:33 On the possibility to add more setpoints, I am not sure I see the point. I actually was initially not keen to have two setpoints for the plugin - i.e. one for normal mode and one for eco mode - but settled for it as I found it more user friendly to have a "normal/eco" switch than changing a setpoint value via a script or timer.
Hi Logread,

I can see why you do not want to complicate things by adding unnecessary levels but given the current weather in Europe perhaps one more would be benneficial....

"Normal" for when occupied

"Economy" for a background so the place does not cool down completely

"Away" so that you can have a frost stat to protect the house from freezing when the heating is "off" eg if you were away on holiday

not a big deal as this can be coded separately to work when the system is in the off setting with a blocky or similar, so not sure that it is really needed but it would be nice if it was easy for the user to decide how many levels they wanted.

could you also explain what the purpose of the "thermostat pause" switch is? it just seems to lock the system into the off position but I am sure I must be missing something as it must have a purpose :oops: :oops: :oops:
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests