Ivan’s Helper Libraries - OH3, Python, JavaScript

Anyone else getting these problems with newest snapshot? Some rules don’t load anymore…

  File "/etc/openhab/automation/lib/python/core/triggers.py", line 353, in when

    elif target_type == "Item" and trigger_target not in ["added", "removed", "updated"] and old_state is not None and trigger_type == "changed" and TypeParser.parseState(itemRegistry.getItem(trigger_target).acceptedDataTypes, old_state) is None:

ClassCastException: java.lang.ClassCastException: class org.openhab.core.library.types.OnOffType cannot be cast to class org.openhab.core.types.State (org.openhab.core.library.types.OnOffType is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @6052c10b; org.openhab.core.types.State is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @64c724e2)

Edit: Ok just downgraded to 3.4-M4 but the problems still there. Maybe it is not related to M6.
But still anyone else having these issues?

Have you restarted the service at least once after upgrading/downgrading manually ?

Which service do you mean? If openhab as a whole, yes several times.

only as info:
i have openhabian with openhab 3.4.0.m5 installed and jython version 2.7.2.final running without problems.

Thanks for reporting. I updated to M6 this morning and then it started.
Unfortunatly problems persist now after downgrading to M5 again :frowning:

I had the same error after upgrading to M6. The mentioned line was 357 instead of 353, so I may have a different version of the helper libraries.
I did another restart of OH and than the error was gone. Btw. after a previous update I had the same error which was also gone “automagically”.

yesterday i updated to m6 and then i saw the same errors as you and @usambara reported in my log:

  File "/etc/openhab/automation/lib/python/core/triggers.py", line 357, in when
    elif target_type == "Item" and trigger_target not in ["added", "removed", "updated"] and new_state is not None and trigger_type == "received command" and TypeParser.parseCommand(itemRegistry.getItem(trigger_target).acceptedCommandTypes, new_state) is None:
ClassCastException: java.lang.ClassCastException: class org.openhab.core.library.types.DecimalType cannot be cast to class org.openhab.core.types.Command (org.openhab.core.library.types.DecimalType is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4f4b1a; org.openhab.core.types.Command is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @46630b)

  File "/etc/openhab/automation/lib/python/core/triggers.py", line 353, in when
    elif target_type == "Item" and trigger_target not in ["added", "removed", "updated"] and old_state is not None and trigger_type == "changed" and TypeParser.parseState(itemRegistry.getItem(trigger_target).acceptedDataTypes, old_state) is None:
ClassCastException: java.lang.ClassCastException: class org.openhab.core.library.types.StringType cannot be cast to class org.openhab.core.types.State (org.openhab.core.library.types.StringType is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4f4b1a; org.openhab.core.types.State is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @46630b)


  File "/etc/openhab/automation/lib/python/core/triggers.py", line 355, in when
    elif target_type == "Item" and trigger_target not in ["added", "removed", "updated"] and new_state is not None and (trigger_type == "changed" or trigger_type == "received update") and TypeParser.parseState(itemRegistry.getItem(trigger_target).acceptedDataTypes, new_state) is None:
ClassCastException: java.lang.ClassCastException: class org.openhab.core.library.types.OnOffType cannot be cast to class org.openhab.core.types.State (org.openhab.core.library.types.OnOffType is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4f4b1a; org.openhab.core.types.State is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @46630b)
``
but i can confirm what usambara wrote: after another reboot of my rpi the errors dont appear again.

@CrazyIvan359 are you still maintaining the repo GitHub - CrazyIvan359/openhab-helper-libraries: JSR223-Jython scripts and modules for use with openHAB?
There is no activity there since 2 years?

I really like the feature - and the documentations - that is available there.

Or did I miss that it is now merged into OH3 - completely?