Triggering s scene with LUUP

I am new to Vera and LUUP so any help would be greatly appreciated!

I have created a scene using LUUP that turns off one light if another is turned on:

local circuit = luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", 5)
if (circuit == "100") then
   luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "0"}, 3)
end

The problem I am having is that the scene only works when I manually press “run” on the dashboard or use the GUI to make triggers. How can I write these triggers within the LUUP code itself?

Thanks!

Thanks!

You can’t, because the Luup code is only run when a trigger or schedule makes the scene run.

Edit the scene, and put the triggering light (5) turning on as a trigger.

Or set a schedule to run your scene every minute (not recommended).

The only way to do it is from JavaScript running in the context of the Vera Web gui.
That’s how the Program Logic Event Generator and Program Logic Timer Switch accomplish this task.

This is not a simple task.

Thanks for your help!