Code: Select all
return {
-- 'active' controls if this entire script is considered or not
active = true, -- set to false to disable this script
-- trigger
-- can be a combination:
on = {
devices = {
-- scripts is executed if the device that was updated matches with one of these triggers
'Testsw', -- device name
},
timer = {
-- timer triggers.. if one matches with the current time then the script is executed
'every 10 minutes'
},
},
-- actual event code
-- in case of a timer event or security event, device == nil
execute = function(domoticz,device)
domoticz.log('Alarm zmienił stan')
-- local testsw = domoticz.devices('Testsw')
if (device.state == 'On') then
local pompaCWU = domoticz.devices('Pompa CWU')
pompaCWU.switchOn()
end
end
}