Delay for PIR?
Posted: Friday 13 March 2020 14:08
I've a couple of motion detectors that send snapshots to Telegram when motion is detected. The basic setup works nicely, but motion is detected a bit too far away: how to add a delay in dzvents scrip?
The current script below. Eg, adding ".afterSec(1)" after the os.execute does not work.
Another option would also be recording a short video clip to my Raspberry in addition to the snapshot, but that I couldn't figure out either.
Any ideas? Thanks in advance.
The current script below. Eg, adding ".afterSec(1)" after the os.execute does not work.
Code: Select all
return {
on = {
devices = {
'Motion detector 1',
}
},
execute = function(dz, device)
local securityArmed = (dz.security == dz.SECURITY_ARMEDAWAY or dz.security == dz.SECURITY_ARMEDHOME)
if device.active and securityArmed then
os.execute('sudo /home/folder/to/scripts/snapshot.sh &')
end
end
}
Any ideas? Thanks in advance.