i’m slowly desperate with OH3 and Jython. I’ve been trying to get Jython working for days, but without success.
I ran OH3 as a Docker image, installed the Jython add-on, the current helper libraries were downloaded from ivans github-channel and copied into the container, the permissions openhab:openhab for the folder “automation” were set recursively, the karaf-console configured accordingly and i always get the following error message:
Script execution of rule with UID ‘test’ failed: ImportError: No module named core in at line number 1
(I can post the entire error message if necessary)
from core.rules import rule
from core.triggers import when
@rule("Testscript", description="This is only a test", tags=["test"])
@when("Item hue_floor_motionsensor_Bewegung changed from OFF to ON")
def TestScript(event):
if items["dummy_switch"] != ON:
TestScript.log.info("Turn the lights on")
events.sendCommand("dummy_switch", "ON")
I would be really grateful if someone could help me get Jython running, as I currently have two instances running, both have been moved to OH3 and now no rule works.
I have OpenHAB running in a Docker, unfortunately the paths are a bit different there. However, i just stumbled upon an interesting post from you - it may have something to do with it:
Okay, then unfortunately that wasn’t the problem, because i didn’t use this variable in my docker-compose file. Here are my paths with the respective content - that should actually be correct.