[Solved] Create rule via UI chaining conditions with OR (and AND)?

Hi I am running OH 5.1.0 M2 on a docker container on my NAS.

As I am no programmer I tried starting to migrate my old DSL rules into something new. But I am already failing to chain different conditions in a rule by either OR and AND to check more than one condition in a rule

Simple example I want to

  • check every 10 minutes (I know how to do this via UI rules)
  • window sensor 1 if it is open
  • OR
  • window sensor 2 if it is open
  • and then send an email for notification (I know how to do this via UI rules)

I am struggeling how to combine conditions if it more than one … I assume when I simply add another condition this will be automatically and AND connection but I am not sure.

But I find not way how to create on OR connection?

Maybe I am on the wrong path thinking that the UI rule engine is as powerful as the DSL rules and I should try out the Blockly way as Javascript and Jython is to sophisticated for me.

I am open for any suggestions and maybe the UI rule engine is better than expected.

Thank you for supporting me!!!

All triggers are OR. The rule will trigger is any of the triggering events happen.

All conditions are AND. The rule will run if triggered only if all the conditions are met.

To set up an OR type condition, you need to implement that in an inline Script condition. In Rules DSL the inline script for the condition would be something like:

WindowSensor1.state == OPEN || WindowSensor2.state == OPEN

The UI rule engine is as powerful as the most powerful rules language openHAB supports. But that is because you can and should use those rules languages in your UI rules. If you limit yourself to everything but the Inline Script options though, the UI rule engine is very simple and can only support the simplest of use cases.

You already know Rules DSL and that’s an option. Blockly is also a good choice. But once you are in the UI working with inline scripts anyway, JS and Python are no worse than Rules DSL in complexity. Just different. And then docs for all the OH rules languages are pretty good references.

1 Like

Thank you @rlkoshak

What would I do without you :smiley: ?

thank you very much for clarifying. I understand the concept now and I see that Blockly is not right way to go for me. I can now mix my knowledge about “Rules DSL” with the UI rule engine and my intention is to migrate all my rules that I have created over years in the rules files into this new paradigm :+1: