Turning on switch based on two thermostats

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
blader18
Posts: 7
Joined: Friday 22 January 2016 19:33
Target OS: Windows
Domoticz version:
Contact:

Turning on switch based on two thermostats

Post by blader18 »

Hi guys,
Simple question here.
I have two thermostats. How can I create a condition to enable one switch if one of the thermostat is above a X temperature and the second thermostat is above Y themperature?

Thanks in advance.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Turning on switch based on two thermostats

Post by waaren »

blader18 wrote: Thursday 19 November 2020 11:45 Hi guys,
Simple question here.
I have two thermostats. How can I create a condition to enable one switch if one of the thermostat is above a X temperature and the second thermostat is above Y themperature?

Thanks in advance.
You probably need scripting to do that in domoticz.
Using dzVents it could look like below example

Code: Select all

return 
{
    on = 
    {
        devices = 
        {
            'thermostat1', -- change your thermostat name
            'thermostat2', -- change your thermostat name
        }
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- set to domoticz.LOG_ERROR when all ok
        marker = 'multiple thermostats',
    },
    
    
    execute = function(dz)
        local thermostat1 = dz.devices('thermostat1') -- change your thermostat name
        local thermostat2 = dz.devices('thermostat2') -- change your thermostat name
        local mySwitch = dz.devices('mySwitch') -- change your switch name
        
        local xTemperature = 10
        local yTemperature = 20
        
        if thermostat1.setPoint > xTemperature and thermostat2.setPoint > yTemperature then
            mySwitch.switchOn().checkFirst()
        end
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest