Page 2 of 21

Re: Python Plugin: Smart Virtual Thermostat

Posted: Sunday 08 October 2017 11:30
by Electrocut
Hi!

I have just started my heating system a few days ago.
I have 3 remarks :)
  1. Ambient temperature regulation

    For the moment, sometimes the plugin is not really accurate. I will wait a few days, and try to adjust the "Calculation cycle" value.

    Setpoint was 17.5°C (Economy)

    - Ambient temperature history
    domoticz_04.png
    domoticz_04.png (25.69 KiB) Viewed 6169 times
    - Boiler relay history
    2017-10-08 05:13:42 Off
    2017-10-08 04:13:41 Off
    2017-10-08 02:13:29 On
    2017-10-08 01:18:28 Off
    2017-10-08 01:13:28 On
    2017-10-08 00:13:27 Off
    2017-10-07 23:13:27 Off
    2017-10-07 22:13:27 Off
  2. Normal / economy switching

    When I switch from Normal to economy mode (or vice versa), the plugin seems to wait for the end of the calculation cycle, before activating / deactivating the relay. I switched to Normal mode at 08:00, but the boiler has started at 08:13. Is it the normal behavior?

    - Thermostat Mode History

    Code: Select all

    2017-10-08 08:00:03	Normal
    2017-10-07 23:30:02	Economy
    - Boiler relay

    Code: Select all

    2017-10-08 10:14:07	On
    2017-10-08 09:13:56	On
    2017-10-08 08:13:44	On
    2017-10-08 07:13:43	Off
    2017-10-08 06:13:43	Off
    2017-10-08 05:13:42	Off
  3. Bug with temperature + humidity sensors

    I have tried to use an temperature + humidity sensor (from Weather underground), as Outside Temperature Sensor.
    Raw data looks like this:
    domoticz_05.png
    domoticz_05.png (15.35 KiB) Viewed 6169 times
    -> It has broken everything ;) The plugin was not activating the boiler at all. Error log output:

    Code: Select all

    2017-10-05 04:28:09.697  Error: (Thermostat) 'onHeartbeat' failed 'TypeError':'unorderable types: float() > NoneType()'.
    2017-10-05 04:28:09.697  Error: (Thermostat) ----> Line 494 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function onHeartbeat
    2017-10-05 04:28:09.697  Error: (Thermostat) ----> Line 282 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function onHeartbeat
    2017-10-05 04:28:09.697  Error: (Thermostat) ----> Line 299 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function AutoMode
    2017-10-05 04:28:09.697  Error: (Thermostat) ----> Line 353 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function AutoCallib
    2017-10-05 05:28:10.509  Error: (Thermostat) 'onHeartbeat' failed 'TypeError':'unorderable types: float() > NoneType()'.
    2017-10-05 05:28:10.509  Error: (Thermostat) ----> Line 494 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function onHeartbeat
    2017-10-05 05:28:10.509  Error: (Thermostat) ----> Line 282 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function onHeartbeat
    2017-10-05 05:28:10.510  Error: (Thermostat) ----> Line 299 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function AutoMode
    2017-10-05 05:28:10.510  Error: (Thermostat) ----> Line 353 in /home/pi/domoticz/plugins/SmartVirtualThermostat/plugin.py, function AutoCallib
    To fix this, I had to:
    - Replace my Outside Temperature Sensor with a "Temperature only" sensor
    - In Domoticz User variable, edit the variable, "Thermostat-InternalVariables":
    From: {'ConstC': 87.8, 'LastSetPoint': 20.0, 'ConstT': 1.9, 'ALStatus': 1, 'nbCC': 5, 'LastPwr': 100, 'LastOutT': None, 'nbCT': 21, 'LastInT': 17.9}
    To: {'ConstC': 87.8, 'LastSetPoint': 20.0, 'ConstT': 1.9, 'ALStatus': 1, 'nbCC': 5, 'LastPwr': 100, 'LastOutT': 10, 'nbCT': 21, 'LastInT': 17.9}

Re: Python Plugin: Smart Virtual Thermostat

