Tripped Device

Hi -

I’m trying to set off a device within a block of code.

if( lu_GetVariable("urn:schemas-micasaverde-com:device:MotionSensor:1","Tripped",18)=="1") then luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "1"}, 36) end

The call to the device works. (Call to device 36).

I believe the problem is that I can’t get the IF to run the code.

I’ve tried all sorts of values for the send part of the evaluation… “0”, “1”, “dkjslkdjlsjlj”.

Nothing seems to execute the code.

Any advice?

Assuming that lu_GetVariable is a typo, it should be luup.variable_get…

The service id is definitely wrong. No service ids contain the word “schemas”.

Futzle - you were correct on both accounts!

I was using an older snippit, I changed the command to the luup.variable_get.

Also, I had the service id wrong.

It is working great now… Thanks!

Glad you got it working. Can you post your corrected code for the sake of closure, and for the people who find this thread through a web search?