smoke_detector  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

smoke_detector

Post 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
}
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: smoke_detector  [Solved]

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: smoke_detector

Post by pvklink »

ok, clear!
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest