Python Plugin: Smart Virtual Thermostat

For heating/cooling related questions in Domoticz

Moderator: leecollings

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 wrote: Saturday 03 November 2018 18:38 I had a little problem with the plugin 2 days ago.
Inside temperature was bellow stepping, but the heater did not start.

I restarted domoticz and everything went back to normal.
I am confused... the logs you sent were from before or after the restart ? Also you must be using an obsolete version of the plugin as the code lines in the errors log do not match the current code... we are at version 0.4.4 published on Oct 7th). You should update.
Cheers
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 »

It's not a big deal ;) The plugin is doing a great job the rest of the time 8-)

I'm not up to date with Domoticz, but Smart Virtual Thermostat seems to be:

Code: Select all

pi@domoticz:~/domoticz/plugins/SmartVirtualThermostat $ git show --oneline
3088c35 Version 0.4.4
...
Previous log is before restart.
I restarted Domoticz at 7 am.
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 »

The problem seems to happen when a timeout temperature sensor is back to normal (at 2am in previous log)

Maybe this could help?

Code: Select all

pi@domoticz:~/domoticz/plugins/SmartVirtualThermostat $ git diff
diff --git a/plugin.py b/plugin.py
index 6cd20a4..571ca48 100644
--- a/plugin.py
+++ b/plugin.py
@@ -602,7 +602,7 @@ class BasePlugin:
                 self.ActiveSensors[idx] = False
         else:
             if not self.ActiveSensors[idx]:
-                Domoticz.Status("previously timed out temperature sensor '{}' is back online".format(name))
+                Domoticz.Log("previously timed out temperature sensor '{}' is back online".format(name))
                 self.ActiveSensors[idx] = True

         return timedout
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 wrote: Sunday 04 November 2018 8:33 The problem seems to happen when a timeout temperature sensor is back to normal (at 2am in previous log)

Maybe this could help?

Code: Select all

pi@domoticz:~/domoticz/plugins/SmartVirtualThermostat $ git diff
diff --git a/plugin.py b/plugin.py
index 6cd20a4..571ca48 100644
--- a/plugin.py
+++ b/plugin.py
@@ -602,7 +602,7 @@ class BasePlugin:
                 self.ActiveSensors[idx] = False
         else:
             if not self.ActiveSensors[idx]:
-                Domoticz.Status("previously timed out temperature sensor '{}' is back online".format(name))
+                Domoticz.Log("previously timed out temperature sensor '{}' is back online".format(name))
                 self.ActiveSensors[idx] = True

         return timedout
Thanks for the code diff. I think I got it... the version of Domoticz you are running probably does not support the Domoticz.Status() function. Updating Domoticz to current stable or more recent beta should solve the issue.
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 »

You are perfectly right!
I will update Domoticz to last stable version as soon as possible!

Thank you everybody 8-)
cheshmgir
Posts: 2
Joined: Tuesday 06 November 2018 11:05
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by cheshmgir »

i updated, solved
uzturre
Posts: 14
Joined: Wednesday 13 June 2018 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Basque Country
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by uzturre »

Hello: I need help...

Code: Select all

2018-11-06 19:32:26.524 Error: (TERMST INTELI) Cannot read the uservariable holding the persistent variables
2018-11-06 19:32:26.537 Error: (TERMST INTELI) Error calling 'http://192.168.0.160:8080/json.htm?type=devices&filter=light&used=true&order=Name'
2018-11-06 19:32:26.538 Error: (TERMST INTELI) none of the devices in the 'heaters' parameter is a switch... no action !
2018-11-06 19:32:35.931 Error: (TERMST INTELI) Error calling 'http://192.168.0.160:8080/json.htm?type=devices&filter=temp&used=true&order=Name'
2018-11-06 19:32:35.932 Error: (TERMST INTELI) No Inside Temperature found... Switching Thermostat Off
Thanks in advance.
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 »

