Since you have multiple sensors that you need to reset, try this:
[code]local SECURITY_SENSOR_SERVICE =“urn:micasaverde-com:serviceId:SecuritySensor1”
luup.variable_set (SECURITY_SENSOR_SERVICE, “Tripped”, 0, device)[/code]
device = the device ID of one of the motion sensors you want to reset.
If you have multiple sensors you want to reset, you can just keep adding additional [tt]luup.variable_set[/tt] lines or add this to the top of the luup code for the controlling scene:
function resetSensor (device)
local SECURITY_SENSOR_SERVICE ="urn:micasaverde-com:serviceId:SecuritySensor1"
luup.variable_set (SECURITY_SENSOR_SERVICE, "Tripped", 0, device)
end
Then use:
resetSensor(<device>)
as many time as you need to reset all the sensors before arming them.
If you want to clear then arm the sensor try this:
function resetSensor (device)
local SECURITY_SENSOR_SERVICE ="urn:micasaverde-com:serviceId:SecuritySensor1"
luup.variable_set (SECURITY_SENSOR_SERVICE, "Tripped", 0, device)
luup.call_action(SECURITY_SENSOR_SERVICE,"SetArmed",{ newArmedValue="1" }, device)
end
I’m assuming that this should work to clear the Tripped state of the sensor, but I have not tested it.
There is also a SetTripped handler for the SecuritySensor device. You can call it if you want to it to handle setting the Tripped variable. This only makes sense if you set Tripped to 1, since it also updates the LastTrip time.