I'm trying to activate the valve in my chimney based on several states. two switch states have to be off and the temperature needs to be below 20°
I tried the following but I'm not getting any results or faults, what's going wrong?
Code: Select all
return
{
on =
{
devices = {
181, 180, 65, 64
}
},
execute = function(domoticz, device)
local Tempsensor = domoticz.devices(64)
local Switch1 = domoticz.devices(180)
local Switch2 = domoticz.devices(65)
local Switch3 = domoticz.devices(181)
local Temp = Tempsensor.temperature
if Switch3.state == 'off' and Switch2 == 'off' and Temp <= 20 then
Switch1.switchOn()
end
end
}