Page 1 of 1
Smart thermostat change settting
Posted: Sunday 21 February 2021 16:26
by jacobsentertainment
Hi all,
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.

- thermostat.jpg (81.82 KiB) Viewed 392 times
If someone can give me a push how to get it done
Cheers!
Re: Smart thermostat change settting
Posted: Monday 22 February 2021 0:16
by HvdW
I would go for dzvents
Here is an example I copied somewhere in Domoticz where action is taken when one lamp switches.
It doesn't use IDX but the 'human' name you gave to your device.
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
}