Hello,
I don’t think it’s possible whitout writting some Luup code.
It’s not exactlly what you’re searching for but it might help.
I written a small lua code I called “Virtual vigil”. The goal is to detect abnormal movement arround the house.
So here is how I made that :
- I placed a detector in front and at the rear of the house.
- Every time it’s armed and it detect a move, it will increment a value stored (mvt-AV or mvt-AR) à in a virtual container.
- Each minute, an other scene will compare this number of move to the number 1 minute ago.
- If move number exceed a value (here 4), it will increment a “the warning level”
- Based on the warning level, some scene a triggered as turn on a light, move the camera, blink the alarm light , …
what still need to be coded :
- Warning level automatically goes down if there is no motion during an amount of time
- Warning level goes down based on some genuine action : turn off the alarm, …
Here is the code
Scene MouvementCounterAV (same for mvtAR)
local countAV = luup.variable_get("urn:upnp-org:serviceId:VContainer1","Variable1", 79)
countAV = countAV + 1
luup.variable_set("urn:upnp-org:serviceId:VContainer1","Variable1",countAV,79)
Scene counter check :
local countAV = luup.variable_get("urn:upnp-org:serviceId:VContainer1","Variable1", 79)
local countAR = luup.variable_get("urn:upnp-org:serviceId:VContainer1","Variable2", 79)
local countAVLast = luup.variable_get("urn:upnp-org:serviceId:VContainer1","Variable3", 79)
local countARLast = luup.variable_get("urn:upnp-org:serviceId:VContainer1","Variable4", 79)
local alertLevel = luup.variable_get("urn:upnp-org:serviceId:VContainer1","Variable5", 79)
local sensibAV = 20
local sensibAR = 4
local diffAV = countAV - countAVLast
local diffAR = countAR - countARLast
luup.variable_set("urn:upnp-org:serviceId:VContainer1","Variable3",countAV,79)
luup.variable_set("urn:upnp-org:serviceId:VContainer1","Variable4",countAR,79)
if diffAV >= sensibAV or diffAR >= sensibAR then
alertLevel = tonumber(alertLevel)
alertLevel = alertLevel + 1
luup.variable_set("urn:upnp-org:serviceId:VContainer1","Variable5",alertLevel,79)
if alertLevel == 2 then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "19"}, 0)
elseif alertLevel == 3 then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "20"}, 0)
elseif alertLevel == 4 then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "21"}, 0)
end
else
if alertLevel == "2" then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "19"}, 0)
elseif alertLevel == "3" then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "20"}, 0)
elseif alertLevel == "4" then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "21"}, 0)
end
end
And you also need to create a virtual container with the following value :
1 - Number of move at front
2 - Number of move at rear
3 - Last minute number of move AV
4 - Last minute number of move AR
5 - Warning level
Good luck with your project