Lost with JSR233 in OpenHab3

Hi there,

Sorry for posting but I’ve been the whole day looking for a solution and I’m not able to find it.

I have been using openhab since 1.x versions and yesterday I migrated my openhab 2.5 to openhab 3.0.

My surprise is that, despite jsr233 seems to be integrated in OH3, I’m not able to move my rules from my old OH2.5 to the new one for many reasons:

1- There is no misc add-on for rule engine (so seems it is already installed, nothing wrong there)
2- I added a jythonscripting add-on that seems to support jsr233 (seems rational)
3- There is no /etc/openhab/automation forlder. I created the folders (still noting strange)
4- Placed my rules there (automation/jsr233…) nothing happens…

I read the documents JSR223 Scripting | openHAB
and Jython Scripting - Automation | openHAB and searched this discourse, but no luck

I’m sure I’m missing something and probably is way too stupid, but please, enlighten me!

Thanks a lot
Regards from a desperate user

You’ll still need the helper libraries if you’re going to do the rules this way. See

Did you use the helper libraries before? Here’s the instructions I followed to get my jython rules from OH2 to OH3.

Thanks, that makes sense. Nevertheless, the documentation of OH3 gives the idea they are supported natively.

There’s a slight difference between the support of the various languages and the “scripted automation” setup. JS and Rules DSL are supported out of the box if you choose to create your rules through the MainUI and use script actions as one of the rule actions or if you use .rules files in the ./conf/rules folder. Jython scripting can be added as a supported language via the binding you found (also Groovy via a another binding).

Scripted automation is separate. It’s installed using instructions found above and allows you to create rules in various languages in the ./conf/automation/ series of folders and comes with the extensive helper libraries so that you can streamline your code.

The helper libraries that come with the scripted automation are so useful, that many people, myself included, install them and still reference those library files even when using the more standard rule setups.

If you like to write your rules and python and are willing to try something new you can always use HABApp.
It’s a python 3 rule engine that’ll allow you to write concise and elegant rules.

Hi,

I went through Ivan’s instructions and now it is working fine. Thanks for your support.

Will have a look to it. Thanks