New Binding: Wireless M-Bus / Techem heat cost allocators

How about creating a PR to finally get it into the official distro?

I will create PR in order to bring my extensions back into KuguHome where I forked from. I guess then it is up to the owner to bring it into the official OH3 distro.

Here is my PR towards the original repro:

Hi there,

thanks to KuguHome´s work and MikeTheTux´ efforts I managed to get the wMBus Binding running under OH3 - at least for about two weeks…

At the moment I only get this error message during startup and the bridge is still in state “unkonwn”:

22:58:19.771 [WARN ] [ommon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NoClassDefFoundError: org/openhab/core/io/transport/serial/UnsupportedCommOperationException
        at org.openmuc.jrxtx.SerialPortBuilder.build(SerialPortBuilder.java:140) ~[?:?]
        at org.openmuc.jmbus.transportlayer.SerialLayer.open(SerialLayer.java:30) ~[?:?]
        at org.openmuc.jmbus.wireless.AbstractWMBusConnection.open(AbstractWMBusConnection.java:77) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$Builder.build(WMBusConnection.java:162) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$WMBusSerialBuilder.build(WMBusConnection.java:98) ~[?:?]
        at org.openhab.binding.wmbus.handler.WMBusBridgeHandler.lambda$0(WMBusBridgeHandler.java:135) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.io.transport.serial.UnsupportedCommOperationException cannot be found by org.openhab.binding.wmbus_3.1.0.202103092048
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[org.eclipse.osgi-3.12.100.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 12 more

I did check that “openhab-transport-serial” is installed and the wMBus-addins are activated through openhab-cli console, the USB serial port is present and there are no unusual error messages in syslog.

Does anyone have a clue what could be the reason why the add in doesn´t work anymore? Probably the installation of the telegram binding could have been an issue, but how can I check this?

Any help is very much appreciated!

BTW: I didn´t find any newer release than the one by MikeTheTux (org.openhab.binding.wmbus-3.1.0-SNAPSHOT-20210309.zip) and had no luck compiling it on my own.

Best regards and thanks,
Arne

Hey @ahandtmann,
Do you use a virtual comm port maybe?

I did help with work on this binding in 2018 and 19. From stack trace it looks like bundle is not complete and miss some classes. There is never ending drama with serial libs since jmbus did rely on jrxtx and openhab ships nrjavaserial. Both are forks of an legacy rxtx library.
Copying of code between places does not solve problem, it moves it into another place.

Best,
Łukasz

Hi Lukasz,

I´m running the system on a vanilla OpenHABian with latest updates (maybe this could be a reason) and with a hardware USB port and Amber Wireless Stick (tried another stick also).

I´m not a Java programmer and unfortunately haven´t been able to compile a Wireless MBus add-on release based on the current version on github, so I just took the archive provided by MikeTheTux and it worked for some weeks.

If you could help me to get the necessary version information (e.g. OpenHAB/serial add-on whatsoever) or provide a add-on-release for Wireless MBus I´d greatly appreciate that!

According to bundle:list I have installed the current versions (excerpt):


 73 │ Active │  80 │ 3.1.0.202103092048      │ WMBus Binding
 76 │ Active │  80 │ 3.1.0.202103092049      │ WMBus Binding Tools
130 | Active |  80 | 3.0.2                   | openHAB Core :: Bundles :: Core
211 │ Active │  80 │ 5.2.1                   │ nrjavaserial
216 | Active |  80 | 3.0.2                   | openHAB Core :: Bundles :: Serial Transport
217 | Active |  80 | 3.0.2                   | openHAB Core :: Bundles :: Serial Transport for RXTX
218 | Active |  80 | 3.0.2                   | openHAB Core :: Bundles :: Serial Transport for RFC2217

Best regards and dziekuje!
Arne

What I see in your listing is OH core in version 3.0.2 and binding in version 3.1.0. In theory it shouldn’t matter since serial port handling is rather dusted codebase.

Can you do headers 73 and share your results here?

Best,
Łukasz

As I understood, bindings compiled for 3.1 core will not run on 3.0.x. That‘s why the Shelly binding exists at 3 dev versions…

Hi Lukasz,

sure:

WMBus Binding (73)
------------------
Automatic-Module-Name = org.openhab.binding.wmbus
Bnd-LastModified = 1615322935874
Build-Jdk = 11.0.10
Built-By = weger
Created-By = 11.0.10 (Oracle Corporation)
Manifest-Version = 1.0
Service-Component = OSGI-INF/org.openhab.binding.wmbus.device.UnknownMeter.xml,OSGI-INF/org.openhab.binding.wmbus.device.itron.ItronDiscoveryParticipant.xml,OSGI-INF/org.openhab.binding.wmbus.device.itron.ItronHandlerFactory.xml,OSGI-INF/org.openhab.binding.wmbus.device.techem.TechemDiscoveryParticipant.xml,OSGI-INF/org.openhab.binding.wmbus.device.techem.TechemHandlerFactory.xml,OSGI-INF/org.openhab.binding.wmbus.device.techem.decoder.CompositeTechemFrameDecoder.xml,OSGI-INF/org.openhab.binding.wmbus.discovery.DebugMessageListener.xml,OSGI-INF/org.openhab.binding.wmbus.internal.DynamicBindingConfiguration.xml,OSGI-INF/org.openhab.binding.wmbus.internal.WMBusChannelTypeProvider.xml,OSGI-INF/org.openhab.binding.wmbus.internal.WMBusHandlerFactory.xml,OSGI-INF/org.openhab.binding.wmbus.internal.discovery.WMBusDiscoveryService2.xml,OSGI-INF/org.openhab.binding.wmbus.internal.units.CompositeUnitRegistry.xml,OSGI-INF/org.openhab.io.transport.mbus.wireless.MapKeyStorage.xml
Tool = Bnd-5.3.0.202102221516

Bundle-Description = This project contains the official add-ons of openHAB
Bundle-Developers = openhab;email="info@openhab.org";name=openHAB;organization=openHAB;organizationUrl="https://www.openHAB.org"
Bundle-DocURL = https://github.com/openhab/infrastructure/org.openhab.addons.reactor/org.openhab.addons.reactor.bundles/wmbus/org.openhab.binding.wmbus
Bundle-License = "Eclipse Public License 2.0";link="https://www.eclipse.org/legal/epl-2.0/"
Bundle-ManifestVersion = 2
Bundle-Name = WMBus Binding
Bundle-SCM = url="https://github.com/openhab/openhab-addons/org.openhab.addons.reactor.bundles/wmbus/org.openhab.binding.wmbus",connection="scm:git:https://github.com/openhab/openhab-addons.git/org.openhab.addons.reactor.bundles/wmbus/org.openhab.binding.wmbus",developer-connection="scm:git:https://github.com/openhab/openhab-addons.git/org.openhab.addons.reactor.bundles/wmbus/org.openhab.binding.wmbus",tag=HEAD
Bundle-SymbolicName = org.openhab.binding.wmbus
Bundle-Vendor = openHAB.org
Bundle-Version = 3.1.0.202103092048

Provide-Capability =
        osgi.service;uses:=org.openhab.binding.wmbus;objectClass:List<String>=org.openhab.binding.wmbus.BindingConfiguration,
        osgi.service;uses:=org.openhab.binding.wmbus;objectClass:List<String>=org.openhab.binding.wmbus.UnitRegistry,
        osgi.service;uses:=org.openhab.binding.wmbus.device;objectClass:List<String>=org.openhab.binding.wmbus.device.UnknownMeter,
        osgi.service;
                uses:="org.openhab.binding.wmbus.device.itron,
                        org.openhab.core.thing.binding,
                        org.openhab.core.thing.binding";
                objectClass:List<String>="org.openhab.binding.wmbus.device.itron.ItronHandlerFactory,
                        org.openhab.core.thing.binding.BaseThingHandlerFactory,
                        org.openhab.core.thing.binding.ThingHandlerFactory",
        osgi.service;
                uses:="org.openhab.binding.wmbus.device.techem,
                        org.openhab.core.thing.binding,
                        org.openhab.core.thing.binding";
                objectClass:List<String>="org.openhab.binding.wmbus.device.techem.TechemHandlerFactory,
                        org.openhab.core.thing.binding.BaseThingHandlerFactory,
                        org.openhab.core.thing.binding.ThingHandlerFactory",
        osgi.service;uses:=org.openhab.binding.wmbus.device.techem.decoder;objectClass:List<String>=org.openhab.binding.wmbus.device.techem.decoder.TechemFrameDecoder,
        osgi.service;uses:=org.openhab.binding.wmbus.discovery;objectClass:List<String>=org.openhab.binding.wmbus.discovery.WMBusDiscoveryParticipant,
        osgi.service;uses:=org.openhab.binding.wmbus.handler;objectClass:List<String>=org.openhab.binding.wmbus.handler.WMBusMessageListener,
        osgi.service;
                uses:="org.openhab.binding.wmbus.handler,
                        org.openhab.binding.wmbus.internal,
                        org.openhab.core.thing.type";
                objectClass:List<String>="org.openhab.binding.wmbus.handler.WMBusMessageListener,
                        org.openhab.binding.wmbus.internal.WMBusChannelTypeProvider,
                        org.openhab.core.thing.type.ChannelTypeProvider",
        osgi.service;uses:="org.openhab.binding.wmbus.handler,org.openhab.core.config.discovery";objectClass:List<String>="org.openhab.binding.wmbus.handler.WMBusMessageListener,org.openhab.core.config.discovery.DiscoveryService",
        osgi.service;
                uses:="org.openhab.binding.wmbus.internal,
                        org.openhab.core.thing.binding,
                        org.openhab.core.thing.binding";
                objectClass:List<String>="org.openhab.binding.wmbus.internal.WMBusHandlerFactory,
                        org.openhab.core.thing.binding.BaseThingHandlerFactory,
                        org.openhab.core.thing.binding.ThingHandlerFactory",
        osgi.service;uses:=org.openhab.io.transport.mbus.wireless;objectClass:List<String>=org.openhab.io.transport.mbus.wireless.KeyStorage
Require-Capability =
        osgi.service;effective:=active;filter:=(objectClass=org.openhab.binding.wmbus.BindingConfiguration),
        osgi.service;effective:=active;filter:=(objectClass=org.openhab.binding.wmbus.UnitRegistry),
        osgi.service;cardinality:=multiple;effective:=active;filter:=(objectClass=org.openhab.binding.wmbus.UnitRegistry);resolution:=optional,
        osgi.service;effective:=active;filter:=(objectClass=org.openhab.binding.wmbus.device.techem.decoder.TechemFrameDecoder),
        osgi.service;cardinality:=multiple;effective:=active;filter:=(objectClass=org.openhab.binding.wmbus.discovery.WMBusDiscoveryParticipant);resolution:=optional,
        osgi.service;cardinality:=multiple;effective:=active;filter:=(objectClass=org.openhab.binding.wmbus.handler.WMBusMessageListener);resolution:=optional,
        osgi.service;effective:=active;filter:=(objectClass=org.openhab.binding.wmbus.internal.WMBusChannelTypeProvider),
        osgi.service;effective:=active;filter:=(objectClass=org.openhab.io.transport.mbus.wireless.KeyStorage),
        osgi.extender;filter:=(&(osgi.extender=osgi.component)(version>=1.4.0)(!(version>=2.0.0))),
        osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=11))

