Is it possible to change the setting of the thermostat setting in blockly? lets say if switch "121" is on then set this to economy and if switch "121" is off then to normal again. If someone can give me a push how to get it done

Cheers!
Moderator: leecollings
Code: Select all
-- switch-another
local pushOn1 = 'Lotek aan'
local pushOff1 = 'Lotek uit'
local pushOn2 = 'Piano aan'
local pushOff2 = 'Piano uit'
local pushOn3 = 'Bank aan'
local pushOff3 = 'Bank uit'
return
{
on =
{
devices =
{
pushOn1,
pushOff1,
pushOn2,
pushOff2,
pushOn3,
pushOff3,
},
},
logging =
{
level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all OK
marker = 'pianoLights',
},
execute = function(dz, item)
--local pushOn1 = dz.devices(pushOn1)
--local pushOff1 = dz.devices(pushOff1)
--local sonof = dz.devices('Sonoff')
--if item == pushOn1 and item.active then
-- sonof.switchOn()
--elseif item == pushOff1 and item.active then
--sonof.switchOff()
--end
local pushOn2 = dz.devices(pushOn2)
local pushOff2 = dz.devices(pushOff2)
local Shelly_20_0 = dz.devices('Shelly 20-0')
local Shelly_20_1 = dz.devices('Shelly 20-1')
if item == pushOn2 and item.active then
Shelly_20_0.switchOn()
Shelly_20_1.switchOn()
elseif item == pushOff2 and item.active then
Shelly_20_1.switchOff()
Shelly_20_0.switchOff()
end
end
}
Users browsing this forum: No registered users and 1 guest