uzturre wrote: Tuesday 06 November 2018 19:34 Hello: I need help...
Very simple... the plugin cannot access the json API of domoticz. This can be anything of: incorrect IP or port, wrong user/password if enabled. May be first test these parameters by manually issuing some API requests (https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's)
Erwanweb
Posts: 10
Joined: Monday 05 November 2018 9:16
Target OS: Linux
Domoticz version: lastest
Location: Barcelona (Spain)
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Erwanweb »

Hi,

@Logread, could we speak in PM ? I would like to discuss about SVT and a possible evolution for working with airconditioners.
Thks in advance.
uzturre
Posts: 14
Joined: Wednesday 13 June 2018 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Basque Country
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by uzturre »

@Logread
Good morning and thank you very much for your response, I do not understand very well what happens ... now I get this data, I do not understand much about code ...

Code: Select all

 2018-11-07 10:22:35.500 Error: (TERMST INTELI) 'onStart' failed 'KeyError'.
2018-11-07 10:22:35.500 Error: (TERMST INTELI) ----> Line 617 in /home/domoticz/domoticz/plugins/SVT/plugin.py, function onStart
2018-11-07 10:22:35.500 Error: (TERMST INTELI) ----> Line 247 in /home/domoticz/domoticz/plugins/SVT/plugin.py, function onStart
2018-11-07 10:22:35.500 Error: (TERMST INTELI) ----> Line 462 in /home/domoticz/domoticz/plugins/SVT/plugin.py, function switchHeat
2018-11-07 10:22:44.977 Error: (TERMST INTELI) No Inside Temperature found... Switching Thermostat Off 
and

Code: Select all

2018-11-07 10:32:45.233 Error: (TERMST INTELI) No Inside Temperature found... Switching Thermostat Off
Thanks
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by jake »

When i simply read your log, it can find a (properly defined) inside temperature sensor. Without that sensor the whole thermostat idea is useless of course. Please check the idx value in the hardware page
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 »

Erwanweb wrote: Wednesday 07 November 2018 9:49 Hi,
@Logread, could we speak in PM ? I would like to discuss about SVT and a possible evolution for working with airconditioners.
Thks in advance.
You wanted to discuss air conditioning ? Posting this on the main thread as it could be of interest to others.

For now the plugin only works with heating, with the objective of improving over the low quality thermostats that come with most simple heating systems (i.e. electric convectors or basic boiler control). It can only work with on/off systems, bypassing the original controls.

I never ventured into cooling, since most air conditioning systems seem to have a built in control system that cannot be bypassed (at least this is the case in my main home)... if the opportunity to be able to drive a cooler on an on/off basis exists, then the plugin could be expanded to cooling... but I would not be able to test it.

Then there is the additional complexity of fan control... but this is probably secondary.
uzturre
Posts: 14
Joined: Wednesday 13 June 2018 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Basque Country
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by uzturre »

jake wrote: Wednesday 07 November 2018 12:09 When i simply read your log, it can find a (properly defined) inside temperature sensor. Without that sensor the whole thermostat idea is useless of course. Please check the idx value in the hardware page
I tell you my installation, I have two pi zero w, one pi zero for the temperature probe installed in the room and the other pi zero with the relay modules next to the boiler. The idx 10 is the temperature probe of the room and for read the temperture in this pi zero I use a Domoticz-remote server.
Attachments
Sin título.jpg
Sin título.jpg (141.36 KiB) Viewed 2698 times
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 »

uzturre wrote: Wednesday 07 November 2018 16:26
jake wrote: Wednesday 07 November 2018 12:09 When i simply read your log, it can find a (properly defined) inside temperature sensor. Without that sensor the whole thermostat idea is useless of course. Please check the idx value in the hardware page
I tell you my installation, I have two pi zero w, one pi zero for the temperature probe installed in the room and the other pi zero with the relay modules next to the boiler. The idx 10 is the temperature probe of the room and for read the temperture in this pi zero I use a Domoticz-remote server.
The idx for the temperature sensor is the one on the devices page (I assume you properly set up device sharing), not the hardware idx...
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by jake »

Logread wrote:
uzturre wrote: Wednesday 07 November 2018 16:26
jake wrote: Wednesday 07 November 2018 12:09 When i simply read your log, it can find a (properly defined) inside temperature sensor. Without that sensor the whole thermostat idea is useless of course. Please check the idx value in the hardware page
I tell you my installation, I have two pi zero w, one pi zero for the temperature probe installed in the room and the other pi zero with the relay modules next to the boiler. The idx 10 is the temperature probe of the room and for read the temperture in this pi zero I use a Domoticz-remote server.
The idx for the temperature sensor is the one on the devices page (I assume you properly set up device sharing), not the hardware idx...
Of course, but the idx number has to be added to the svt specs on the hardware page.
uzturre
Posts: 14
Joined: Wednesday 13 June 2018 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Basque Country
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by uzturre »

Good morning:
Thank you very much for your responses:
I have already corrected the Idx because I had installed the hardware Idx and I have already put the Idx of the devices, but I can not get the SVT to work.
The pi zero that has installed the interior temperature sensor has the following IP: 192.168.0.154 and the pi zero that has the control and the relay modules and also the external temperature sensor has the IP: 192.168.0.160
When configuring the SVT hardware I have put both IPs alternately and I can not get it to work.
On the other hand I have made a programming blockly setting parameters of days and temperatures to activate the boiler and it works properly, but I like the concept of SVT more and that is why I want to work with it.
Thanks
Erwanweb
Posts: 10
Joined: Monday 05 November 2018 9:16
Target OS: Linux
Domoticz version: lastest
Location: Barcelona (Spain)
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Erwanweb »

Logread wrote: Wednesday 07 November 2018 13:52
Erwanweb wrote: Wednesday 07 November 2018 9:49 Hi,
@Logread, could we speak in PM ? I would like to discuss about SVT and a possible evolution for working with airconditioners.
Thks in advance.
You wanted to discuss air conditioning ? Posting this on the main thread as it could be of interest to others.

For now the plugin only works with heating, with the objective of improving over the low quality thermostats that come with most simple heating systems (i.e. electric convectors or basic boiler control). It can only work with on/off systems, bypassing the original controls.

I never ventured into cooling, since most air conditioning systems seem to have a built in control system that cannot be bypassed (at least this is the case in my main home)... if the opportunity to be able to drive a cooler on an on/off basis exists, then the plugin could be expanded to cooling... but I would not be able to test it.

Then there is the additional complexity of fan control... but this is probably secondary.
Hi @Logread.

In fact, i am here more for speaking heating and cooling controls, and more in Energy saving solutions. i am from one manufacturer of control systems, heat pump and aircon.

For Air Conditionners, We have one solution that work with 99% of aircon. of course for first step, it is only for controlling well the aircon by IR. It is base on universal remote control, in the bigining it was used for industrial and commercial applications that ask for a central control system, but for cheap price, and working with different brands... But for now, and smart house, we saw that nothing work really well and easily with aircon. All brand have her own solution, but not a global solution working with all brand, and for easy and cheap price.
We've tried the existing solutions that can (on the paper) work with several brands, but as the RMMini for example or the Zwave to IR, not really easy and good solution for aircons i think.
It si why we develop this during our weekend ;-)
But for one easy integration in DIY solutions, as domoticz (the one I use in my own house), i will need help for making a plugin for that. But i need to find a small team for that, i cannot do it alone and by myself, and more send in all public in a thread some confidential and proprietary information of the company.

