It looks like the script is not triggered.
So please answer these questions:
- which version are you on (domoticz and dzVents (look an the about page))
- did you change the name in the script to reflect the name of your device, like below ?
- is the script saved as dzVents and as 'On'
Code: Select all
-- Secure devices using protect API
-- Add device IDX to protect to deviceList table
return
{
on =
{ devices = { 'Presenza' }}, -- !! change to the name of your switch !!
logging =
{
level = domoticz.LOG_DEBUG, -- Set to error when script is OK
marker = 'Secure trigger2'
},
execute = function(dz, item)
local deviceList = { 35, -- !! Replace / Add your device IDX numbers here !!
2228,
2277,
}
local protectMe = not(item.active)
local function protect(idx)
local url = dz.settings['Domoticz url'] .. '/json.htm?type=setused&used=true' ..
'&protected=' .. tostring(protectMe) ..
'&idx=' .. idx
dz.openURL(url)
end
for _, idx in ipairs(deviceList) do
protect(idx)
end
end
}