PaperUI Rules vs HABmin

If you’re feeling adventurous you can try out Flows Builder - a visual designer for the new rules engine.
Shamelessly plugging my stuff here, but it was supposed to help with these kinds of use cases.

:warning: That being said I would also recommend sticking to the proven, battle-tested DSL rule engines for now though. There are some unresolved issues with the new engine.

Anyways, that’s how you could do it:

  • With an intermediate item (could be a Switch or a String), and “when it is a fixed time of day” triggers. No coding required in this case

Perhaps not exactly what you wanted, but you get the idea. Note that you could also make the rules directly in Paper UI too, but they might be easier to maintain together in Flows Builder.

  • With a “if a given script evaluates to true” and some Javascript as @rlkoshak suggested:

image

You have to keep in mind you can’t use “return” statements in the condition’s script, instead the script’s “return value” is the evaluation of the last statement.

Here the Flows Builder can help you because editing scripts is far easier than with Paper UI with autocompletion for basic Javascript types including Date (its most useful feature IMO), so that’s how you would code your script:

Good luck! :slight_smile: