Using a virtual thermostat to set target temperature?

Looking for advice on if the following is possible.

I have a multi-zone floor heating system which each is controlled with an electric valve. Each valve is connected to a Sonoff Basic switch, and each Sonoff switch is connected to ST using the Tasmota Edge driver (works well btw). Right now I have two routines per zone - one to turn on heat if temp goes below a set temp, and one to turn off when temp goes above the same temp. Each room in the house has temperature sensor.

This works, but i want this to be more user friendly so that others can set the on/off temperature without having to change two routines.

The easiest method would be to create a virtual thermostat for each room, so a user could set the thermostat and i would create a routine that would first read the set temperature from the virtual thermostat, compare that to the actual temperature from the room temperature sensor and either turn on or off the correct Sonoff switch.

I am not seeing how I can do this without some type of variable - the thermostat would write the set temp into that variable and i could then compare the actual temp to that variable.

There might be some other, and better, way to accomplish the same end goal.

So if anyone has suggestions or can guide me in the right direction then that would be greatly appriciated.

If they are Z-wave or Zigbee temperature sensors you can use @Mariano_Colmenarejo "Zigbee Temp Sensor and Child Thermostat Mc or “Z-Wave Sensor and Child Thermostat Mc” driver. Once you change to his driver you can create a virtual thermostat using the settings menu in that device and it will automatically receive the room temperature from the parent device.

The alternate method which would work with Z-wave, Zigbee, WiFi and c2c devices is to use the API Rules. The rule would transfer the room temperature from your physical device to the virtual thermostat. You can copy some ones rule, edit the devise IDs and upload the revised rule using @TAustin API Browser+.


I may be mistaken, but the way I read it, the OP wants to get the value from the virtual thermostat and then compare that to the physical sensor and then turn on a switch. :thinking:

So I think what he wants is variables with stored values. There’s probably a way to do that with the rules API, otherwise I think you can do it with the paid tier version of Sharptools.

That’s not how I read it, but I could be wrong as I have been many times.

“The easiest method would be to create a virtual thermostat for each room, so a user could set the thermostat”

Using Rules API it is possible to compare temperature measurement and thermostat setpoint.

This topic has examples:

1 Like

Hi @MagnusBergs

If the temperature sensors have zigbee or zwave, which are or can be added to the drivers, you can create and use a virtual thermostat with each sensor.

This is the thermostat manual.

I have been using it for 2 years with my heater and it works very well.


Go with @Mariano_Colmenarejo’s driver. It is created for your needs. You would get thermostat with each sensor, and be able to create on/off automations, without adjusting them later. You’ll be able to adjust temperature by changing thermostats’ desired temperature.

1 Like

@Mariano_Colmenarejo thank you!

I was already using your driver and actually had the idea to use the thermostat option, but did not know I had to wait for data push from the temp sensor for it to activate so I removed it thinking it did not work.

So have the basic functionality is up and working. Turn the Sonoff switches to on when the state is heating, and off when state is cooling.

The only “issue” I see is usability. If my wife or daughter want to change the settings for a room they need to change two numbers - Heating and Cooling temperature.

It would be far better if they only saw one number, as on regular thermostat, and they could move that up or down. Then all other calculations and magic would be in the settings.

Maybe this is possible, but have only read the manual once so i might have missed something as it very detailed and there is a surprising amount of clever things in there.

1 Like

They don’t have to change both, they can change just Cooling for example, if it’s in cooling mode.

This depends on thermometer. On ecobee in auto mode I can see both temperatures heating and cooling.

Other modes besides Auto/Cooling/Heating are more like presets when you are Away/Sleeping/Home that you can preset desired temperature in settings, and then just call specific program with automation.

Hopefully this helps a little bit.

Btw I have couple of these controlinng for example garage heater, attic fan, bathroom fans…

I have learned from bitter experience :slightly_smiling_face: that simple is better when dealing with regular users. For me having two temps makes perfect sense, but rest of family will be confused and then not use. The perfect solution from my perspective would be if the UI had two modes - simple and advanced.

Just my 2c.

Other than that, this driver works like a champ.