OH3 Rules "and / or" combination

Hello,

I want to run a rule which sends me mail, on my OH3 system, when one of my four remote control
become less then 10% battery.

Are such kind of conditions which I have listet, so called “AND” combinations or are thoose “OR” combinations?

Unless you want the mail only if ALL are below you need to use OR.

Great Jürgen, how can add here via the UI a “OR”??

The „When“ part of the rule editor is the „or“. The rule will run with any of the listed rows.
The „Only if“ is the „and“ part. All rows must be true to be accepted.

1 Like

Ultimately you probably cannot get what you want using only the UI. As Dirk mentions, the conditionals as AND. All the conditions must be true before the rule will be able to run.

While the triggers are OR, you can’t trigger with a comparison. There is no FlurButton1_Batterieladung changed to < 10 event.

So you will have to get into creating actual Script Conditions and/or Script Actions.

But it’s not so bad. Assuming you are triggering the rule when one of those four Items change, a Rules DSL Script Condition would be something like:

newState < 10

newState has the state that the Item that triggered the rule changed to.

It get’s more complicated though if these Items are using units of measurement as you need to take that into account. For a percentage it would be something like

newState < 10|%

I don’t remember if it needs to be 10|%% so try that if one doesn’t work.

Thanks for the Feedback, Dirk and Rich…

As I don’t like scripting, etc, and I have the feeling that OH3 UI should really do the job, what I need…
I was searching for a other soution, and found one:

Thoose shelly button remote controls have a channel which is a switch for lowpower values. The level can be set. So I set the values to 20%, and if it goes below, the switch ist set to “on”. Those “On” I can now use as a trigger so send me mail, that I should recharge the battery from the remote button :slight_smile:

BR
Jochen