Smart Virtual Thermostat

thermostat_80x80

Description : Drive your heaters with indoor and optional outdoor temperature sensors.

InstallDonate

With users from touteladomotique forum, we speak about lack of plugin to manage our heaters. With Fatal25 we started development to complete a first version published in early December 2012.

1/ How it works

Goal of thermostat is to regulate the temperature in a room (or area). It exists real thermostats (some in Zwave) , equipped with a temperature sensor and a control link to your heater. You tell it a setpoint and it drives the heaters to stay around.

Here, this the same principle except thermostat is virtual and can drive from Vera (or your iPhone).

1.1/ What do you need?

A heater controlled by the Vera and a temperature sensor (which is also connected to Vera).  I suggest you to use Oregon probes and RFXCOM USB module (eg here). So you can enjoy the decimal places for temperature control.

1.2 / basis functions

Once set up correctly (we will how to setup later in the article). You will be able to control one or more radiators

Different modes:

Thermostat can be in three modes:

  1. Off : Shutdown all heaters
  2. Auto : let plugin decided (based on the temperature) whether on or off heaters. This is the most common mode.
  3. Bypass : plugin is disabled. Useful to be able to operate your heater without this module.
  4. Heat :  forced mode. put your heaters On (during forced mode duration).

In Auto mode, plugin automatically decide, based on the temperature of the room and outdoor temperature (optional) heating duration necessary to achieve or maintain wishes temperature. To do that, once per hour (or when setpoint changes, etc.). Plugin calculates a percentage of heating. As an example (values ​​are fictive) the temperature is 21° and the room temperature to 20.3°, plugin estimate a heat time of 25%. It  turns On heaters during the first 15 minutes, then Off for next 45 minutes. After a hour, it restarts the calculation to estimate the need for next hour etc..

This lets time to equilibrate room temperature’s before recalculating a heating duration. In this way it is independent of distance between temperature sensor and heater. Thus we limit number of changes of state of heater control modules.

Temperature setpoints:

There are two setpoints: one for the comfort mode (red) and one for the Eco mode (blue). Depending on what mode is set, plugin uses it to calculate the heating duration (if of course you are in Auto mode). In case of change of setpoint or setpoint mode, heating time calcul is restarted without waiting for end of hour.

It is possible to choose a decimal value to the instructions given through the full:

To do this, you must use the “Set” button for example with the value “20.5” (note the decimal point is the point).

1.3 / Advanced functions

Auto learning :

Each room (or area) has their own characteristics: thermal inertia – heating power – outside Insulation. Heating time required to reach the set temperature is specific to each of them. Plugin is continuously learning to calculate right heating time and thus do not consume more than necessary. At each end of the heating phase,  plugin examines and adjusts coefficients. To avoid disturbances due to external heat sources, coefficient calculation is a weighted average of the last 50 learning. Therefore let several days (2-3) for the best fits plugin.

For example, at home with default coefficient (60 inside and 1 outside), the average temperature of room was rather between 21.2° and 21.5°. After 3 days with auto learning,new constants are 49.7 for indoor and 2 outdoor.

Capture d’écran 2012-12-19 à 21.40.00
we can see each hour’s (yellow square), room temperature is 21 (= setpoint).temperature rises during the hour until 21.2° then reach 21°. But my probe is rather close to heater, so when temperature  is averaged in the room, the perceived temperature is well 21°.

Shutdown when opening windows :

It possible to add door sensors (or virtual switchs) to shutdown heaters.

Il est également possible de choisir un délai avant la coupure et un délai avant la reprise. Ainsi si vous ouvrez et refermez la fenêtre durant un bref instant (inférieur à la durée du délai que vous aurez paramétré), le plugin ne coupera pas le chauffage. (idem pour la reprise, si vous fermez et rouvrez brièvement votre fenêtre alors que le module a été coupé suite à l’ouverture prolongée de la fenêtre)

It is also possible to choose a delay before shutdown / resumption. So if you open and close the window for a short time (less than delay you set), the plugin will not cut heating.

Tempo forced mode:

It is possible to choose to associate a time limit for forced mode. If a deadline is set, when you turn (manually or via a scene) the forced mode button (heat), a countdown begins. At the end of module automatically reverts to Auto mode.

Safety on temperature sensors:

