What is it with Vera and security sensors? It seems they all give false triggers. I am beginning to suspect that the problem may be in Vera’s implementation rather than the hardware…
I have just discovered that I have the same issue reported by @UKsub and @filifjonkan: One of the channels on my Fibaro Universal Binary Sensor gets re-triggered without being un-tripped. This channel reflects the Armed state of my house alarm system and is used to trigger scenes to set an Away/Home virtual switch - except when the alarm is armed at bedtime. When it falsely triggers in the middle of the night, it sets Away and causes all sorts of havoc! :o
After perusal of the log I discovered an interesting thing: The state of the sensor does not change but Vera rewrites the Tripped variable (…was: 1, now: 1…) which triggers the scene. It does this just after it has polled the sensor! >:(
I have a work-around. I add a variable to the device to indicate the last-known state so I know to ignore the false re-triggers. This variable is set by Lua in the two scenes that set and clear the Away virtual switch.
This scene is triggered by the sensor being tripped and sets Away. This is the Lua for the trigger:
local dID = 122
local state = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1","LastState",dID)
if (state ~= nil) and (state == "1") then
luup.log("Alarm: Repeated Arm - Away not set.")
return false
else
luup.variable_set("urn:micasaverde-com:serviceId:SecuritySensor1","LastState","1",dID)
end
local dtT = os.date("*t")
if (dtT.hour >= 22) or (dtT.hour <= 3) then
luup.log("Alarm: Armed - Away not set.")
return false
else
luup.log("Alarm: Armed - Away set.")
return true
end
This scene is triggered by the sensor being un-tripped and clears Away. This is the Lua for the trigger:
local dID = 122
luup.variable_set("urn:micasaverde-com:serviceId:SecuritySensor1","LastState","0",dID)
luup.log("Alarm: Disarmed.")
return true
It solves my problem - at least until I figure-out another way to stop it happening. I suppose one option is to stop Vera polling it at all…