My journey with the new rule engine

I’m quite unhappy with the new rule ruleengine and I would like to share my experience.

My journey started with openhab2, version 2.5.7 and oracle-java8-jdk 8u65.

I installed the experimental rule engine misc-ruleengine 2.5.7 and jython 2.7.0 standalone and have seen that suddenly nearly all the bindings have been updated to 2.5.8. That was not my intention. The ui-dashboard package remained in 2.5.7 as the only one.

As it seemed to be inconsistent, I upgraded OH to 2.5.8 as usually done.

This time it took several restarts to get it some how stable. After one start several bindings did not work, that changed but still some where not responsive after other restarts. I cleaned the cache. Still not properly working. In BasicUI the switch seems to have no effect anymore, at least some? I haven’t checked in detail, but these were working before and the corresponding code hasn’t changed.

I learned a lot these days with python programming, also with the help of the community. The first functions were working well. But than another day a function did not work anymore without any change. I just did some trials in another file.

I like the possibilities the new rule engine offers, but at least for me it seems not to be ready (it’s called experimental) – or maybe I’m not… So I’ll implement or reactivate what I’ve done in Rules DSL – and wait for the next major release of OH to give it another trial.

And I hope that uninstalling the binding will give me back the stability I had before.

The only reason it’s marked as “experimental” in openHAB 2 is because PaperUI never received the updates to make it complete and there remain a number of bugs in PaperUI around creating rules. The engine itself has been around for many years and is rock solid. In OH 3 it will be the only rule engine.

I doubt that it was anything specific about the NGRE addon that caused the version issues. I suspect installation of any binding would have generated the similar behavior. I can’t say why that happened except that OH 2.5 is somewhat odd in that the OH core remains fixed so each point update only is updates to the add-ons. Perhaps because you installed a new binding it realized there was a new set up bindings to install. But because the core is fixed, there is no difference what-so-ever between running OH 2.5.7 core with all 2.5.8 version bindings and running 2.5.8 for everything.

Again, these problems would not have anything directly to do with the NGRE addon. There are reports from many, myself include, that often when the cache is cleared, which happens as part of the update process, it can take an additional and sometimes up to three restarts to clear an error where Items are not recognized.

Also, when clearing the cache what happens is openHAB goes out and downloads and reinstalls the bindings. So you probably did the right thing by clearing the cache.

What “the switch” in BasicUI?

Did you look in the logs for errors?

Without a whole lot more information about this there is no way to even guess at what is going on. But there are hundreds if not more people who have been using Jython rules for well more than a year with nothing like this. Given all the upgrade problems I would not be surprised if that was the source of the issues you saw and not the rules themselves.

For example, if the known problem occurred when you cleared the cache, as I mentioned, some if not all of your Items will not be recognized. That means your sitemaps wont work because those Items will not exist. Your rules won’t work either because of the missing Items. But the root of the problem isn’t the sitemap and the rules, it’s what ever the problem was that causes the Items to not be recognized.

Restarting openHAB once up to three times seems to clear the problem. You can always tell by watching the logs if this is the problem.

In summary, all of the problems described, as best as can be discovered from the few details provided, can be attributed to the problem where Items are not recognized. This problem is in openHAB core and has nothing to do with the NGRE. And this problem can occur any time the cache is cleared.

1 Like

Thanks Rich, to encourage me to go further on with it.

I know that there is no information for any root cause analysis. I assume that I probably did to many steps at one time. And this odd installation behavior gave me the feeling that my installation is probably somehow broken.

Nevertheless I reverted the changes and uninstalled the new ruleengine. I will have a look if the system gets stable again.

Than I will try it again with one step after another, which should enable me to find the points or to ask the right questions :wink: