Experimental Next-Gen Rules Engine Documentation 1 of : Introduction

really ???

I assumed I could take what is there and modify it and put it in default.rules.

1 Like

I assumed that you spend 2-5 minutes reading the info that others spend hours to make

1 Like

Reading is one thing. Comprehending is another.

The text is very clear and precise
You didn’t ask a clarification on the answer. You asked a question that had been already answered in the text.
Drop it :stuck_out_tongue:

The NGRE is completely separate and different from Rules DSL. There is pretty much nothing in common between the two. You cannot just copy the code from NGRE into a .rules file. The code is written in a completely different language.

NGRE isn’t just a new way to write old style Rules DSL Rules, it is a wholly new and separate way to write Rules.

Has anyone else had their NGRE (via Paper UI) rules stop working with the last two snapshots? Just curious before I start digging around to see if I broke something. I haven’t changed the rules, just updated my Docker image to the latest snapshots.


Update: I “edited” each rule (changed nothing) and re-saved it and it seems to be working now. I’ll keep an eye on it and make sure things are working correctly over the next day or two.

Hey @rlkoshak, good news… I’ve got Jython and Groovy scripted actions and conditions working! I’m holding up putting in the PR until ESH is migrated.


Great news. Will the PR also contain what ever is requires so we can select the other languages when creating the Action through PaperUI? Right now the drop down list only has JavaScript.

Presumably Jython and Groovy will need to be installed before those languages can work, or will the PR also include that? It seems reasonable to me that they ship with OH by default from an NGRE perspective. But I don’t know the full implications of doing that. I suspect the reason JavaScript “ships” is because Nashorn is part of the JRE by default.

I’m sorry I missed this comment earlier.

If you have a “before” of the JSONDB file and an “after” of the JSONDB file you should see some difference in the files (format, different entries, something like that). That should tell you what changed.

It’s the fun of using an experimental project. :slight_smile:

Like this :wink:

Ignore Xtend… that’s a WIP.

They will need to be manually installed. There is not any way, currently, to restrict the list to languages supported by the system.

I stongly agree. Automating installation of the languages will come in another PR. If I do it, it may take a while, but I think JSR223 bundles are important to have.

You got it… it’s already in there!


Yep - good point, Rick. However I’ve found that I need to do this on every OpenHAB restart, even when I don’t update the code, so I suspect more it is something on initialization that is not working right. If I get some time I’ll try turning up logging and see if I can determine what is going on.

Thanks for the hints!

I thought to invest some time and to convert some of my rules to NGRE. Will I be able to copy the rules to any new OH installation (i.e. does this automation_rules.json file work as a backup)?

And will that file be read from upcoming versions of OH, say OH 3.x using NGRE as primary rule engine?

It is very likely at the moment that NGRE will be the primary rule engine. There are no changes to the syntax expected right now.

Please be aware that we have one serious bug in NGRE which prevents rules to get initialized on startup. That is expected to be fixed for OH 2.5 release.

In addition to what David said, there is also a change that needs to be made to the JSON rules file after upgrading to 2.5.