Homey Community Forum

Order of and/or in flows

How does the order in the AND part of the flow work? for example if I put 2 variables, an OR and another variable, does it read this as (var1 AND var2) OR var3? Or does it read as var1 AND (var2 OR var3)?
How would I need to put the order if I want it like (var1 OR var2) AND var3? Is this even possible? Or do I need to make 2 flows for that, one with (var1 AND var3), and the other with (var2 AND var3)?

The AND column is fully synchronous, so the first one is always checked first, then the second, etc, if any of the checks (in the first OR) are “false” then it will go to the next OR (if there is any) and do the same there. (max 3 OR’s)

It is possible, just add both vars into each or:
screenie

In this case:

  1. if var 1 AND var 3 are true, then it will trigger the THEN column
  2. OR (if not 1) it will check if Var 2 AND Var 3 are true, if both are true it will trigger the THEN column,
  3. OR (if not 2) then it will trigger the ELSE column

The order at the AND part is first OR as first, does this give a no match, it will try the second OR, does this also give no match it will try the last OR. Does that also gives no match it looks at the ELSE part.

The order within the OR’s doesn’t matter. Every statement has to match. It will start with your first card in your first OR, than the second card etc etc. But al your cards have to match will that OR match and will be followed up with the THEN part

Thanks! I didn’t know that was a possibility (to have more vars in one OR) :slight_smile:

The amount of AND conditions is infinite (to a certain extend, can get slow in the GUI with many) in any OR “column”, it isn’t limited to logic cards, it can be any condition card.