Posted: Sunday 08 October 2017 12:05
by Logread
Electrocut wrote: Sunday 08 October 2017 11:30 I have just started my heating system a few days ago.
I have 3 remarks :)
  1. Ambient temperature regulation
    Let it settle a bit... and indeed adjust the calculation interval ? These parameters seem to be require some trial and error adjustments based on the thermal properties of your home and how the temp sensors are set up. Monitoring how the constC and constT values evolve over time can be useful (use Verbose logging in the plugin parameters to see these changes in domoticz log)... if the calculations converge over time to an optimum value you are on the right track. On the other hand if these keep jumping up and down without a pattern, you need to change some of the settings.
  2. Normal / economy switching
    Good pick... will fix that in next version
  3. Bug with temperature + humidity sensors
    This is not a bug... by design these combos (temp + hum) do not report a « temp » value in the domoticz Json API... the usual work around for any use of these for temperature monitoring purposes involves setting up a dummy temp sensor and having a lua script monitor the combo device and update the dummy temp device... it is well documented in the wiki at http://www.domoticz.com/wiki/Virtual_weather_devices

Re: Python Plugin: Smart Virtual Thermostat

Posted: Sunday 08 October 2017 12:24
by Electrocut
Logread wrote: Sunday 08 October 2017 12:05Ambient temperature regulation

Let it settle a bit...
I will :)
Normal / economy switching

Good pick... will fix that in next version
Great :mrgreen:
Bug with temperature + humidity sensors

the usual work around for any use of these for temperature monitoring purposes involves setting up a dummy temp sensor and having a lua script monitor the combo device and update the dummy temp device... it is well documented in the wiki at http://www.domoticz.com/wiki/Virtual_weather_devices
Good point :) I will create a virtual temperature sensors, as explained in the wiki.

Thanks :mrgreen:

Re: Python Plugin: Smart Virtual Thermostat

Posted: Monday 09 October 2017 0:16
by Goldwing1973
Question :

I have a nest (v1) and also 5 Popp Thermostat’s, (1 in each bedroom and 1 in the living room).
Can I use this project to control the nest and popp thermostats to heat each room individually?

Re: Python Plugin: Smart Virtual Thermostat

Posted: Monday 09 October 2017 8:10
by Logread
@Golwing1973,
No (and I cannot see how this would work...). This plugin aims at replacing unsatisfactory existing thermostats, typically unsophisticated hysterisis based ones like found in many electrical heaters.

Re: Python Plugin: Smart Virtual Thermostat

Posted: Monday 09 October 2017 10:26
by Goldwing1973
Ok, to bad.
To be sure, the popp thermostats are radiator valves and not thermostats you fix on the wall. (https://www.amazon.fr/Popp-Thermostat-c ... 01I5N9KFY/)
Only wall mounted thermostat is the Nest.

Re: Python Plugin: Smart Virtual Thermostat

Posted: Tuesday 10 October 2017 11:52
by Logread
Version 0.3.4 is available from GitHub, fixing the "normal/economy" switching bug uncovered by @Electrocut (thanks to him).

Re: Python Plugin: Smart Virtual Thermostat

Posted: Tuesday 10 October 2017 21:49
by Electrocut
Seems working great, my heater start immediately when I switch from Economy to Normal mode 8-)
Thanks!

Re: Python Plugin: Smart Virtual Thermostat

Posted: Thursday 19 October 2017 16:48
by napo7
Hi @LogRead,

I think there is a bug in the code :

Line 316-317, there is :

Code: Select all

         if (power > 0) and (power <= self.minheattime):
                power = 0  # Seuil mini de power
I think it should be :

Code: Select all

         if (power > 0) and (power <= self.minheattime):
                         power = self.minheattime  # Seuil mini de power
Without this, the "minHeatTime" variable is never used...
Am I right ?

Re: Python Plugin: Smart Virtual Thermostat

Posted: Friday 20 October 2017 9:09
by Logread
@napo7,

You are right. Thanks for pointing out. I’ll fix that and publish a new version soon.

Re: Python Plugin: Smart Virtual Thermostat

Posted: Saturday 21 October 2017 17:51
by Logread
Version 0.3.5 is available from GitHub for install/upgrade as per instructions at https://www.domoticz.com/wiki/Plugins/S ... ostat.html.
It fixes the bug uncovered by @napo7.

Re: Python Plugin: Smart Virtual Thermostat

Posted: Monday 13 November 2017 20:23
by strelniece
Hello and thanks for a great plug-in, made me (partly) use Domoticz again :)

I have some thoughts though. I might not be using it quite as intended, I have created 3 different thermostats since I have different temperatures around the house (cooler in the bedroom, for example) and no heaters in some rooms, but hope that it still will work out.

