Port JSR223 bundle to openHAB 2

@sebastian, Maybe you have forgotten about it, but we both spoke about this already not long ago.
I am currently starting trying to port JSR223 to ESH on the new rule engine. I am hoping to have something working in a few weeks time, I’ll keep you all posted.

@Kai, @sebastian - this is amazing news! I’ve just recently stumbled upon this development but I cannot wait for this to be official & part of the OH2!

To explain my excitement - while I do appreciate the current rule engine for very simple tasks, it can get unwieldy pretty soon (just imagine locks or anything from the Java world) and just loses the simplicity when “proper” Java classes need to be used. Python, for example, has a huge standard library of functionality and I am confident that I can simplify my rules A_LOT if I had the flexibility of Python.

Not to mention the barrier of entry for beginners - pretty much any basic Python question is answered via SO or similar sites - sadly, this cannot be said for Xtend…

Anyway, just wanted to thank you both for your effort - if the vision of OH is to be scripting-language agnostic as well, we have bright future ahead of us!

@petr, I am actually hoping that @smerschjo joins in after I have created the initial work, so the kudos go to him for doing all that work for openHAB 1 initially :+1:

@Kai, are there any news? What is the current status? :yum:


Yes, I have an initial version implemented within the new rule engine and specifically made Javascript working there.
The PR is https://github.com/eclipse/smarthome/pull/317 - it is currently waiting for Eclipse IP team approval, but I am still lacking the CLA of @smerschjo - Simon, if you read this, please make sure to sign it soon, otherwise we are blocked!

1 Like

I’m not able to catch the result of this topic and its links…
Is the javascript rule engine for openhab 2 somewhere available right now for testing?


  1. install openHAB2 Snapshot
  2. Go to the Paper UI -> Configuration -> Services -> Extension Management and
  3. enable “Access Remote Repositories” and ‘Include Experimental Extensions’ and save.
  4. goto PaperUI -> extensions -> MISC -> RuleEngine(Experimental) -> install.

After installation you get Rules Item in PaperUI left-menue:

In “Actions”, there you can configure javascript engine too:

Just my OpenHAB 2 / paper ui is missing all script engine related items.

Locks as if I didn’t catch the lastest Version?
Just to be sure, where should I get from??

Now I found Kai’s original post.

Missed “Enable “Access Remote Repositories” and ‘Include Experimental Extensions’ and save”

Thanks a lot!
I now I found it.

I’m going to port some script rules from 1.8.3.
Can you give me any hint are the scripts are stored? I need to edit the external, because they are to complex for this integrated UI.

Is the object model / api similar to 1.8.3 ?

Puhhh, I’m in the same Situation. It is for me not as comfortable doing it by a GUI. I have complex javascripts and have external javascript libraries which I can load very simple in jsr223.

Because it is experimental and not “the last word”. I wait to port at the moment.

I did not test it, don’t know if the object model / api is similar. I would study the Sources to find out.

For some reason I don’t get the Rules section in the Paper UI menu even after a refresh.

Any ideas?

I have installed yesterdays version, and got an error too, Bundle is not starting.
Yes, its experimental.

Are there any news on this?
I have lots of rules running very well in jython and slowly I am thinking about OH2.
Is there now full support of JSR223 (+jython)?

This is a bit of cross post from Excellent presentation of Kai at jPrime conference: Recording somewhere? because that has the best example I have found to start with these types of scripts.

It would be good to have some basic API/debug starting points to get us started on using this more effectively.


Just checking what is the progress on this - is there any basic tutorial/set of steps needed to get this to work?

Would be great to start using Python in rules!

Anyone? I am still waiting for jython and jsr223 so I can move over to OH2.


Any news on jsr223 port to OH2?
I look forward…:grinning:

I have the same question.