AEON 4-in-1 Sensor - How to reset motion status

Hello,

I have a 4-in-1 sensor that I enable as part of going away when i enter pin in my schlage lock and triggering an “away” scene. As part of that scene I also enable a sensor and a siren to go off if the sensor is tripped. Problem is that since was just in that room before I go out of my house the sensor may already be tripped when the “away” scene triggers. I am trying to reset the sensor via LUA code in that scene. but it does not seem to work. Do you know how to reset motion status for this sensor via LUA code.

luup.variable_set(“urn:schemas-micasaverde-com:device:MotionSensor:1”,“Tripped”,0, 11)
luup.variable_set(“urn:schemas-micasaverde-com:device:MotionSensor:1”,“ArmedTripped”,0, 11)

The correct code for this is:

luup.variable_set("urn:micasaverde-com:serviceId:SecuritySensor1","Tripped",0,11)

but this may not solve your problem. If Vera polls the sensor while it is still tripped, it will update the state variable and trigger your alarm. This could also happen if a sensor wake-up occurred while the sensor was still tripped.

It would be better to check the timing of the events in your alarm trigger. If Tripped occurs more than the sensor’s On-time after Armed is set, allow the alarm to trigger. This is easy to do with PLEG. It is also possible with Lua by adding this code to the scene that is triggered by the armed, tripped sensor:

[code]local dID = 11 – Device number of Motion Sensor
local tOnSecs = 180 – Motion Sensor on-time in seconds
local sArmed, tArmed = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Armed”, dID)
local sTripped, tTripped = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”, dID)

return (tTripped > (tArmed + tOnSecs))[/code]

See Conditional Scene Execution for an explanation and more examples.

Thank you RexBackett,

you code snippet worked.

I had seen the device-type in the advanced setting “urn:schemas-micasaverde-com:device:MotionSensor:1” and used that, but guess that is wrong.

How would I have know to use this value “urn:micasaverde-com:serviceId:SecuritySensor1”. Where do we find this?

How would I have know to use this value "urn:micasaverde-com:serviceId:SecuritySensor1". Where do we find this?

There is an explanation in the thread I linked. Specifically in Service IDs, Variables and Actions. There is also a button that provides a list for one or all devices on your Vera in LuaTest.

Hi RexBeckett and msakib13,

I’m interested in getting the parameter value of whether my Fibaro Motion Sensor is tripped with this code below:
local x = luup.variable_get(“urn:micasaverde-com:device:MotionSensor:1”,“Tripped”,139)
luup.log(x)

I always get: (null)

I’m not sure where it went wrong.

So I want to try manually setting the Tripped value to 1 , and then get the variable value again to see if it becomes 1 now.
However, somehow the “code failed”. Here is the code:
local x = luup.variable_set(“urn:micasaverde-com:serviceId:SecuritySensor1”, ?Tripped", “1”, 139)

Just want to see if it works if I tried setting other variable, I tried setting the Motion Sensor to be Armed with:
local x = luup.variable_set(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Armed”, “1”, 139)
This works.

Do you guys know where I might have gone wrong?
Thank you so much. :slight_smile:

?Tripped
this is incorrect. You need just Tripped

change the ? to "

I'm interested in getting the parameter value of whether my Fibaro Motion Sensor is tripped with this code below: local x = luup.variable_get("urn:micasaverde-com:device:MotionSensor:1","Tripped",139) luup.log(x)

I always get: (null)

I’m not sure where it went wrong.

Your Service ID is not correct. Try this:

local x = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1","Tripped",139) luup.log(x)

My 4-in-1 is used to execute a scene (“Turn on lights”) when tripped. When the 4-in-1 times out, another scene (“Turn off lights”) executes.

If I use my Amazon Echo to turn off the lights, the 4-in-1 motion sensor is still tripped, and must timeout before the “Turn on lights” scene will execute again.

Can I reset the motion sensor using LUUP? I would add this to the “Turn off lights” scene.