Mouse detection
Posted: Wednesday 13 June 2018 21:08
I have a PIR under the diner table so it would turn on if someone would sit at the table.
It turned out to be an excellent mouse detector. We didn't know we have them.
I created the following simple script to set an dummy alarm "Mouse detected" and a dummy text device that logs the activity during away or asleep hours.
It turned out to be an excellent mouse detector. We didn't know we have them.
I created the following simple script to set an dummy alarm "Mouse detected" and a dummy text device that logs the activity during away or asleep hours.
Code: Select all
return {
on = {
devices = {
'Eettafel PIR', 'Sensor keuken'
}
},
execute = function(domoticz, device)
if domoticz.devices('Status').active then -- status is active when all are asleep or away
domoticz.devices('Mouse detected!').switchOn().checkFirst()
domoticz.devices('Mouse report').updateText('Device ' .. device.name .. ' was changed to '.. device.state)
end
end
}