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

Sorry for the late reply :frowning:
We are currently working hard on cleaning up the code and bringing it upstream into Eclipse Smart Home, also including a couple more devices.
Currently, the only implemented Kamstrup device is the MultiCal 302, but if you have a Multical 21 and can provide us with a log, we should be able to implement it in the coming weeks. Or you could try yourself :slight_smile:

The latest version is at https://github.com/KuguHome/openhab-binding-wmbus/tree/develop .
To receive the WMBus messages, youā€™ll need a receiver. The underlying jMBus library supports Amber Wireless AMB8465-M, Radiocrafts RC1180-MBUS and IMST iM871A-USB. Currently, we are working with the AMB8465-M, which is unfortunately quite expensive. I belive, the quickest, cheapest solution will be this one: https://shop.imst.de/wireless-modules/usb-radio-products/10/im871a-usb-wireless-m-bus-usb-adapter-868-mhz
We are also looking into supporting the CUL hardware later, but that may take some time.

Okay thanks for the reply. I guess IĀ“ll have to buy this im871a adaptor and then give it a shot.

I just received this USB dongle. Currently I have in installed in my windows 10 workstation, but I seem to have a problem finding some software to monitor whatever wmbus devices we have ??

I know, there are wMBus softwares for windows, but they are typically targeted for a professional audience. I donā€™t have that IMST stick myself, but maybe itā€™s worth asking them via phone or email.

Otherwise, you could use our latest development version of them wmbus binding at https://github.com/KuguHome/openhab-binding-wmbus/releases/download/v0.3.0-develop/org.openhab.binding.wmbus-2.3.0-SNAPSHOT.jar and watch the logs.

Yep, and that software is highly expencive.

Would that be the tail log or debug log?
IĀ“ll give it a try.

We always set the logging to DEBUG or even TRACE and output it into a separate file
(in /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg):

log4j2.appender.wmbus.type = RollingRandomAccessFile
log4j2.appender.wmbus.name = WMBUS
log4j2.appender.wmbus.fileName = ${openhab.logdir}/wmbus.log
log4j2.appender.wmbus.filePattern = ${openhab.logdir}/wmbus.log.%i
log4j2.appender.wmbus.append = true
log4j2.appender.wmbus.layout.type = PatternLayout
log4j2.appender.wmbus.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.wmbus.policies.type = Policies
log4j2.appender.wmbus.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.wmbus.policies.size.size = 100MB

log4j2.logger.org_openhab_binding_wmbus.level = TRACE
log4j2.logger.org_openhab_binding_wmbus.name = org.openhab.binding.wmbus
log4j2.logger.org_openhab_binding_wmbus.additivity = false
log4j2.logger.org_openhab_binding_wmbus.appenderRefs = wmbus
log4j2.logger.org_openhab_binding_wmbus.appenderRef.wmbus.ref = WMBUS

We also have a nice collector tool for the WMBus frames available, which can be accessed from the browser, we should be able to release it soon.

Have you already have had luck with receiving something via the stick?

@anon71383850 just for your information, we are also currently working on implementing those Techem water meters. Should also be available soon.

@patrik_gfeller did continue playing around with your devices? Our focus is currently still on wireless MBus, not on the wired variant, but for testing I threw one of your messages into the decoder, and this was the result:

2018-11-16 12:09:40.689 [DEBUG] [wmbus.discovery.DebugMessageListener] - Could not decode frame (manufacturer ID: ZDH, device ID: 09720908, device version: 16, device type: RESERVED, as bytes: 8868080972091099)
org.openmuc.jmbus.DecodingException: Unable to decode message with this CI Field: 0x00.

The manufacturer ā€œZDHā€ is not listed at https://www.dlms.com/flag-id/flag-id-list so probably there is a problem with decoding, maye a byte-shift

Not yetā€¦ Plan on testing this upcoming weekend.

IĀ“m ready to test thisā€¦
Pluged in the IMST wmbus dongle to my Rpi. Added the .jar to the addons folder. CantĀ“ see anything happen at all in the tail log.
Went into PaperUI and saw this (screenshot). Is this suppose to happen? And why does it say z-wave USB dongle??

