Creating rules via OH 3 Interface

  • Platform information:
    • Hardware: INEL NUC
    • OS: Windows 10
    • Java Runtime Environment: Zulu 11
    • openHAB version: 3.1.0
  - id: "1"
      itemName: Dach_Helligkeit
      state: ""
    type: core.ItemStateUpdateTrigger
  - id: "2"
      itemName: Dach_Helligkeit
      operator: ">"
      state: "28000"
    type: core.ItemStateCondition
  - id: "3"
      itemName: Dach_Temperatur
      operator: <
      state: "15"
    type: core.ItemStateCondition
  - id: "4"
      itemName: alle_Jalousien_EG
      command: OFF
    type: core.ItemCommandAction

My Q: Until now I coded all rules. I just tried out implementing a rule via the Web interface. For ID 2 and ID 3 is there alway an “and” connection, so both true? What if I like create a either or connection? Or ist it better to stay with coding on my self?

Thanks for advise

Yes, it’s always an AND.

You need to create a Script Condition where you can code the comparison using the language of choice. If you prefer graphical, use Blockly.

The last line of the script must evaluate to true or false. So an OR of the above would be in Rules DSL

Dach_Helligkeit.state as Number > 28000 || Dach_Temperature.state as Number < 15

Thank you!
I guess I will stay with coding them directly instead having a mix of Rules via Interface, some of them with scripts and the old ones von OH1, OH2 in the .rules files.

You may not have understood what I said.

Click “Add Condition” and Choose “Run a Script”. Then choose your language of choice and enter the code. It’s all in MainUI. There is no mix of files and UI interface.

Ok, thanks for the additional information. As I am new to Release 3 I didn’t know and also didn’t look deeply into all Main UI functions yet.