Python Plugin: Smart Virtual Thermostat

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
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: Tuesday 03 April 2018 17:04 New version 0.4.1 is available !
...
Though the changes have been tested by myself, please exercise caution when upgrading a production system and report any bugs/issues I might have overlooked !
Thanks for the update. I had to wait until today to see the results of your work: the 2 nights before the room temperature didn't drop to the setpoint temperature. With last night being cold outside, the SVT could do it's job and it worked nicely: Every 60 minutes for 15 min. 'on' (25%). It ramped down the temperature nicely, arriving at an almost flat 18'C room temperature (= setpoint). Much better than the original iSense thermostat that I now only use (with help of the OTGW) to fire up the boiler (setpoint + 0.5'C) and stop the boiler (setpoint - 0.5'C). The 0.5'C increase/decrease is enough for the iSense to immediately start/stop heating.
pikapt
Posts: 37
Joined: Wednesday 25 January 2017 20:54
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by pikapt »

Great news! I'm gonna update asap! I had point nº2 already (changed the code) but is nice to know that now is included! Regarding 3, I though about it as well but gave up after 5 min trying changing the code!

As a reference, I'm using this plugin for 5 months now, 24/7! Issues that I have are only related with hardware failures (no update for a long time turns off the heating - which makes sense).

Thanks a lot for your hard work.
renerene
Posts: 350
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by renerene »

Hello,

After updating from Rpi2 to Rpi3+ I have gotten issues witj SVT. Here is my workflow uptill now:
a) backup database from my Rpi2 (Jessie)
b) clean install domoticz on Rpi 3B+ (raspbian stretch)
c) restore database
--> success, domoticz works, except for SVT.

type in hardware section is blank for thermostat hardware

After following installation instruction (https://www.domoticz.com/wiki/Using_Python_plugins) resart turns into some kind of loop and domoticz through 8080 is not accessable (Browser cache refresh failed). SSH tells me the domoticz service is running, however.

When i rename plugins/SVT/plugin.py and restart: everything works. Except for SVT.

Hints?
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, the SVT plugin relies on a python module (request) that is known to create issues with Domoticz on some specific raspberry setups with Raspbian Stretch, but typically domoticz crashes immediately on startup (and there are known solutions to this issue), but this is not what you describe...
First it would help if you could provide your domoticz version number, raspbian version and importantly version of python and openSSL libraries. Also some lines of what you are seeing in the domoticz log if possible ?
renerene
Posts: 350
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by renerene »

domoticz version: V3.9268 (latest beta)
Raspberry: 3B+
Python 2.7.13
openssl version: <to be cotinued, dont to know how to check, will follow later>
How can I check the domoticz log when the domoticz web interface is down?

helpful link ? : https://linuxconfig.org/how-to-change-f ... bian-linux
renerene
Posts: 350
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by renerene »

1) updated to version Python 3.5.3

2) I've enabled logging in domoticz.sh with result below:

2018-04-18 21:36:12.463 TCPServer: shared server started...
2018-04-18 21:36:12.463 RxQueue: queue worker started...
2018-04-18 21:36:14.464 Wunderground: Worker started...
2018-04-18 21:36:14.464 P1 Smart Meter: Using serial port: /dev/ttyUSB-Pkabel
2018-04-18 21:36:14.468 Hardware Monitor: Started
2018-04-18 21:36:14.482 YeeLight Worker started...
2018-04-18 21:36:14.483 Logitech Media Server: Worker started...
2018-04-18 21:36:14.483 Pinger: Started
2018-04-18 21:36:14.483 Logitech Media Server: 1 player-switch(es) found.
2018-04-18 21:36:14.484 (thermostaat) Started.
2018-04-18 21:36:14.484 EventSystem: reset all events...
2018-04-18 21:36:14.489 dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/dzCheckSensors2.lua
2018-04-18 21:36:14.489 dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/dzLUX.lua
2018-04-18 21:36:14.490 dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/dzHalfway.lua
2018-04-18 21:36:14.490 dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/dzTuinlicht.lua
2018-04-18 21:36:14.490 Error: Logitech Media Server: No response from server 192.168.0.20:9002
2018-04-18 21:36:14.494 EventSystem: reset all device statuses...
2018-04-18 21:36:14.684 RFLink: Using serial port: /dev/ttyUSB-RFLINK
2018-04-18 21:36:14.713 PluginSystem: Entering work loop.
2018-04-18 21:36:14.964 OpenZWave: using config in: /home/pi/domoticz/Config/
2018-04-18 21:36:14.968 OpenZWave: Starting...
2018-04-18 21:36:14.968 OpenZWave: Version: 1.4-2888-g54682370-dirty
2018-04-18 21:36:15.011 Error: Domoticz received fatal signal 11 !...
2018-04-18 21:36:15.013 Error: /home/pi/domoticz/domoticz() [0x2583bc]
2018-04-18 21:36:15.013 Error: /home/pi/domoticz/domoticz(_Z14signal_handleri+0x4c) [0x258474]
2018-04-18 21:36:15.013 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer+0) [0x76c406b0]
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,