Export-Package =
        org.openhab.binding.wmbus;uses:="javax.measure,org.openhab.binding.wmbus.handler,org.openhab.core.thing,org.openhab.core.thing.type";version=3.1.0,
        org.openhab.binding.wmbus.config;version=3.1.0,
        org.openhab.binding.wmbus.device;uses:="org.openhab.binding.wmbus,org.openhab.binding.wmbus.discovery,org.openhab.binding.wmbus.handler,org.openhab.core.thing,org.openhab.core.types,org.openhab.io.transport.mbus.wireless,org.slf4j";version=3.1.0,
        org.openhab.binding.wmbus.device.generic;uses:="org.openhab.binding.wmbus,org.openhab.binding.wmbus.handler,org.openhab.core.thing,org.openhab.core.types,org.openhab.io.transport.mbus.wireless";version=3.1.0,
        org.openhab.binding.wmbus.device.itron;
                uses:="org.openhab.binding.wmbus,
                        org.openhab.binding.wmbus.device.generic,
                        org.openhab.binding.wmbus.discovery,
                        org.openhab.core.config.discovery,
                        org.openhab.core.thing,
                        org.openhab.core.thing.binding,
                        org.openhab.core.types,
                        org.openhab.io.transport.mbus.wireless";
                version=3.1.0,
        org.openhab.binding.wmbus.device.techem;
                uses:="org.openhab.binding.wmbus,
                        org.openhab.binding.wmbus.device.techem.decoder,
                        org.openhab.binding.wmbus.discovery,
                        org.openhab.binding.wmbus.handler,
                        org.openhab.core.config.discovery,
                        org.openhab.core.thing,
                        org.openhab.core.thing.binding,
                        org.osgi.service.component";
                version=3.1.0,
        org.openhab.binding.wmbus.device.techem.decoder;uses:="org.openhab.binding.wmbus,org.openhab.binding.wmbus.device.techem,org.slf4j";version=3.1.0,
        org.openhab.binding.wmbus.device.techem.handler;
                uses:="org.openhab.binding.wmbus,
                        org.openhab.binding.wmbus.device.techem,
                        org.openhab.binding.wmbus.device.techem.decoder,
                        org.openhab.binding.wmbus.handler,
                        org.openhab.core.thing,
                        org.openhab.core.types";
                version=3.1.0,
        org.openhab.binding.wmbus.discovery;uses:="org.openhab.binding.wmbus,org.openhab.binding.wmbus.handler,org.openhab.core.config.discovery,org.openhab.core.thing";version=3.1.0,
        org.openhab.binding.wmbus.handler;
                uses:="org.openhab.binding.wmbus,
                        org.openhab.binding.wmbus.config,
                        org.openhab.core.common.registry,
                        org.openhab.core.config.core.status,
                        org.openhab.core.thing,
                        org.openhab.core.thing.binding,
                        org.openhab.core.types,
                        org.openhab.io.transport.mbus.wireless,
                        org.slf4j";
                version=3.1.0,
        org.openhab.io.transport.mbus.wireless;uses:=org.openhab.core.thing;version=3.1.0,
        org.openhab.core.io.transport.serial;version=3.1.0
