Rule not working after update to 2.5.6-2

Tags: #<Tag:0x00007f6173b7db90> #<Tag:0x00007f6173b7da28> #<Tag:0x00007f6173b7d898>

No, openHAB Timers created using createTimer:, in Jython see and for JavaScript you should be able to adapt Experimental Next-Gen Rules Engine Documentation 5 of : Actions (NOTE: that thread was written before there were Helper Libraries and written to show how to create Rules through PaperUI so not everything there may still be accurate).

JavaScript is lazily evaluated. Lots and lots of errors will never appear until the rule actually runs. I would expect to see an error if the trigger where incorrect though.

The big problem when executing the rule from PaperUI is it doesn’t appear to get the scope. Consequently it doesn’t necessarily have access to logInfo, for example. Though you should usually see an error in the logs when that happens.

Maybe you need to enable the logs through. See step 3. at (you might need to click on the JavaScript tab).


It’s in the right spot or else you wouldn’t see the “Loading script” log statement and it wouldn’t appear in your Rules menu in PaperUI.

Actually it isn’t. It’s in automation\jsr223.

I think the subfolders were added with the updated libraries.

You still get the “loading script” statement even if it’s in the parent directory. However, same outcome.

I did see the bit about logging but I assumed that whatever logging was operational by default before would still be. So I take it that’s not the case.

I can’t quite decipher the logging instructions. It talks about the Karaf console, and then about the configuration file, but I can’t see how to translate the Karaf console command into settings in the config file.

Perhaps something like:

log4j2.logger.jsr223.level = DEBUG


Yep. Found this post here:

Bingo. I now get the logs and the rule is working. Many thanks.

If you’d put your topic anywhere other than Beginners, I probably would have seen it and could have helped out right away. I only got here after you linked to my post, but I’ve moved it now, as this definitely is not a beginner question!

Many things have been changed and added to the JavaScript helper libraries and I plan to do more to bring the functionality up to the level of the ones for Jython.

Considering just the helper libraries, definitely go with Jython! The JS libraries are better than they were, but are limited by the version of Nashorn supplied in JDK8. Eventually, we will have a newer versioin of JavaScript that is compatible with scripted automation. Considering just the scripting language, definitely go with Jython! JavaScript works well for websites, but it is pretty useless for automation. There is a small number of people who use JavaScript, so I do my best to support it and will continue to build out the JavaScript helper libraries. I am working on an addon for distributing the JavaScript helper libraries, as well as addons for Kotlin, Groovy and jRuby.

1 Like

Yeah, using JS is swimming against the tide, although it would be the easiest for me right now. OK, so I’ll learn Python. I’ve never really used it except once years ago. Something new.

In case you have not seen these…

I’m not quite there yet! Maybe in a few weeks from now.