Security checks that temperature from your probes date less than 2 hours for inside temperature and 24 hours for outside temperature. Otherwise, the probe is skipped. If all probes are ignored, the plugin will consider that the room temperature is equal to set temperature and turn off  heaters.

So no problem if one of your sensors has no battery, there is no risk that the heaters remains active for hours

2 / Installation and Configuration plugin

2.1 / Installing the plugin

Just go in APPS and install applications on the VERA, then download the module Smart Virtual Thermostat .

Smart Virtual Thermostat - Install from store

Once the installation is complete, a new module has appeared on your interface:

SmartVT - Miniature

Press the “Reload” your interface to restart the vera:

After (a  page refresh may be necessary), enter the advanced settings of the module.

2.2 / Setup plugin

Once the module is created, here is the list of available settings:

Mandatory parameters:

Inside Temp Sensors: Complete list of ID with your internal temperature sensors separated by commas. The plugin average all values.

heaters: Complete list with the ID of your radiators separated by commas

Optional parameters:

Outside Temp Sensors: Complete list of ID with your external temperature sensors separated by commas. The plugin average all values.

inhibit Sensors: Complete with a list of your door sensors separated by commas. If you want to reverse the condition (switching off the heating if the sensor is 0) must put a minus before the id of the module. If at least one of the sensors is activated => heating off.

Waiting Time Open: Duration of tempo seconds before switching off the heating if the sensor is activated

Waiting Time Close: Time in seconds before the timer resumption heating if all the sensors are disabled

Forced Mode Duration: Duration of forced mode before returning to automatic mode. XX: the second, XXm: in minutes (eg 30m) XXh: in hours (eg 1h).

PowerMin:% minimum heating if the module believes it is necessary to heat (according to the temperature inside and outside)

Calculation period: Time (in seconds) between two calculations of heating power (3600 by default)

ConstC: This is the coefficient of heat inside. It depends on the size of your room and the heating capacity of your heater (60 by default)

ConstT: This is the coefficient of external heating. It depends on the insulation part relative to the outside (1 by default)

AutoLearning: This is a variable specific to self calibration. There is no need to touch it. Variable is made up as follows: X, Y1, Y2, T1, T2, P. X is the state parameter: 0 = uninitialized, 1 = initialized, 2 = disabled. Y1 and Y2 corresponds to number of learning for the constant respectively inside and outside the constant. when Y reaches 50 first learning is complete, but self-calibration continue. T1 and T2 are temperatures inside and outside at time of last calculation power. % P is calculated in the final calculation of power.

3/ Evolution des versions

**** 1.5 **** released 12/13/2012

  • Add auto learning.

**** 1.1 **** released 12/04/2012

  • initial version

 