Import-Package =
        org.openhab.binding.wmbus.device,
        org.openhab.core.common,
        org.openhab.core.common.registry,
        org.openhab.core.config.core,
        org.openhab.core.config.core.status,
        org.openhab.core.config.discovery,
        org.openhab.core.io.transport.serial,
        org.openhab.core.library.types,
        org.openhab.core.library.unit,
        org.openhab.core.thing,
        org.openhab.core.thing.binding,
        org.openhab.core.thing.binding.builder,
        org.openhab.core.thing.type,
        org.openhab.core.thing.util,
        org.openhab.core.types,
        org.openhab.core.util,
        com.google.common.collect;version=14.0,
        com.google.common.primitives;version=14.0,
        javax.crypto,
        javax.crypto.spec,
        javax.measure;version="[1.0,2)",
        javax.measure.quantity;version="[1.0,2)",
        org.osgi.framework;version="[1.8,2)",
        org.osgi.service.component;version="[1.4,2)",
        org.osgi.util.tracker;version="[1.5,2)",
        org.slf4j;version="[1.7,2)",
        tec.uom.se;version="[1.0,2)",
        tec.uom.se.quantity;version="[1.0,2)",
        tec.uom.se.unit;version="[1.0,2)"
Private-Package =
        OH-INF.binding,
        OH-INF.i18n,
        OH-INF.thing,
        org.openhab.binding.wmbus.internal,
        org.openhab.binding.wmbus.internal.discovery,
        org.openhab.binding.wmbus.internal.units,
        org.openmuc.jmbus,
        org.openmuc.jmbus.transportlayer,
        org.openmuc.jmbus.wireless,
        org.openmuc.jrxtx

