Switch off smoke detector FA20RF  [Solved]

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

Moderator: leecollings

Post Reply
jandirkv
Posts: 27
Joined: Monday 19 February 2018 6:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9117
Contact:

Switch off smoke detector FA20RF

Post by jandirkv »

Hallo,

I have a FA20RF smoke detector Setup in Domoticz as 'smoke detector' device. When I activate the switch the FA20RF starts beeping. or with dzvents code

Code: Select all

domoticz.devices('Rookmelder hal').switchOn()
Somehow I can not turn it off anymore. I tried the following lines.

Code: Select all

domoticz.devices('Rookmelder hal').switchOff()
I can turn it off by pressing the reset button in domoticz in the switches panel. So I tried

Code: Select all

domoticz.devices('Rookmelder hal').reset()code]
and
[code]domoticz.devices('Rookmelder hal').state == 'reset'
and

Code: Select all

domoticz.devices('Rookmelder hal').state = reset
Also my smoke detector does not always respond to the 'On' action of my RFlink which is a few feet Away from my smoke detector. If it started beeping is responds only after a while again on the 'On' Command.

Has anyone succefully integrated his smoke detectors??
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Switch off smoke detector FA20RF

Post by waaren »

jandirkv wrote: Sunday 21 October 2018 11:18 Hallo,

I have a FA20RF smoke detector Setup in Domoticz as 'smoke detector' device. When I activate the switch the FA20RF starts beeping. or with dzvents code

Code: Select all

domoticz.devices('Rookmelder hal').switchOn()
Somehow I can not turn it off anymore.
There is no device-adapter for the switchType smokeDetector defined in dzVents yet. Until then you can use this dzVents script to reset the state of a smoke detector.

Code: Select all

return {
            on   = { timer = { "every minute"}},
   
            logging =   {   level   =   domoticz.LOG_DEBUG,
            marker  =   "reset Security" },
   
                   
    execute = function(dz)
        mySmokeDetector = 1107                              -- Change this to the idx of your smokeDetector   

        local function resetSmokeDetector(idx)
            local  url   = dz.settings['Domoticz url'] .. 
                           "/json.htm?type=command&param=resetsecuritystatus&idx=" .. 
                           idx .. 
                           "&switchcmd=Normal"
            dz.openURL(url)
        end               

        resetSmokeDetector(mySmokeDetector)
     end
}
Also my smoke detector does not always respond to the 'On' action of my RFlink which is a few feet Away from my smoke detector. If it started beeping is responds only after a while again on the 'On' Command.
Has anyone succefully integrated his smoke detectors??
If the RFlink sends the commands like normal there is probably not much domoticz can do to influence this behavior.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Switch off smoke detector FA20RF

Post by waaren »

Send you a PM
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Switch off smoke detector FA20RF

Post by sincze »

jandirkv wrote: Sunday 21 October 2018 11:18
Also my smoke detector does not always respond to the 'On' action of my RFlink which is a few feet Away from my smoke detector. If it started beeping is responds only after a while again on the 'On' Command.

Has anyone succefully integrated his smoke detectors??
Correct, had the issue while pairing. Have to send the command multiple times to trigger the device with RFLINK.

As i don't have DZvents enabled at my parents home I had to dust off the old LUA skills.

Code: Select all

if ( ((devicechanged['Melder 1'] == 'On') or
     (devicechanged['Melder 2'] == 'On') or
     (devicechanged['Melder 3'] == 'On') ) and (uservariables["Brandalarm"] == 'False') )
then
	print('<font color="red">### Brandalarm.</font>')
	os.execute (notify_telegrambot)
    if (otherdevices['Melder 1'] ~= 'On') then commandArray['Melder 1']="On FOR 4 SECONDS REPEAT 3 INTERVAL 4 SECONDS" end -- Woonkamer 
    if (otherdevices['Melder 2'] ~= 'On') then commandArray['Melder 2']="On FOR 4 SECONDS REPEAT 3 INTERVAL 4 SECONDS" end -- Overloop
    if (otherdevices['Melder 3'] ~= 'On') then commandArray['Melder 3']="On FOR 4 SECONDS REPEAT 3 INTERVAL 4 SECONDS" end -- Zolder
    commandArray['Variable:Brandalarm']=tostring('True')

elseif ((devicechanged['Melder 1'] == 'Off') or
        (devicechanged['Melder 2'] == 'Off') or
        (devicechanged['Melder 3'] == 'Off') )
