No presence detection
Posted: Sunday 11 October 2020 19:18
I had a chat with my sister who lives alone about what would happen if something severe like an infarct would happen.
Her children call her, I call her but it doesn't happen every day.
We talked about presence detection, about presence detection and privacy.
No camera, just motion detection.
We concluded that the best possible surveillance would be a presence detection in the bedroom acting between 00:00 and 06:00 which only sends a notification if no presence is detected.
The same applies to the living room let's say between 08:00 and 22:00
Of course Domoticz comes to my mind.
I've been thinking about using something like system alive check
The setup would be RPI with a motion detection sensor which sends a notification when no motion is detected.
I have this system alive checker setup for the heating and Luftdaten as an example.
When one of the systems don't respond it sends out one notification which should be sufficient.
The code is interesting because of this one notification triggered and not spamming with a notification every minute or so.
Her children call her, I call her but it doesn't happen every day.
We talked about presence detection, about presence detection and privacy.
No camera, just motion detection.
We concluded that the best possible surveillance would be a presence detection in the bedroom acting between 00:00 and 06:00 which only sends a notification if no presence is detected.
The same applies to the living room let's say between 08:00 and 22:00
Of course Domoticz comes to my mind.
I've been thinking about using something like system alive check
The setup would be RPI with a motion detection sensor which sends a notification when no motion is detected.
I have this system alive checker setup for the heating and Luftdaten as an example.
When one of the systems don't respond it sends out one notification which should be sufficient.
Code: Select all
--System-alive-check
-- this script can be used in conjunction with the System-alive checker plug-in.
-- the plugin pings a list of devices and creates switches for these devices
-- the reason for this script is to not treat devices as dead immediately after they
-- do not respond. More often than not, the second ping atempt does work. So only
-- if the device has been not responding for a while AFTER it is been presumed dead
-- then this script will notify you
-- put the names of these switches in the devicesToCheck list
-- you may have to tweak the THRESHOLD depending on the check interval
local THRESHOLD = 11 -- minutes
local devicesToCheck =
{
'CV-ping',
'Luftdaten',
}
return
{
on =
{
devices = devicesToCheck,
timer =
{
'every 10 minutes',
},
},
data =
{
notified = { initial = {} },
},
logging =
{
level = domoticz.LOG_ERROR, -- change from LOG_DEBUG to LOG_ERROR when script executes without problems
marker = 'notify',
},
execute = function(dz, item)
if item.isTimer then
for index, deviceName in ipairs(devicesToCheck) do
local device = dz.devices(deviceName)
--dz.notify('notifyer achter de eerste if.',dz.PRIORITY_HIGH)
dz.log('device name ' .. device.name, dz.LOG_DEBUG)
dz.log('device state ' .. device.state, dz.LOG_DEBUG)
dz.log('device lastUpdate ' .. device.lastUpdate.minutesAgo, dz.LOG_DEBUG)
dz.log('device notified ' .. tostring(dz.data.notified[deviceName]), dz.LOG_DEBUG)
if device.state == 'Off' and device.lastUpdate.minutesAgo >= THRESHOLD and dz.data.notified[deviceName] ~= true then
--dz.notify('notifyer achter de tweede if.',dz.PRIORITY_HIGH)
dz.log('Idle device ' .. deviceName, dz.LOG_DEBUG)
dz.notify('notifyer', deviceName .. ' is not responding anymore.',dz.PRIORITY_HIGH)
dz.data.notified[deviceName] = true
end
end
else
dz.data.notified[item.name] = false
end
end
}