I got the dzvents script working when it detects smoke or a burgler is active, the alarm switch is put on and several devices are triggered
In my old blockly script i had a rule "send camera_snapshot <camera> with subject <subject> after <x> seconds.
This part worked quit well! Is there a simular option in dzvents? i cant find it!
Code: Select all
return {
on = {devices = {'smoke*','Smoke*'}}, -- alle devices die met Smoke beginnen worden door dit script opgepakt
logging = { level = domoticz.LOG_DEBUG , -- Uncomment to override the dzVents global logging setting
marker = "Security"},
execute = function(dz, device, info)
local switch = dz.devices('Alarm_knop')
if device.state == 'On' then -- huis op alarm, iedereen is weg
switch.switchOn().checkFirst() --.silent() is als je volgende events niet wil starten
dz.log("Script: " .. info.scriptName .. " Er is een smokealarm, scenes worden geactiveerd....", dz.LOG_INFO)
elseif device.state == 'Off' then -- huis op alarm, iedereen is weg
switch.switchOff().checkFirst() --.silent() is als je volgende events niet wil starten
dz.log("Script: " .. info.scriptName .. " Er is een smokealarm, scenes worden geactiveerd....", dz.LOG_INFO)
else
dz.log("Script: " .. info.scriptName .. " Smokealarm, onbekende alarmstatus....", dz.LOG_INFO)
end
end
}