Updateā€¦
Things are really NOT going wellā€¦ When added the ā€œz-waveā€ dongle (which actually is the IMST WMbus dongle), I revceived this error: But PaperUI found it first time (screenshot above)ā€¦ So this happened AFTER I added the thing.

2018-11-17 13:23:07.041 [me.event.ThingUpdatedEvent] - Thing 'zwave:serial_zstick:018D117C' has been updated.
2018-11-17 13:23:07.050 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:018D117C' changed from OFFLINE (COMMUNICATION_ERROR): Serial Error: Port {0} does not exist to OFFLINE (BRIDGE_OFFLINE): Controller is offline
2018-11-17 13:23:07.072 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:018D117C' changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to OFFLINE (COMMUNICATION_ERROR): Serial Error: Port {0} does not exist

I use Symlinks to I know for sure the correct USB has been defined.

[12:32:14] openhabian@openHABianPi:~$ lsusb
Bus 001 Device 005: ID 10c4:8856 Cygnal Integrated Products, Inc.
Bus 001 Device 008: ID 152d:9561 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 001 Device 009: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 001 Device 007: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 006: ID 0658:0200 Sigma Designs, Inc.
Bus 001 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[12:32:20] openhabian@openHABianPi:~$

The IMST dongle is Device 009.

my USB serial rules

SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyUSB-ZStick", GROUP="dialout", MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="ttyUSB-RS486", GROUP="dialout", MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8856", SYMLINK+="ttyUSB-MeshConn", GROUP="dialout", MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="ttyUSB-WMbus", GROUP="dialout", MODE="0666"

And after restart:

[13:17:24] openhabian@openHABianPi:~$ ls /dev/tty*
/dev/tty    /dev/tty22  /dev/tty37  /dev/tty51  /dev/tty9
/dev/tty0   /dev/tty23  /dev/tty38  /dev/tty52  /dev/ttyACM0
/dev/tty1   /dev/tty24  /dev/tty39  /dev/tty53  /dev/ttyAMA0
/dev/tty10  /dev/tty25  /dev/tty4   /dev/tty54  /dev/ttyprintk
/dev/tty11  /dev/tty26  /dev/tty40  /dev/tty55  /dev/ttyS0
/dev/tty12  /dev/tty27  /dev/tty41  /dev/tty56  /dev/ttyUSB0
/dev/tty13  /dev/tty28  /dev/tty42  /dev/tty57  /dev/ttyUSB1
/dev/tty14  /dev/tty29  /dev/tty43  /dev/tty58  /dev/ttyUSB2
/dev/tty15  /dev/tty3   /dev/tty44  /dev/tty59  /dev/ttyUSB-MeshConn
/dev/tty16  /dev/tty30  /dev/tty45  /dev/tty6   /dev/ttyUSB-RS486
/dev/tty17  /dev/tty31  /dev/tty46  /dev/tty60  /dev/ttyUSB-WMbus
/dev/tty18  /dev/tty32  /dev/tty47  /dev/tty61  /dev/ttyUSB-ZStick
/dev/tty19  /dev/tty33  /dev/tty48  /dev/tty62
/dev/tty2   /dev/tty34  /dev/tty49  /dev/tty63
/dev/tty20  /dev/tty35  /dev/tty5   /dev/tty7
/dev/tty21  /dev/tty36  /dev/tty50  /dev/tty8
[13:17:31] openhabian@openHABianPi:~$ ^C

/dev/ttyUSB-WMbus

PaperUI setup:

Now what is missing?

I guess I need a more detail description of, how to install this one. Placing the .jar into the addons folder, doesnt install the binding. I believe I need some more stuff according to the readme file in github. But I have no idea how to

3a. Native librxtxSerial.so needs to be placed in /etc/openhab2/rxtx/ with openhab user as the owner.

Hi, I am planning to have also Kamstrup Multical 21 and would like to know if Openhab will support it. It is with encription too. Could you pls. reply if there is any working solution at the moment?
For your ref: https://github.com/tobiasrask/wmbus-client support Multical 21 and I think it would be halpfull to add support for this device too.

Yes it will work with any standard wireless m-bus device. Last version of binding supports discovery of encrypted devices. Once they are found you need to set their encryption key in thing configuration.

Cheers,
Łukasz