Second step, i think it is turning SVT for controlling well the Air/Air heat pumps (aircon). Because as all people know, the built in controls are more or less not precize (ex you set 21 you will have 26...etc). For the fan control it is more or less same. The Auto function is more or less bad :-).
I know your skills with the SVT plugin. Are you interested in this project?

If there is other ones that know well python or other for making plugins like this, i am here ;-)

Also, and for energy saving etc, i think it can be good to add some other points in SVT.
First it is the "presence detection", very easy i think, and with one auto setpoint (as -0,5 to 1°C depending of the heating solution) in relation of the "confort" one. It is what i do now for changement between confort and Eco mode, with temporized presence detection. But with this solution i need to plan other eco setpoint for a real night eco mode for example.
Also, maybe have other setpoint as "Away", and to finish, one "antifrost" mode.
Having it directly is more easy than script etc.
An to finish, maybe be abble to control also some TRV as Danfoss LC13, that in fact, ask to one external real control.
Tarzan737
Posts: 60
Joined: Friday 01 June 2018 20:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by Tarzan737 »

i can´t get this to work.. not in Auto.. if forced it turns the heater on.

no problems with installation and i can find the hardware SVT and put in correct idx numbers for temp sensors and heater..
no login or passwords enabled..

i get this in logs..

Code: Select all

 2018-11-15 11:46:58.029 Status: Incoming connection from: 192.168.0.14
