Luup variables in triggers and scenes

I’m struggling to find anything about which Luup variables might be available to use in triggers and scenes. I know I can share my own variables between a scene and its triggers, but is there, for example, a system variable I can check in a scene to tell me which trigger initiated it?

I have, once again, tried searching the Wiki and the forum, but with rather limited success.

Thanks for any insight on this.

Vera provides the ability to attach LUUP code with the Trigger.
There you can put:
Source = “Trigger1”

Set Source to a different value in each of your triggers.

In your Scene level luup code you can check the value of Source.

Vera does NOT provide any system context to your LUUP code … if you do not set it (a variable) … it won’t be there!
You get at Vera context through the defined LUUP.XXX functions.

Richard

Thanks - I feared as much. This is actually what I wanted to avoid doing since I have a lot of triggers into one scene. I was hoping for a sort of equivalent to the [tt]lul_device[/tt] parameter that gets given to device startup code, something along the lines of “[tt]lul_trigger[/tt]” or “[tt]lul_timer[/tt]”. This distributed code base is a nightmare to document and maintain - I suppose that’s why you write plugins!

Just to say I found the relevant wiki topic documentation at last (brief though it is):
[url=http://wiki.micasaverde.com/index.php/Luup_Declarations]http://wiki.micasaverde.com/index.php/Luup_Declarations[/url]

In particular
http://wiki.micasaverde.com/index.php/Luup_Declarations#scene
says

[b]scene[/b] variables: none return values: boolean (true or false) This is how the Lua code in a scene is called.
and I presume that the trigger code runs in the same context.

A scene and all of it’s triggers run in the same context.
That’s why you can set a variable in a trigger LUUP code and reference it in the scene’s MAIN LUUP section.