Thank you! I will keep you posted if there any case here :wink: btw which USB dongle you suggest (tested) to use for communication ?

We used amber one. I think @friesenkiwi might have some additional receiver hardware which he was able to test.

As mentiond 25 days ago, IĀ“m struggling getting the IMST dongle to workā€¦ I cant really get past this step, as I dont understand what to do. The dongle is beeing discovered on the wrong serial port when initialised and found in PaperUI. And I have no idea why.

Try to edit bridge and point it to proper device (according to log you attached). In case if you experience any troubles try to reset your installation and start from scratch.
Later this month I might be able to automate dongle discovery to simplify that part for you.

The IMST dongle is connected to my Rpi running openhabian. As I showed above, I have created a symlink and have set up the IMST dongle to /dev/ttyUSB-WMbus. When I set the IMST dongle to /dev/ttyUSB-WMbus I get the error according to the logfile.

Serial Error: Port {0} does not exist

I have tried that as well, leaving me in the same situation, (ofcouse, since IĀ“m doing exactly the same). Perhaps this is down to using symlinks, and there may be an error in there somewhere. I just wish I knew where to look and fix this. IĀ“m no good at Linux stuff and I really hate these serial/USB problems. I have other dongles working just fine :face_with_symbols_over_mouth:

Check the rights you have over the serial port (linux command line) - sudo chmod 777 /dev/ttyUSB-WMbus

Check!
DidnĀ“t change anythingā€¦

Hi @Kim_Andersen, I am very sorry for the late reply, I must have missed the mail notifications :frowning:

So, some clarification: we currently use the Amber Wireless stick under Linux, so I have no personal experience with the iMST stick. But it is supported by the underlying jMBus library and we included the configuration options for it, so it should work with the binding. USB device auto discovery is not (yet!) included, so any device which is popping up automatically in the inbox when connecting the stick is a false/wrong match (Z-wave is totally unrelated to WMBus).
Instead, you need to remove all things that used the stickā€™s USB device (/dev/ttyā€¦) and manually add a WMBusBridge, where you then can configure the brand and serial port. Regarding the librxtx, yes in linux librxtx-java needs to be installed (via apt install) and in openHAB, the serial transport (feature:install openhab-transport-serial in the openhab console). The part

3a. Native librxtxSerial.so needs to be placed in /etc/openhab2/rxtx/ with openhab user as the owner.

from the README is not necessary anymore. We need to update the README soon.

I never used manual symlinks or custom lsb USB serial rules. The Amber stick appears as /dev/ttyUSB0, the iMST should do a similar thing or maybe /dev/ttyACM0 or the like. You should be able to see it in dmesg -w. So just for testing, maybe it is an option to remove all sticks and the custom rules, then reboot and watch the log while connecting the stick. Then in the Inbox or Things list in PaperUI select the + ā†’ WMBus Binding ā†’ ā€˜manually add thingā€™ ā†’ WMBus Stick ā†’ ā€œStick Modelā€=IMST iM871A-ZSB", ā€œSerial Portā€=[your serial port], ā€œRadio Modeā€=ā€œTā€. After submitting the form, the bridge should switch into ONLINE and devices should start to appear in your Inbox. You can then just approve them from there.

I just released our recent development state as version 0.4.0 at Release v0.4.0-develop Ā· KuguHome/openhab-binding-wmbus Ā· GitHub. Thanks to @splatch who worked very hard on that one!
That latest version brings generic availability of all standards-compliant WMBus/OMS devices (so it should include the KamstrupMultical 21 with encryption @antouanbg), also the EnergyCam (@antoniolobefaro) Also decoding/support for Techem water meters has been added (may be interesting for you, @anon71383850 ).

We are very interested in getting feedback from all of you testing it!
If you have used older versions before, you might need to delete and re-add the devices from inbox.

IĀ“m no good at linuxā€¦ I cant get past this part, as I have no idea what to write in the openhab console.
Second, isnĀ“t the openhab-transport-serial the same used for Zigbee and z-wave? If yes, then it should be installed, as IĀ“m running both Zigbee and Z-wave.

I need to use symlinks, as I have 4 sticks, and they seem to change port adress whenever I reboot, unless I set them by symlinks.

Isnt there a .jar file in the archive??