This post is also available in: French

  • Tom

    Thank you so much for this development, its just what I need.

    Is it possible to set the times for Eco or comfort mode? Or use a motion sensor to move between he two modes?

    Thank you.

    • Hi tom,

      You can add Timers with a scheduled scene, but not yet with motion sensor.

      Thank for your support 😉

  • JACW

    Very nice. Thanks. I am having trouble though in connecting it to the thermometer. It is from a 3-in-1 sensor but I assume I use the 1 or 2 character ID from the field “ID” when I open the thermometer device? The thermometer device is showing a temperature of 16degrees but your Virtual Device is showing me 20 degrees as when it was first installed.

  • claudio

    hello I could combine the sensor horstmann hrt4-zw your plugin

    • Hi,
      You can use this plugin with your ASR-ZW as a heater but you have to desable your hrt4-zw (you cannot drive a device with two master ^^).

  • Jay

    Hello. You have done some great work with this plugin!! Just one question. Is it possible to configure the plugin such that the thermostat does not shut down if the thermometer sensor is disabled? I understand that this is a safety feature to stop overheating. In my case my thermometer ( a fortrezz temperature/water sensor ) only updates vera when there is a temperature change or once per day. In this case I dont really want the thermostat to go into a protection mode to prevent overheating.

    • I will think about,
      but if your sensor change only once per day it’s hard to decide heating or not, is’n it ?

      • Jay

        HI Antor. In my case the temperature is reported back to vera once every 2 hours OR when there is a temperature change detected. I am using a fortrezz temperature/water sensor. In my case the temperature sensor is accurate but in the case where the temperature remains constant the thermostat ends up going into a protection mode. Its not that the temperature probe is not accurate it just doesnt report back to vera on a predictable interval. Hopefully this helps describe my predicament.

  • Davide

    Thank you very much, it’s a perfect plugin!!!
    Now, could you create a cooling plugin?

    • Davide

      No interest for the cooling version?
      In the pic there was a “cool” button but in the installed version I’ve a bypass button.

      Thanks
      Davide

  • Morten Hald

    Hi

    Thanks for the nice plugin for MiCasaVerde! I have really enjoyed it – but it seems that there is a bug – or maybe I am misusing it.

    I have a comfort temparature on 20 degrees and a cool temperature on 3 degrees (summer house). After some weeks in 3 degrees it “breaks” when set back to 20. There is a lua code error and i need to uninstall the program.

    Perhaps this could be improved in the next version?

    • I add a new config checker in start-up. It warn you if you haven’t a least one heater and one indoor sensor. What error have you got ?

      Antor

  • Luis Arcas
  • Luis Arcas

    Sorry,

    I’ve found the mistake: I wrote “ServideId” and not “serviceId”. It works…

    Thanks a lot!

  • Zeldhaking

    Thx for this app.
    I can’t use a VirtualSwitch as inhibit Sensor.
    With real sensor it works like a charm.

    Is that a know bug?

  • Hamish

    Is it possible to se tis plugin on a Vera1 with ui4?

    If so are there any instructions somewhere on how to install and config?

  • mda

    Hi, would you have interest in adapting this plugin to work with an autelis pool controller? it has 2 temperatures and two set points (pool and spa), plus some other variable and actions. The manufacturer of the Autelis would make whatever URL calls you need to keep the variable up to date and they have a webservice to control the pool (similar to http://autelis.com/wiki/index.php?title=Pool_Control_%28PI%29_Universal_Devices_ISY_2-Way_Integration) Thanks!

  • Michael

    Hi, would you have any interest in adapting this plugin to work with an autelis pool controller? it has 2 temperatures and two set points (pool and spa), plus some other variable and actions. The manufacturer of the Autelis would make whatever URL calls you need to keep the variable up to date and they have a webservice to control the pool (similar to http://autelis.com/wiki/index.php?title=Pool_Control_%28PI%29_Universal_Devices_ISY_2-Way_Integration) Thanks!

  • TommyE

    Hello

    First of all, thank you for a VERY nice plugin.

    I have a small request that perhaps you could implement?!

    Then thing is that I use a few 433Mhz termometers, and occasionally they send of -40 degrees og +50degrees or some other totally stupid values.

    I was hoping that you maybe could put in a optional check if the last temperature was eg. 25 then the next cannot be more more than +5 og -5 degrees, if it is then it has to just skip and wait for the next update from the termometer.

    Regards
    Tommy

  • kevin

    it is summertime and this app is perfect for running a cooling unit. how do you set it up to function opposite. on when you want it cooler and so forth. great app!

  • Christophe

    Hi, very nice app!
    I have a question though. I’m using a universal binary sensor from Fibaro (http://www.fibaro.com/files/instrukcje/eng/Universal%20Sensor%20FGBS321%20v12%20ENG.pdf) combined with a DS18B20 temp sensor (http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf). This works perfect to read out temperatures.
    My heating is controlled through electrovalves combined with relay modules (http://www.fibaro.com/files/instrukcje/eng/relay%20switch%20FGS221%20v19-%20v110%20ENG.pdf)

    I want to use the DS18B20 + Universal sensor as temperature sensor (this already works as I can see the temperature on your app appear), and use the relay module to control the heater.

    Will this work with your app? I’ve set it up like this but so far I don’t see anything happening.

  • jonas

    Hello,

    Great APP!
    Is it possible to have more virtual thermostats? If so how do you do that?
    thanks

  • Danila

    Hello. Is it possible to control Danfoss Living Connect with Smart Virtual Thermostat?

  • vio

    Is it possible to use this for AC (cooling)? If yes, how to set the parameters?
    Thanks

    • Hi Vio,

      Actually it’s not possible to use this plugin with AC. It’s only for heaters

      Antor

  • vio

    Hi Antor,

    Thanks for the answer. I see inside the plugin files a lot of words about “Cool”.
    Is is possible to start a plug switch which start/stop a fan when temperature goes above a threshold and stop when temp goes bellow another threshold?
    Regards,
    Viorel

  • Joe

    Thank you for the App.
    How to setup this u to control heating system through Honeywell TH8320ZW1000 thermostat. In short, how to turn on/off the heater. The thermostat has ID but but looks like special command are needed turn on/off the heater.

  • Jan

    Thanks for this great app!

    I do notice one strange thing though: even though the thermostat keeps the room temperature comfortably constant, it is always heating by a multiple of 2 minutes. Calculation period is set to 600. Calculation seems OK, but for example 15% heating will switch the heater on for 120 seconds instead of 90 seconds. Did I miss a setting?

    • Hi Jan, recurrent timer used to check the value is set for 2 minutes frequency

      luup.call_timer("RecurentUpdateStatus", 1, "2m", "", tostring(lul_device))

      I doesn’t want to flood the vera with a too short period with multipule thermostat. if you realy want do that (at your own risk), change “2m” to “30” on I_SmartVT1.xml file.

  • Sven

    Which id I have to use, when setting up a everspring Humidity/Temp Sensor? Should I use the main ID or the Tempsensor subID?

    My Virtual Thermostat has an icon with a 20 insinde, is this a changing value or is it just an icon to show it is a thermostat?

    Sven

    • Hi Sven, the icon is only a static image
      I don’t have Everspring sensor so I can’t test myself but is the one with temperature parameter

  • Jan

    Thanks for the quick answer. I’ll play around with this value and the calculation period a bit and see what yields the best results.

  • Sven

    How do I check that my temp an heat id is correct?
    Smart Thermostat is showing 21 Grad, but temp sensor is at 16 Grad.

    Sven

  • Fer

    Hello,
    I have a radiating floor type of heating, but it also works for cooling during summer.
    The plugin works well in the winter, but in the summer, the behaviour should de reversed. It should open when temperature goes above a setpoint.
    Is there a way to add this ‘summer mode’ to the thermostat? Maybe based on a schedule or a virtual switch.

    Thanks in advance

  • Hi great plugin.
    Is it possible to have the plugin switch to off mode based on a scene? I would like to have the sensor control heating for part of the day yet completely off during a defined schedule time?
    Thanks in Advance

  • Ron

    I have a node for my trane thermostat in Vera, when I install this plugin and copy the values of my node and reload this plugin disappears from my mios panel. What am I doing wrong?

  • Freddan101

    Thanks again for this plugin.

    I don’t know if the plugin is still being developed but I would like to suggest to add a humidity sensor option. So if humidity goes above a certain value heating will start.

  • Lars

    This looks really good, but there’s one thing missing – the option to read user set temperatures from the unit itself. My units has a dial to select the desired temperature, and I would love to control my heaters based on that.

    Is this possible with your plugin, or are you planning on implementing it?

    • Oscar

      I think synchronisation with a real thermostat (RT) unit can be achieved with two scenes in Vera. One for setting the RT setpoint triggered by a change in virtual thermostat (VT). And the other for setting the VT setpoint and mode triggered by a change in RT. I could no figure out how to retrieve the values though… probably will require LUA code.

  • lord55

    is this project still active for more improvements?

  • Dan

    I was wondering if it’s possible to set the mode to Eco or Comfort through the PLEG plugin (Program Logic Event). So far what I have managed is to switch the heat CurrentSetpoint between 16 and 21 by setting the Device Action to urn:upnp-org:serviceId:TemperatureSetPoint1_Heat > SetCurrentSetpoint.

    That works fine but feels a little bit hacky and I can’t then change the hot and cool temperatures from the thermostat controls on the device page with the nice little arrows; I have to go deep into the PLEG rules to change them.

    I have a feeling it’s SetMode, SetModeTarget or SetEnergyModeTarget but I don’t know what the argument is. Trying to set the mode from the Control view in the “Actions” tab also doesn’t work.

  • disqus_U4Co7p44af

    Are now trying the Smart virtual thermostat on my Vera. Is it possible to switch to/from Eco and comfort based on my modes (home/away)?

    • disqus_U4Co7p44af

      I think I found a way; Set up a interval triggered scene. Put the thermostat in Eco Mode when in “Away”, and trigger the scene once every hour. Likewise using a interval triggered scene that runs in “home” mode that sets the thermostat in comfort mode. I hope that the thermostat “remembers” the setting in the scene creation, and that it is not a “toggle” command to the thermostat that switches back and forth each time the scene is triggered… Yet to find out.