Looks that my initial suspicion was correct... a certain number of plugins (including SVT) that rely on certain common python modules are incompatible with the way domoticz is compiled by default when run on Debian Stretch (under the hood it seems it is a conflict between the openssl libraries as upgraded in Debian Stretch and the older ones used by domoticz that are statically linked when domoticz is compiled by default).

So it seems based on various threads on this forum that there are three solutions if you want to use any of the python plugins that are affected, until domoticz default binaries or compile scripts are changed:
- downgrade to Debian Jessie, or
- install python 3.4 on the Pi and remove completely python 3.5, or
- compile domoticz with dynamic linking of openssl (follow the wiki instructions but replace the cmake instructions in the wiki by « cmake -DUSE_OPENSSL_STATIC="NO" -DCMAKE_BUILD_TYPE=Beta CMakeLists.txt »

I do not like the first two (the concept of downgrading is not appealing), but I am using the third one with success.

Not satisfactory but not within my control (I tried to rewrite the plugin using the http connection methods built into the python plugins framework, but its asyncronous nature does not work well with the logic of the SVT especially for error handlings.

Please advise which fix you chose and the results...
renerene
Posts: 350
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by renerene »

No success yet. Let's go over the three options

1) use Jessie.

Yes, that was my original plan. My old version on Rpi2 was on Jessie. Just swap SD cards. Did not work, even not after update/upgrade

2) - install python 3.4 on the Pi and remove completely python 3.5
I went for this option. Looks simple. But no success so far. Original Raspbian Stretch comes with Python 3.5.3 (https://www.raspberrypi.org/forums/view ... p?t=191667)
My impatience and lack of Linux knowledge got me stuck:
Spoiler: show
root@raspberrypi:/etc# python --version
-bash: /usr/bin/python: No such file or directory <-- Python gone?
root@raspberrypi:/etc# sudo apt-get install python3.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3.4 is already the newest version (3.4.4-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python-rpi.gpio (0.6.3~stretch-1) ...
/var/lib/dpkg/info/python-rpi.gpio.postinst: 6: /var/lib/dpkg/info/python-rpi.gpio.postinst: pycompile: not found
dpkg: error processing package python-rpi.gpio (--configure): <-- ?error?
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
python-rpi.gpio
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@raspberrypi:/etc#
3) compile domoticz with dynamic linking of openssl (follow the wiki instructions but replace the cmake instructions in the wiki by « cmake -DUSE_OPENSSL_STATIC="NO" -DCMAKE_BUILD_TYPE=Beta CMakeLists.txt »
That would be my first compile action on Rpi. Lot of reading, takes a large effort --> Don't want go there for now. . Re-install complete system? Summer season is starting, the thermostat module is not needed now. Just gonna wait a few months, maybe some developer fixes things in the meanwhile?
elgarne
Posts: 36
Joined: Monday 26 May 2014 14:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by elgarne »

Thank you very much for this plugin. I was looking for scripts implementing PID algorithm and found this one.
I'll implement it with the following setup:
  • 1 boiler with on/off switch
  • 1 nest thermostat in the living room that triggers the boil to on or off depending on the temperature in the living room
  • 8 Popp thermostatic valves
  • 4+4 temperature sensors in the zones where are the 8 Popp thermostats.
For each zone, I have an SVT hardware that triggers a virtual switch to on or off. If this virtual switch is set to on, the associated Popp thermostatic setpoint will be set to 24°. If it is set to off, the thermostat setpoint will be set to 16°.
If one of these 8 virtual switches is set to on, then a general virtual switch will be set to on. If all the 8 virtual switches are set to off, then switch off this general virtual switch.
When this general virtual switch is set to on, set the Nest setpoint to 24°, which will turn on the boiler. When set to off, set Nest setpoint to 16° which will turn off the boiler.

If you think my procedure is not correct, please do not hesitate to suggest something else.

Thanks again.
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 »

@elgarne, that’s indeed a big set up. Besides porting the vera plugin to domoticz, my contribution to the science of heating is close to zero... that being said, what you describe makes sense. Please report how this works, for the benefit of the community :D
elgarne
Posts: 36
Joined: Monday 26 May 2014 14:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by elgarne »

Thanks @Logread.
I'll of course report but it does not work that much these days. I'll come back probably next fall.
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 »

That’s an interesting way to control the boiler. I’ll be monitoring to see how well that works in the winter.


Sent from my iPhone using Tapatalk
elgarne
Posts: 36
Joined: Monday 26 May 2014 14:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by elgarne »

Hi

My plug-in disappeared from my domoticz !!
The two hardwares I have added are still there but with no settings tab. If I try to add a new one, I don't have the SVT hardware.
But, while restarting domoticz, I can see

Code: Select all

(SVT Salon) Initialized version 0.4.1, author 'logread'
Any idea what happens? I'm running domoticz v3.8153.

Thanks.
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 »

@elgarne,

Difficult to say with so little information.
Platform: (eg Raspberry) ?
Operating system and version: (eg Raspban Stretch) ?
Does domoticz keep running or does it crash ?

It might also help to send me by pm a full logfile...
elgarne
Posts: 36
Joined: Monday 26 May 2014 14:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by elgarne »

Sorry for the lack of information.

It's running it on an Ubuntu 18.04 LTS on an HP Proliant n54.
Domoticz works as a charm, except that I can't see the SVT plugin in the list of hardwares.

I send you the logfile with pm.
Thanks.
elgarne
Posts: 36
Joined: Monday 26 May 2014 14:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by elgarne »

I think it's an issue with my python engine.
I updated to a beta version and the plugins show normally. Which is wired is domoticz not complaining about SVT plugin when starting the regular release which seems to have issues with python.
SzuR
Posts: 11
Joined: Monday 26 February 2018 20:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by SzuR »

HI
My domoticz froze if i add SVT in hardware. I run it on RPi newest stable with python 3.4 (it was only way i can see this plugin) any ideas how make it work? move to domoticz beta? What about python version?
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 »

SzuR wrote: Sunday 24 June 2018 22:29 HI
My domoticz froze if i add SVT in hardware. I run it on RPi newest stable with python 3.4 (it was only way i can see this plugin) any ideas how make it work? move to domoticz beta? What about python version?
Please provide system details and relevant domoticz logs... were you running the plugin before or is this a new instal ?
SzuR
Posts: 11
Joined: Monday 26 February 2018 20:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Smart Virtual Thermostat

Post by SzuR »

It is new install on raspbian light. Original on python 3.5. I have to install python 3.4 to see SVT in hardware. When i added one whole domoticz froze. But raspberry still works. I do not have access to logs due to frozen domoticz. Or maybe there is some way to to get to them? I am newbie

Wysłane z mojego D6503 przy użyciu Tapatalka

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 »

@SzuR,

The SVT plugin works on python >= 3.4 and i have it running on stretch systems with python 3.5 and even 3.6

Did you try other plugins / hardware ?

Please search on this forum or the wiki for help with logging... even is the web interface is not responsive, you can access the log file from a shell
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest