Help with Luup code to turn on light when sensor is tripped

hi!

Scenario : I want to turn on my light when the sensor i Tripped without making a triggers tab. Only with LUUP.

Also want the code to run auto when i click Run scene.

Code im using now only turn’s on light if sensor is tripped == 1, but i want it to check it all the time.

[code]local sensor = 18
local light = 4

local SS_SID = “urn:micasaverde-com:serviceId:SecuritySensor1”

local Tripped = luup.variable_get (SS_SID, “Tripped”, sensor)

if (Tripped == “1”) then

luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },light)

end[/code]