then
        if (otherdevices['Melder 1'] ~= 'Off') then commandArray['Melder 1']="Off" end -- Woonkamer 
        if (otherdevices['Melder 2'] ~= 'Off') then commandArray['Melder 2']="Off" end -- Overloop
        if (otherdevices['Melder 3'] ~= 'Off') then commandArray['Melder 3']="Off" end -- Zolder
        commandArray['Variable:Brandalarm']=tostring('False')
end
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Switch off smoke detector FA20RF

Post by pvklink »

Is there a function in the meantime in dzvents to set the reset of a smope detector. After my alarm went of i automaticly want to reset it when pushing the all alarm button (radio, light etc.)

otherwise i use the workaround
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: Switch off smoke detector FA20RF

Post by waaren »

pvklink wrote: Saturday 06 July 2019 11:22 Is there a function in the meantime in dzvents to set the reset of a smope detector. After my alarm went of i automaticly want to reset it when pushing the all alarm button (radio, light etc.)

otherwise i use the workaround
The device-adapter is created but after I asked Jan Dirk to test it he never replied and he does not seem to be active any longer on this forum.
If you want to test the device-adapter. Here it is. Just save it as <domoticz dir>/dzVents/runtime/device-adapters/smokeDetector_device.lua and control your smoke detector with methods activate() and reset()

Code: Select all

return {

    baseType = 'device',

    name = 'Smoke Detector device adapter',

    matches = function (device, adapterManager)
        local res = device.switchType == 'Smoke Detector'
        adapterManager.addDummyMethod(device, 'activate')
        adapterManager.addDummyMethod(device, 'reset')
        return res
    end,

    process = function (device, data, domoticz, utils, adapterManager)

        if (device.switchType == 'Smoke Detector') then
            function device.reset()
                local url
                url = domoticz.settings['Domoticz url'] ..
                        "/json.htm?type=command&param=resetsecuritystatus&idx=" .. 
                        device.id .. 
                        "&switchcmd=Normal"
                return domoticz.openURL(url)
            end
        
            function device.activate()
                local TimedCommand = require('TimedCommand')
                return TimedCommand(domoticz, device.name, 'On', 'device', device.state)
            end
        end
    end
}

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: Switch off smoke detector FA20RF

Post by pvklink »

Ok, i will test it and give feedback!
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
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Switch off smoke detector FA20RF

Post by pvklink »

OK, did it..

added the file on
<domoticz dir>/dzVents/runtime/device-adapters/smokeDetector_device.lua

Made a test file with

....
dz.devices('smoke_trap').reset() -- reset smoke detectors
dz.devices('smoke_hal').reset() -- reset smoke detectors
globalMessage(add, ' smoke devices gereset',logcode) -- write to logs

globalMessage(chg) -- dump



error (probl. did something wrong.
2019-07-07 09:41:12.104 Error: dzVents: Error: (2.4.24) An error occurred when calling event handler OFF_DZ_test_msg
2019-07-07 09:41:12.104 Error: dzVents: Error: (2.4.24) ...cz/scripts/dzVents/generated_scripts/OFF_DZ_test_msg.lua:41: attempt to call field 'reset' (a nil value)
2019-07-07 09:41:14.114 (zwavepluspvk) General/kWh (buro_kwh)
2
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: Switch off smoke detector FA20RF  [Solved]

Post by waaren »

pvklink wrote: Sunday 07 July 2019 9:45 OK, did it..

added the file on
<domoticz dir>/dzVents/runtime/device-adapters/smokeDetector_device.lua

Made a test file with

....
dz.devices('smoke_trap').reset() -- reset smoke detectors
dz.devices('smoke_hal').reset() -- reset smoke detectors
globalMessage(add, ' smoke devices gereset',logcode) -- write to logs

globalMessage(chg) -- dump



error (probl. did something wrong.
2019-07-07 09:41:12.104 Error: dzVents: Error: (2.4.24) An error occurred when calling event handler OFF_DZ_test_msg
2019-07-07 09:41:12.104 Error: dzVents: Error: (2.4.24) ...cz/scripts/dzVents/generated_scripts/OFF_DZ_test_msg.lua:41: attempt to call field 'reset' (a nil value)
2019-07-07 09:41:14.114 (zwavepluspvk) General/kWh (buro_kwh)
2
Send a PM
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest