Triggers limitation

Hi,

Somebody could tell me how to bypass the triggers limitation that is set to only one event ? ::slight_smile:
There is no possibility to add several conditions with “OR” / “AND” operators so, what is the best way to override this limitation ?

If the solution is writing LUUP code, is it on the luup event associated to the trigger or in the luup tab ???
You have a sample code ?

Thank you ! :wink:

You can add more than one trigger. The effect is that the scene runs when any one trigger fires. You can think of this as an “OR” but strictly it’s more like a set union.

To combine states (“AND”), pick one branch of the condition (the instantaneous one) as the trigger, and then put the tests for the other conditions (which will all be tests on a current state of a device) into the Luup Event code, making it return true or false depending on the conditions.

Putting the Luup code into Luup Event lets you specify different conditions for each trigger if you have several. If you have only one trigger then it’s equivalent to put the Luup code into the scene’s Luup tab, which is a global last-chance test.

(A rant I’ve been keeping back for a while, not directed at the OP: What people call “AND” isn’t really a Boolean “AND” at all. Triggers are instantaneous events, so it’s impossible for two to occur simultaneously. ONE of the branches of the “AND” is the trigger, and the others are checks on the current state. No argument that there needs to be UI support for this, though.)

Thank you Futzle for the information…

I found this diagram on the on the wiki that explain all …
http://wiki.micasaverde.com/index.php/Luup_Scenes_Events

… and I just added my luup condition so it’s working well now.

Thanks again ! :wink:

Someone can help me ?

I just want to create a trigger that will be launch when my DSC zone is armed or bypassed (I mean, each time that the armed / bypass toggle button change).

I put those two conditions on the trigger but it is launched only when the armed button is pressed and I don’t know why; two conditions on the triggers configuration is supposed to be interpreted as a ‘OR’ no ?

Ok, forget it. I found another way to make it working well with the & plugin.

:smiley: