I just submitted a PR that adds a core feature for a JythonScriptEngineFactory and it would be great to have some testers! Basically, this will allow for the installation of Jython including the core and community helper libraries through Paper UI, once the PR is merged. If you’d like to test it, you’ll need to…
- Have OH 2.5.x (S1778) or newer
- Shutdown OH
- Backup OH
Download the addon and copy to
$OPENHAB_HOME/addons/(see here for more details). The jar contains the core and community helper libraries, so there’s no need to copy them from the repo. However, the core scripts will need to be copied to /automation/jsr223/python/core/.
- Restart OH and watch the logs
These instructions are very short and assume you are familiar with how to manually setup Jython and the HLs. Include step 7, but understand that the core libraries (/automation/lib/python/core) are included in theis bundle, so the ones you copy will be ignored. You will still need to setup the configuration.py. I’ll update the HL docs when the PR is approved. Steps 10 and 11 should be skipped. I’ll come back to answer questions and fill in some gaps!
If you already have Jython setup, stop OH, remove the Jython portion of your EXTRA_JAVA_OPTS, copy the jbeta Jython addon to /addons/, and start OH. The existing core and community libraries on your filesystem will be ignored.
To use external libraries, copy them into your $OPENHAB_CONF/automation/lib/python/personal/ directory. Alternatively, add the directories (separated with a colon for Linux and semicolon for Windows) containing the packages to the python.path in your EXTRA_JAVA_OPTS.