2018-11-15 11:47:08.035 Error: (Termostat) 'onHeartbeat' failed 'KeyError'.
2018-11-15 11:47:08.035 Error: (Termostat) ----> Line 632 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onHeartbeat
2018-11-15 11:47:08.035 Error: (Termostat) ----> Line 359 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onHeartbeat
2018-11-15 11:47:08.035 Error: (Termostat) ----> Line 498 in '/home/pi/domoticz/plugins/SVT/plugin.py', function readTemps
2018-11-15 11:47:16.899 Status: EventSystem: reset all events...
2018-11-15 11:47:33.816 (Termostat) Thermostat (Termostat)
2018-11-15 11:48:10.407 (Termostat) Thermostat (Termostat)
2018-11-15 11:48:36.079 Status: User: Admin initiated a switch command (52/Termostat - Thermostat Control/Set Level)
2018-11-15 11:48:36.140 Error: (Termostat) 'onCommand' failed 'KeyError'.
2018-11-15 11:48:36.140 Error: (Termostat) ----> Line 627 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:36.140 Error: (Termostat) ----> Line 277 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:36.140 Error: (Termostat) ----> Line 349 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onHeartbeat
2018-11-15 11:48:36.140 Error: (Termostat) ----> Line 498 in '/home/pi/domoticz/plugins/SVT/plugin.py', function readTemps
2018-11-15 11:48:43.869 Status: User: Admin initiated a switch command (52/Termostat - Thermostat Control/Off)
2018-11-15 11:48:43.930 Error: (Termostat) 'onCommand' failed 'KeyError'.
2018-11-15 11:48:43.930 Error: (Termostat) ----> Line 627 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:43.930 Error: (Termostat) ----> Line 277 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:43.930 Error: (Termostat) ----> Line 349 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onHeartbeat
2018-11-15 11:48:43.930 Error: (Termostat) ----> Line 498 in '/home/pi/domoticz/plugins/SVT/plugin.py', function readTemps
2018-11-15 11:48:47.105 Status: User: Admin initiated a switch command (52/Termostat - Thermostat Control/Off)
2018-11-15 11:48:47.165 Error: (Termostat) 'onCommand' failed 'KeyError'.
2018-11-15 11:48:47.165 Error: (Termostat) ----> Line 627 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:47.165 Error: (Termostat) ----> Line 277 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:47.165 Error: (Termostat) ----> Line 349 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onHeartbeat
2018-11-15 11:48:47.165 Error: (Termostat) ----> Line 498 in '/home/pi/domoticz/plugins/SVT/plugin.py', function readTemps
2018-11-15 11:48:48.361 Status: User: Admin initiated a switch command (52/Termostat - Thermostat Control/Off)
2018-11-15 11:48:48.395 Error: (Termostat) 'onCommand' failed 'KeyError'.
2018-11-15 11:48:48.395 Error: (Termostat) ----> Line 627 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:48.395 Error: (Termostat) ----> Line 277 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:48.396 Error: (Termostat) ----> Line 349 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onHeartbeat
2018-11-15 11:48:48.396 Error: (Termostat) ----> Line 498 in '/home/pi/domoticz/plugins/SVT/plugin.py', function readTemps
2018-11-15 11:48:49.672 Status: User: Admin initiated a switch command (52/Termostat - Thermostat Control/Set Level)
2018-11-15 11:48:51.147 Status: User: Admin initiated a switch command (52/Termostat - Thermostat Control/Set Level)
2018-11-15 11:48:51.187 Error: (Termostat) 'onCommand' failed 'KeyError'.
2018-11-15 11:48:51.187 Error: (Termostat) ----> Line 627 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:51.187 Error: (Termostat) ----> Line 277 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onCommand
2018-11-15 11:48:51.187 Error: (Termostat) ----> Line 349 in '/home/pi/domoticz/plugins/SVT/plugin.py', function onHeartbeat
2018-11-15 11:48:51.187 Error: (Termostat) ----> Line 498 in '/home/pi/domoticz/plugins/SVT/plugin.py', function readTemps 
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 »

Tarzan737 wrote: Thursday 15 November 2018 11:58 i can´t get this to work.. not in Auto.. if forced it turns the heater on.
no problems with installation and i can find the hardware SVT and put in correct idx numbers for temp sensors and heater..
no login or passwords enabled..
The issue is really with your temperature sensors... I suspect you are relying on combo devices (e.g. devices that have both temp + humidity values for instance) instead of "simple" temperature sensors...

Can you please issue the following in a browser and send me the output by pm ?

Code: Select all

http://192.168.0.14:8080/json.htm?type=devices&filter=temp&used=true&order=Name
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest