OH3 Rules - Multiple Triggers - Logical OR. Is this possible?

Hello community,

I’m in a process of migration rules from OH2.5 to OH3.4.
I’m trying to simplify logic of rules by using multiple triggers.
In UI i can set a few triggers but can’t get in the documentation ( actually docs still describe old config files for scripts) if these triggers fire the script execution independently.

I need to fire the script whenever any of the two triggers events happened (OR logic). But it does not.
Is triggers entered in UI fires the script only when both of them happened ( AND logic)?
Or it requires sequence of triggers happened?
YAML code does not give the answer as well.

Manual scripts execution in the rule works well.

Will appreciate comments and a link to the latest OH3 rules doc that describes configuration through UI (preferable with screenshots)

Triggers represent OH events. There’s approximately 0 likelihood of two events happening at exactly the same time when working on the time scales of milliseconds, so events are more-or-less by definition instantaneous. This means that the triggers must use OR logic because there’s no way for them to ever have AND events.

This means there’s something going on with the way you configured the triggers. You’ll have to show us the the full yaml for rules you tried to make so we can see where the problem is.

Can you put your items in a group and trigger your rule based on that group?

(FYI, you can pull data from the triggeringItem within the rule if you want to further condition the rule)

The way rule triggers work has not changed. All rules since the beginning of OH support for rules have been OR.

Please, even if you’ve been using OH 2 forever do not skip the Getting Started Tutorial.

1 Like

Thanks all for replies.
I have confirmation that triggers logic is OR ( which was actually expected).

I played a bit and found a few things in my setup i had to correct. It is working with OR logic

Additional question about conditions - what logic multiple conditions follows? Is it possible combination of OR and AND logic here?

1 Like

Conditions are AND. All the conditions must pass for the conditions to pass. If you need complicated logic, you can use a Script Condition and code up as complicated of a combination of ands and ors as you require.

Thanks Rich, you are helpful always.