Hello Waaren,
fantastic. Everything is working great now. Very good.
If I set the alarm via tag reader (Arm Away), or Remote (Arm Away, Arm Home) a countdown starts (peep), and after 22 seconds the alarm is on!
Almost ready for operantional use. Now some testing with the actually alarm and shutdown in case of false alarm
Edit: I had a look at the code for the remote controller.
Code: Select all
return
{
on =
{ devices =
{
'RemoteTagReaderAlarmAway',
'Remote-1',
'Remote-2',
'Remote-3',
}
},
logging = { level = domoticz.LOG_DEBUG },
execute = function(dz, item)
_G.logMarker = _G.moduleLabel
delay = 20 -- domoticz adds another 30 seconds to this it so you will have ~60 seconds
security = dz.devices('Domoticz Security Panel')
local function osCommandInBackground(cmd)
dz.log('Executing Command: ' .. cmd,dz.LOG_DEBUG)
local fileHandle = assert(io.popen(cmd .. ' &' , 'r'))
fileHandle:close()
end
if item.state == 'On' then
if item.name == 'RemoteTagReaderAlarmAway' or item.name == 'Remote-1' then
security.armAway().afterSec(delay)
osCommandInBackground('sudo /home/pi/bin/countdown.sh')
elseif item.name == 'Remote-2' then
security.armHome().afterSec(delay)
osCommandInBackground('sudo /home/pi/bin/countdown.sh')
elseif item.name == 'Remote-3' then
security.cancelQueuedCommands()
security.disarm()
end
elseif item.name == 'RemoteTagReaderAlarmAway' then
security.cancelQueuedCommands()
security.disarm()
end
end
}
Is the RemoteTagReaderAlarmAway in this script still required? It looks to me as if it has no function anymore. Since you implemted the timeout in another way.
ps. I used the Digital alarm watch sound from BBC sound archives:
link as countdown sound.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.