It seems everything worked fine until May 1st, then there began to be messages like this in the wmbus.log and the add-on wasn´t working anymore:

2021-05-01 17:08:49.798 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Initializing handler.
2021-05-01 17:08:49.799 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getDevice() begin
2021-05-01 17:08:49.799 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getBridgeHandler() begin
2021-05-01 17:08:49.799 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getBridgeHandler() returning bridgehandler
2021-05-01 17:08:49.800 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - Lookup known devices by address 7916440428120402
2021-05-01 17:08:49.803 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - bridge: get device by address: 7916440428120402
2021-05-01 17:08:49.803 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - bridge: device not found
2021-05-01 17:08:49.803 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - Couldn't find device matching address 7916440428120402

and in the openhab.log the corresponding error message:

2021-05-01 17:08:49.807 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NoClassDefFoundError: org/openhab/core/io/transport/serial/UnsupportedCommOperationException
        at org.openmuc.jrxtx.SerialPortBuilder.build(SerialPortBuilder.java:140) ~[?:?]
        at org.openmuc.jmbus.transportlayer.SerialLayer.open(SerialLayer.java:30) ~[?:?]
        at org.openmuc.jmbus.wireless.AbstractWMBusConnection.open(AbstractWMBusConnection.java:77) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$Builder.build(WMBusConnection.java:162) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$WMBusSerialBuilder.build(WMBusConnection.java:98) ~[?:?]
        at org.openhab.binding.wmbus.handler.WMBusBridgeHandler.lambda$0(WMBusBridgeHandler.java:135) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.io.transport.serial.UnsupportedCommOperationException cannot be found by org.openhab.binding.wmbus_3.1.0.202103092048
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[org.eclipse.osgi-3.12.100.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 12 more

From wiring point of view it looks fine, the missing class is not changed across past releases so it can’t be gone. I am not sure when 3.0.2 was released, probably not on first May, yet in order to force re-wiring try calling refresh 73 or update 73. If these do not help clean runtime “cache” directory. It should be /var/lib/openhab/cache (not sure how it looks under openhabian now) or similar. If you are uncertain then do not remove it.

I tried ‘update 73’ and ‘refresh 73’ but didn´t change the behaviour (see below), I suppose this is similar to cleaning up the karaf chache (I did that before with ‘openhab-cli clean-cache’).

openhab.log:

2021-05-05 10:14:02.356 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NoClassDefFoundError: org/openhab/core/io/transport/serial/UnsupportedCommOperationException
        at org.openmuc.jrxtx.SerialPortBuilder.build(SerialPortBuilder.java:140) ~[?:?]
        at org.openmuc.jmbus.transportlayer.SerialLayer.open(SerialLayer.java:30) ~[?:?]
        at org.openmuc.jmbus.wireless.AbstractWMBusConnection.open(AbstractWMBusConnection.java:77) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$Builder.build(WMBusConnection.java:162) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$WMBusSerialBuilder.build(WMBusConnection.java:98) ~[?:?]
        at org.openhab.binding.wmbus.handler.WMBusBridgeHandler.lambda$0(WMBusBridgeHandler.java:135) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.io.transport.serial.UnsupportedCommOperationException cannot be found by org.openhab.binding.wmbus_3.1.0.202103092048
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[org.eclipse.osgi-3.12.100.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 12 more
2021-05-05 10:14:04.314 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NoClassDefFoundError: org/openhab/core/io/transport/serial/UnsupportedCommOperationException
        at org.openmuc.jrxtx.SerialPortBuilder.build(SerialPortBuilder.java:140) ~[?:?]
        at org.openmuc.jmbus.transportlayer.SerialLayer.open(SerialLayer.java:30) ~[?:?]
        at org.openmuc.jmbus.wireless.AbstractWMBusConnection.open(AbstractWMBusConnection.java:77) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$Builder.build(WMBusConnection.java:162) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$WMBusSerialBuilder.build(WMBusConnection.java:98) ~[?:?]
        at org.openhab.binding.wmbus.handler.WMBusBridgeHandler.lambda$0(WMBusBridgeHandler.java:135) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.io.transport.serial.UnsupportedCommOperationException cannot be found by org.openhab.binding.wmbus_3.1.0.202103092048
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[org.eclipse.osgi-3.12.100.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 12 more
2021-05-05 10:14:47.089 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NoClassDefFoundError: org/openhab/core/io/transport/serial/UnsupportedCommOperationException
        at org.openmuc.jrxtx.SerialPortBuilder.build(SerialPortBuilder.java:140) ~[?:?]
        at org.openmuc.jmbus.transportlayer.SerialLayer.open(SerialLayer.java:30) ~[?:?]
        at org.openmuc.jmbus.wireless.AbstractWMBusConnection.open(AbstractWMBusConnection.java:77) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$Builder.build(WMBusConnection.java:162) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$WMBusSerialBuilder.build(WMBusConnection.java:98) ~[?:?]
        at org.openhab.binding.wmbus.handler.WMBusBridgeHandler.lambda$0(WMBusBridgeHandler.java:135) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.io.transport.serial.UnsupportedCommOperationException cannot be found by org.openhab.binding.wmbus_3.1.0.202103092048
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[org.eclipse.osgi-3.12.100.jar:?]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[org.eclipse.osgi-3.12.100.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 12 more

and wmbus.log:

2021-05-05 10:14:01.742 [DEBUG] [nal.discovery.WMBusDiscoveryService2] - Deactivating WMBus discovery service
2021-05-05 10:14:01.805 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Disposing handler.
2021-05-05 10:14:01.824 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Disposing handler.
2021-05-05 10:14:01.835 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Disposing handler.
2021-05-05 10:14:01.846 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - WMBus bridge Handler disposed.
2021-05-05 10:14:01.913 [DEBUG] [nal.discovery.WMBusDiscoveryService2] - Deactivating WMBus discovery service
2021-05-05 10:14:02.134 [DEBUG] [s.device.techem.TechemHandlerFactory] - Techem handler factory starting up.
2021-05-05 10:14:02.165 [DEBUG] [internal.DynamicBindingConfiguration] - Setting up time to live to default value
2021-05-05 10:14:02.166 [DEBUG] [internal.DynamicBindingConfiguration] - Setting up includeBridgeUID to new value true
2021-05-05 10:14:02.174 [DEBUG] [nal.discovery.WMBusDiscoveryService2] - Activating WMBus discovery service
2021-05-05 10:14:02.207 [DEBUG] [g.wmbus.internal.WMBusHandlerFactory] - wmbus handler factory is starting up.
2021-05-05 10:14:02.272 [DEBUG] [g.wmbus.internal.WMBusHandlerFactory] - Creating handler for WMBus bridge.
2021-05-05 10:14:02.274 [DEBUG] [s.device.techem.TechemHandlerFactory] - Techem handler factory starting up.
2021-05-05 10:14:02.285 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - register listener: Adding
2021-05-05 10:14:02.286 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - register listener: Success
2021-05-05 10:14:02.300 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - WMBusBridgeHandler: initialize()
2021-05-05 10:14:02.304 [DEBUG] [g.wmbus.internal.WMBusHandlerFactory] - Creating standard wmbus handler.
2021-05-05 10:14:02.306 [DEBUG] [g.wmbus.internal.WMBusHandlerFactory] - Creating standard wmbus handler.
2021-05-05 10:14:02.307 [DEBUG] [g.wmbus.internal.WMBusHandlerFactory] - Creating standard wmbus handler.
2021-05-05 10:14:02.309 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - Opening wmbus stick amber serial port /dev/ttyUSB0 in mode T
2021-05-05 10:14:02.311 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - Building new connection
2021-05-05 10:14:02.312 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - Device ID filter is empty.
2021-05-05 10:14:02.318 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Created new handler for thing wmbus:encrypted_meter:201db6fecb:7916120030110402
2021-05-05 10:14:02.318 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Created new handler for thing wmbus:encrypted_meter:201db6fecb:7916199813600702
2021-05-05 10:14:02.318 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Created new handler for thing wmbus:encrypted_meter:201db6fecb:7916440428120402
2021-05-05 10:14:02.333 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Initializing handler.
2021-05-05 10:14:02.334 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Initializing handler.
2021-05-05 10:14:02.337 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getDevice() begin
2021-05-05 10:14:02.337 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getDevice() begin
2021-05-05 10:14:02.337 [DEBUG] [internal.DynamicBindingConfiguration] - Setting up time to live to default value
2021-05-05 10:14:02.338 [DEBUG] [internal.DynamicBindingConfiguration] - Setting up includeBridgeUID to new value true
2021-05-05 10:14:02.338 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getBridgeHandler() begin
2021-05-05 10:14:02.338 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getBridgeHandler() returning bridgehandler
2021-05-05 10:14:02.339 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - Lookup known devices by address 7916440428120402
2021-05-05 10:14:02.340 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - bridge: get device by address: 7916440428120402
2021-05-05 10:14:02.340 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - bridge: device not found
2021-05-05 10:14:02.341 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - Couldn't find device matching address 7916440428120402
2021-05-05 10:14:02.341 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - Setting WMBus radio mode to T
2021-05-05 10:14:02.340 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getBridgeHandler() begin
2021-05-05 10:14:02.342 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - Building/opening connection
2021-05-05 10:14:02.343 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getBridgeHandler() returning bridgehandler
2021-05-05 10:14:02.343 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - NOTE: if initialization does not progress from here, check systemd journal for Execptions -- probably native lib still loaded by another ClassLoader = previous version or instance of WMBus binding -> restart OpenHAB
2021-05-05 10:14:02.344 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - Lookup known devices by address 7916199813600702
2021-05-05 10:14:02.345 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - bridge: get device by address: 7916199813600702
2021-05-05 10:14:02.346 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - bridge: device not found
2021-05-05 10:14:02.348 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - Couldn't find device matching address 7916199813600702
2021-05-05 10:14:02.351 [DEBUG] [nal.discovery.WMBusDiscoveryService2] - Activating WMBus discovery service
2021-05-05 10:14:02.353 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Initializing handler.
2021-05-05 10:14:02.357 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getDevice() begin
2021-05-05 10:14:02.358 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getBridgeHandler() begin
2021-05-05 10:14:02.358 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - getBridgeHandler() returning bridgehandler
2021-05-05 10:14:02.359 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - Lookup known devices by address 7916120030110402
2021-05-05 10:14:02.359 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - bridge: get device by address: 7916120030110402
2021-05-05 10:14:02.360 [TRACE] [ing.wmbus.handler.WMBusBridgeHandler] - bridge: device not found
2021-05-05 10:14:02.360 [TRACE] [ing.wmbus.handler.WMBusDeviceHandler] - Couldn't find device matching address 7916120030110402
2021-05-05 10:14:02.646 [DEBUG] [g.wmbus.internal.WMBusHandlerFactory] - wmbus handler factory is starting up.
2021-05-05 10:14:03.904 [DEBUG] [nal.discovery.WMBusDiscoveryService2] - Deactivating WMBus discovery service
2021-05-05 10:14:03.919 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Disposing handler.
2021-05-05 10:14:03.929 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Disposing handler.
2021-05-05 10:14:03.939 [DEBUG] [ing.wmbus.handler.WMBusDeviceHandler] - Disposing handler.
2021-05-05 10:14:03.949 [DEBUG] [ing.wmbus.handler.WMBusBridgeHandler] - WMBus bridge Handler disposed.
2021-05-05 10:14:04.126 [DEBUG] [s.device.techem.TechemHandlerFactory] - Techem handler factory starting up.
2021-05-05 10:14:04.158 [DEBUG] [internal.DynamicBindingConfiguration] - Setting up time to live to default value
2021-05-05 10:14:04.158 [DEBUG] [internal.DynamicBindingConfiguration] - Setting up includeBridgeUID to new value true
2021-05-05 10:14:04.166 [DEBUG] [nal.discovery.WMBusDiscoveryService2] - Activating WMBus discovery service
2021-05-05 10:14:04.198 [DEBUG] [g.wmbus.internal.WMBusHandlerFactory] - wmbus handler factory is starting up.
2021-05-05 10:14:04.257 [DEBUG] [g.wmbus.internal.WMBusHandlerFactory] - Creating handler for WMBus bridge.
[...]

I´m not sure if deleting and recreating the wmbus bridge could be worth a try, but I already did that before posting my first message here.

After updating to openHAB 3.1.0.M4 (via openhabian-configure) there is still the same error in openhab.log:

2021-05-08 13:13:06.972 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NoClassDefFoundError: org/openhab/core/io/transport/serial/UnsupportedCommOperationException
        at org.openmuc.jrxtx.SerialPortBuilder.build(SerialPortBuilder.java:140) ~[?:?]
        at org.openmuc.jmbus.transportlayer.SerialLayer.open(SerialLayer.java:30) ~[?:?]
        at org.openmuc.jmbus.wireless.AbstractWMBusConnection.open(AbstractWMBusConnection.java:77) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$Builder.build(WMBusConnection.java:162) ~[?:?]
        at org.openmuc.jmbus.wireless.WMBusConnection$WMBusSerialBuilder.build(WMBusConnection.java:98) ~[?:?]
        at org.openhab.binding.wmbus.handler.WMBusBridgeHandler.lambda$0(WMBusBridgeHandler.java:135) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ClassNotFoundException: org.openhab.core.io.transport.serial.UnsupportedCommOperationException cannot be found by org.openhab.binding.wmbus_3.1.0.202103092048
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519) ~[org.eclipse.osgi-3.16.200.jar:?]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171) ~[org.eclipse.osgi-3.16.200.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 12 more
2021-05-08 13:13:13.497 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'

Probably I´ll have to try to recompile the add-on myself.

The issue was solved by installing the following features within the OH 3.1 M4 setup (not sure which one was essential, but the first one is mentioned in the WMBus-binding docs - somehow it disappeared during my tests):

feature:install openhab-transport-serial
feature:install openhab-core-io-transport-serial-javacomm
feature:install openhab-binding-serial

Additionally it seems that the second Amber stick (I changed it during my tests) didn´t work properly (no frames were forwarded to openhab/wmbus add-in).

Is there any update on wmbus binding? Very interested because of new European regulation

I just tried to get WM-Bus-Binding to work after Stick arrived.

While starting the binding, console shows following error:

openhab> bundle:start 281
Error executing command: Error executing command on bundles:
Error starting bundle 281: Could not resolve module: org.openhab.binding.wmbus [281]
Unresolved requirement: Import-Package: javax.measure; version=“[1.0.0,2.0.0)”

So any idea?

Binding needs to be recompiled against OH 3.1.x.
If you ever find issue that javax.measure; version="[1.0.0,2.0.0) is unresolved then it means that you run binding which was built for openHAB <= 3.0.x.

1 Like

Thank you. Got another jar file with newer snapshot, so solved :slight_smile:

Hi all, I’m new here and trying to get the wmbus addon running on my openHAB 3.2.0 release build.
Got the jar’s from https://github.com/KuguHome/openhab-binding-wmbus/files/6093423/org.openhab.binding.wmbus-3.1.0-SNAPSHOT_20210305.zip and dropped it into openhab/addons
They get listed via bundle:list but not started:

288 │ Installed │  80 │ 3.1.0.202103071959    │ WMBus Binding
289 │ Installed │  80 │ 3.1.0.202103071959    │ WMBus Binding Tools

When I try to start via bundle:start 288 I got:

Error executing command: Error executing command on bundles:
        Error starting bundle 288: Could not resolve module: org.openhab.binding.wmbus [288]
  Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

Does the addon need a new build for OH3.2 and if yes – does it exist already somewhere?

Thanks for your hints!
Karsten

Welcome here!

(did you read these two posts directly before yours?)