Newbie - check if Visonic PIR is in tripped state

Hi,
Apologize if this has been answered before, but I’m just getting started with LUUP and Lua, so very newbie…

From my Lua script - I want to know if a Powermax PIR sensor is in “tripped” state.
I thought this was as easy as checking the “tripped” parameter on the sensor, but that doesn’t seem to work.

If I do something like:

local SENSOR = 8
local SES_SID = “urn:schemas-micasaverde-com:device:MotionSensor:1”
local tripped = luup.variable_get( SES_SID, “Tripped”, SENSOR)

It returns “(null)” both when it’s tripped and not tripped…

What am I missing?

Just to follow up myself - tried to pull some other properties like “LastTrip” on some of the PIRs - but LUUP returns “(null)” regardless of which property I’m trying to fetch. I must be missing something very obvious ;D ???

Try this:

local tripped = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,8)

Thank you!! That worked like a charm :slight_smile:

But why? On the properties of the PIR it says : device_type urn:schemas-micasaverde-com:device:MotionSensor:1

Kind of confusing…I guess there is some sort of mapping of the urns somewhere…