My main concern is that I also heat my house with a stove using wood. It is very manual, so only used when I am at home, awake and not in a too lazy mood :) My question is now how much this will affect the regulation. Any ideas?

Also, I would like to be able to control them from outside Domoticz (I'm using node-red to everything else in my home, only use Domoticz for my thermostats). Are there any way to control the thermostats with MQTT/JSON?

thanks

//f

EDIT: I found out how to control from node-red :) it makes me think it might not be that complicated to add one (or more) set-point-level?

Re: Python Plugin: Smart Virtual Thermostat

Posted: Tuesday 14 November 2017 7:33
by Logread
strelniece wrote: Monday 13 November 2017 20:23 Hello and thanks for a great plug-in, made me (partly) use Domoticz again :)
You are welcome :)
Creating multiple thermostats is the way to go to control individual rooms or zones, as long as you have a decentralized heating (e.g. electric convectors, radiators with individual valve control such as the new Fibaro zwave heat controller) specific to that zone.

Mixed heating sources will certainly impact the regulation, but it is hard to predict how... for instance if your wood stove heats "more" than the source controlled by the smart virtual thermostat, the learning algorithm of the latter will skip learning...

On your comment on MQTT, definitely it is out of the box with Domoticz so no need for the plugin to address this.

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.

Re: Python Plugin: Smart Virtual Thermostat

Posted: Tuesday 14 November 2017 20:53
by Skippiemanz
Hi, i was just trying youre plugin. Looks realy promising.

But suddenly domoticz crashed with this in the log:

2017-11-14 20:45:59.378 Error: Domoticz received fatal signal 11 !...
2017-11-14 20:45:59.379 Error: /home/pi/domoticz/domoticz() [0x230390]
2017-11-14 20:45:59.380 Error: /home/pi/domoticz/domoticz(_Z14signal_handleri+0x4c) [0x230448]
2017-11-14 20:45:59.380 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76c9b180]

Is this a general python error or connected to your plugin?

Re: Python Plugin: Smart Virtual Thermostat

Posted: Tuesday 14 November 2017 21:46
by napo7
Hi,

I experienced the same problem.
I was thinking at first that it was related to xiaomi-robot vacuum, but I had disabled this plugin first, and still experiencing the same error.

Experienced this on Beta version.

Re: Python Plugin: Smart Virtual Thermostat

Posted: Tuesday 14 November 2017 23:05
by Skippiemanz
napo7 wrote: Tuesday 14 November 2017 21:46 Hi,

I experienced the same problem.
I was thinking at first that it was related to xiaomi-robot vacuum, but I had disabled this plugin first, and still experiencing the same error.

Experienced this on Beta version.
These steps fixed it for me:

Code: Select all

cd plugins/SVT
get reset –-hard
git pull --force
sudo chmod +x plugin.py
sudo /etc/init.d/domoticz.sh restart

Re: Python Plugin: Smart Virtual Thermostat

Posted: Wednesday 15 November 2017 11:09
by napo7
Did not worked for me...Still crashing this morning after forcing update of the script.

I'll disable it to be sure it is this script that cause failing !

Re: Python Plugin: Smart Virtual Thermostat

Posted: Wednesday 15 November 2017 13:46
by Electrocut
I was having the problem with Domoticz v3.8153 stable version.

Fixed since I switch to the beta version (currently using V3.8450 beta).

Re: Python Plugin: Smart Virtual Thermostat

Posted: Wednesday 15 November 2017 15:45
by Logread
Plugin works perflectly fine for me both on a production system (Raspberry Pi2 on Raspbian Jessie, domoticz beta 3.8564) and a test Raspberry Pi3 on Rasbian Stretch and domoticz beta 3.8564.

Re: Python Plugin: Smart Virtual Thermostat

Posted: Wednesday 15 November 2017 19:30
by jake
Being able to set a different setpoint for each virtual thermostat would be ideal to regulate bath, bed and study rooms in the house without the need of physical thermostats. The only invesment would be in a temperature sensor (if not included in the heating device/remote controlled radiator thermostat) and the remote controlled radiator thermostat itself.

I wonder how to tell the boiler to start heating through the OTGW device when multiple virtual thermostats are used with their own setpoints.

EDIT: I now see that the plugin requires a Domoticz (virtual) switch to turn the heating system on/off. I guess that will take care of multiple thermostats. However, I wonder if OTGW will allow this within Domoticz, I think you can only update the setpoint of the physical thermostat that it is connected with.