smoke_detector
Posted: Saturday 19 January 2019 16:12
Hi, i converted my last three blockly devices and one of them is a smokedetector.
I got the dzvents script working when it detects smoke, the alarm switch is put on and several devices are triggered
My smokedetector device in domoticz has a reste button lighten-up now. Can dzvents react on the reset button of this device?
I tried the off state, but that does not work..
I got the dzvents script working when it detects smoke, the alarm switch is put on and several devices are triggered
My smokedetector device in domoticz has a reste button lighten-up now. Can dzvents react on the reset button of this device?
I tried the off state, but that does not work..
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
}