Page 1 of 1

smoke_detector

Posted: Saturday 19 January 2019 16:12
by pvklink
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..

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
}

Re: smoke_detector  [Solved]

Posted: Saturday 19 January 2019 19:12
by waaren
pvklink wrote: Saturday 19 January 2019 16:12 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..
Pressing the reset button of a smoke detector does not create an event in domoticz. So dzVents cannot react.

Re: smoke_detector

Posted: Saturday 19 January 2019 19:39
by pvklink
ok, clear!