I assumed I could take what is there and modify it and put it in default.rules.
I assumed that you spend 2-5 minutes reading the info that others spend hours to make
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.
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.
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.
Like this …
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.