Page 1 of 1

Mouse detection

Posted: Wednesday 13 June 2018 21:08
by Ries
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.

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
}

Re: Mouse detection

Posted: Tuesday 23 April 2019 17:33
by Sarcas
lol
Nice one. Hope you managed to active the cat device ;)

S.