Jython JythonItemProvider import error

Hi,

I am trying to use the function add_item from items.py (core) but I always get an error:

2019-01-21 19:34:00.847 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/etc/openhab2/automation/jsr223/personal/003_initialize.py': ImportError: cannot import name JythonItemProvider in <script> at line number 6

And line 6 is:

from core.items import add_item

Seems that I have an issue with importing JythonItemProvider (which is created in 200_JythonItemProvider).

Any idea why it happens?

Thx

I am also just starting with Jython. Maybe your “003_initialize.py” calls it too early?
As far as I understand, the number before the script name makes in which order it is executed. Does it work if you modify a script in order it is reloaded?

I just added the following to my script:

from core item import add_item

add_item("addeditem","Switch")

After that my items are gone away:

File “/openhab/conf/automation/lib/python/core/log.py”, line 43, in wrapper
return fn(*args, **kwargs)
File “”, line 210, in checksetSetpoint
AttributeError: ‘org.eclipse.smarthome.automation.module.script.def’ object has no attribute ‘storm’

At that line I accessed “items.storm” whereby storm was a Switch item