Jython automation installation fails to work

  • Platform information:
    • Hardware: KVM VM on AMD
    • OS: Ubuntu 24.10
    • Java Runtime Environment: openjdk version “17.0.14” 2025-01-21
    • openHAB version: 4.3.3
  • Issue of the topic: Installation of Jython for automation does not work
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

Hi there - I’ve installed Jython automation based on this topic: Ivan’s Helper Libraries - OH3, Python, JavaScript

Starting openhab after going thru these steps the following errors could be seen in the log:

14:38:42.779 DEBUG org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl Added ScriptEngine for language ‘py’ with identifier: /etc/openhab/automation/jsr223/python/core/components/100_StartupTrigger.py
14:38:42.780 INFO org.openhab.binding.velux.internal.bridge.slip.SlipVeluxBridge sending command GW_GET_SCENE_LIST_REQ
14:38:42.800 ERROR org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl Error during evaluation of script ‘/etc/openhab/automation/jsr223/python/core/components/100_StartupTrigger.py’: ImportError: No module named core in /etc/openhab/automation/jsr223/python/core/components/100_StartupTrigger.py at line number 9

Running my own script ends with similar error: 14:41:44.221 DEBUG org.openhab.core.automation.module.script.internal.handler.AbstractScriptModuleHandler Executing pre-compiled script of rule with UID ‘ed1249e5db’
14:41:44.247 ERROR org.openhab.core.automation.module.script.internal.handler.AbstractScriptModuleHandler Script execution of rule with UID ‘ed1249e5db’ failed: ImportError: No module named core in
14:41:44.248 DEBUG org.openhab.core.automation.internal.RuleEngineImpl The rule ‘ed1249e5db’ is executed.

Is there any other way to install Jython automation and especially the helper libraries? The topic regarding Ivans helper libraries is from 2021 and describes openhab2 and openhab version 3.

Thanks for any help and best regarda, Falk

I would not recommend to continue using this setup as a newbie.

  1. Jython is still supported but there is no support for python3 on the horizon.
  2. The helper libs, you mentioned, have no active support since 5 years. Means it is normal that there are problems with newer openhab version.

As a absolute newbie I would recommend the javascript binding. It is stable and has a very well maintained helper lib.

Or, if you are a bit more advanced, your preferred language is python and you are able to handle minor issues of a beta version by yourself, you should check https://community.openhab.org/t/python3-scripting/. It is still beta, but the final version will be released together with openhab5. And it includes a thin helper lib too.

Dear Holger,
I’d like to thank you for your reply. Very quick, thanks for your time. Yesterday night (too late) I have been searching the internet for jython and openhab4 and found very similar comments. I guess I will change to JS and AI will hopefully help me in scripting my needs.
Best regards from Augsburg, Falk