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.