Using ScriptCondition on new-gen Rules

Hi all,

I really appreciate managing the rules on PaperUI (http://docs.openhab.org/features/automation/ngrules.html). Simple rules works just perfect.

But I have trouble creating a rule with a ScriptCondition. I want to check if the ItemState (StringType) contains a String.

Is there any documentation how to use a ScriptCondition? How should the java-script looks like?

Thx

As this is no official feature yet and thus there is no documentation nor any guarantee that anything works, the best advice is that you look at the code. This expects the script to return a Boolean. I would expect engine.eval to return this, if your Javascript returns with a boolean value. If this doesn’t work, feel free to provide a fix :slight_smile: