I have bought a PIR (Motion Sensor) and I want to monitor if it has false positives. So I was thinking to create a lua script that makes a separate log file somewhere, whenever my PIR is on and I am not home. It doesn't have to be readable within Domoticz, I'm fine with setting up a SSH connection and cat the logfile.
So I was thinking something like:
Code: Select all
commandArray = {}
if (devicechanged['PIR'] == 'On' and otherdevices['Home'] == 'Off') then
file = io.open("home/pi/domoticz/scripts/motionlog.txt", "w")
file:write(os.time "Motion detected while not home")
file:close()
end
return commandArray
I hope someone can help. thanks in advance.