WMBus binding

393 views
Skip to first unread message

Chris

unread,
May 15, 2013, 8:13:18 AM5/15/13
to ope...@googlegroups.com
Hi there,

I'm new to OpenHAB and spent the last 2 months getting familiar with the features and the OpenHAB designer.
Now I wanted to start with trying to implement a binding for Wireless M-Bus and was asking myself if anyone out here tried the same or has already finished such a binding.
Besides it would be great to get some directions if I encounter any problems. In such a case I will post my issues here.

Greetings
Chris

Thomas Eichstädt-Engelen

unread,
May 15, 2013, 8:48:33 AM5/15/13
to ope...@googlegroups.com
Hi Chris,

that's good news :-)

Could you please add an issue for this binding? All technical discussions regarding MBus should then took place in this issue. It should also contain your rough implementation idea and libs you are going to use!

Thanks for contributing to openHAB and don't forget to vote at the IoT challenge (see news section) ;-)

Regards,

Thomas

- sent from a mobile device -
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Chris

unread,
May 15, 2013, 9:23:12 AM5/15/13
to ope...@googlegroups.com
Hi Thomas,

a issue for this binding has been posted in the issue tracker. I hope I didn't forget anything. ;-)

Regards, Chris.

Thomas Eichstädt-Engelen

unread,
May 15, 2013, 10:30:42 AM5/15/13
to ope...@googlegroups.com
Hi,

looks good! Are there any implemented "driver" libs you are going to use?

Regards,

Thomas

- sent from a mobile device -

Lars Bretschneider

unread,
May 17, 2013, 10:25:15 AM5/17/13
to ope...@googlegroups.com
i would like also to have some m-bus binding in the past i found an interesting project (also a lib for m-bus) at:
http://www.openmuc.org/index.php?id=11 and its also on ogsi basis i found now out in the past i think they didn´t told... so it could be interesting to connect both systems...

 i would like to connect to me energy meters from my heating system ;-)

Thomas Eichstädt-Engelen

unread,
May 17, 2013, 12:45:16 PM5/17/13
to ope...@googlegroups.com
i mentioned openMUC in http://code.google.com/p/openhab/issues/detail?id=303.

Thanks, Lars for mentioning!



Chris

unread,
Jun 25, 2013, 6:21:55 AM6/25/13
to ope...@googlegroups.com
Hi,

Although I have starting problems due to creating a binding skeleton with maven, I also have looked around for some libs to use. The main problem is, that i already have a library, but it's written in c# and not in java. I assume normal modbus libs will not be very helpful, because the whole communication is different from wireless modbus.

Regards,

Chris

Chris

unread,
Sep 5, 2013, 10:49:46 AM9/5/13
to ope...@googlegroups.com
Hi everybody,

after a long time of silence I've managed to implement the binding for WMBus and now I'm going to test everything.

But I stumbled upon one little issue: I can not find any place where to define the keyword for my binding in order to use it for items in the designer. Can anybody tell me where to define this kind of keyword (like "serial=COMX" when using the serial-binding)?

Besides that, is there any other hint to which details I should pay attention to when testing my binding?

Until now I only managed to get the binding started in the runtime (logging shows the binding activator class), but even if I create an item for "wmbus=COMX", nothing happens, no logging from the device class...

I hope you're able to help. It's almost done!

greetings
Chris

Kai Kreuzer

unread,
Sep 11, 2013, 3:31:29 PM9/11/13
to ope...@googlegroups.com
Hi Chris,

The information you are looking for is in the xml file in the OSGI-INF folder (the so called "declarative services component descriptor") - the "wmbus" identifier must be gives as the service.pid property with an org.openhab prefix, i.e. "org.openhab.wmbus".
If you use the Maven archetype to generate a binding skeleton, this is all setup for you.

Best regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Chris

unread,
Oct 15, 2013, 5:55:31 AM10/15/13
to ope...@googlegroups.com
Hi everyone,

I'm now able to use my binding with openHAB, but there are still issues to solve.
This time I got a problem with using the java.security library for decrypting the AES/CBC encoded frames coming from the W-MBus devices.
I use a method for decryption as shown below. But everytime i try a .doFinal() on the encrypted frame part i get a BadPaddingException.
I do know that the frame part must be of n*16 bytes. Any suggestions?

The Code:
public static byte[] AES_decryption(byte[] aESblocks, byte[] coronaKey, AlgorithmParameterSpec ivSpec) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException
{
Cipher a = Cipher.getInstance("AES/CBC/NoPadding");
byte[] aesPlain = new byte[aESblocks.length];
byte[] encrypted = new byte[16];
byte[] decrypted = new byte[16];
Byte[] plain = new Byte[16];
SecretKeySpec sKeySpec = new SecretKeySpec(coronaKey, "AES");
a.init(Cipher.DECRYPT_MODE, sKeySpec, ivSpec);

for (int i=0;i<aESblocks.length/16;i++)
{
System.arraycopy(aESblocks, 16*i, encrypted, 0, 16);
WriteConsole("Encrypted Bytearray", encrypted);
decrypted = a.doFinal(encrypted);

for (int j = 0; j < 16; j++)
plain[j] = (byte)(ivSpec.toString().getBytes()[j] ^ decrypted[j]);

System.arraycopy(plain, 0, aesPlain, 16*i, 16);

System.arraycopy(encrypted, 0, ivSpec, 0, 16); // New initialisation vector
logger.warn("number of successful decrypted blocks: " + i);
}
return aesPlain;
}

frank....@gmail.com

unread,
Oct 31, 2014, 6:33:08 AM10/31/14
to ope...@googlegroups.com, chris.p...@googlemail.com
Hi Chris,

Any update on the Wireless M-Bus binding that you were creating? We use the Fast Forward EngeryCAM RF modules (see attachment) and I would like to be able to read the data from within openHAB. Is there any particular Wireless M-Bus master that you are using for testing your binding? I've come accoss some USB sticks that could be used but haven't bought any for the moment.

Best regards,
Frank
EnergyCam_RF_wMBus_QSG.pdf

Christoph Parnitzke

unread,
Oct 31, 2014, 7:36:44 AM10/31/14
to ope...@googlegroups.com, frank....@gmail.com
Hi Frank,

I'm sorry to say, but I am not longer working on openHAB since spring 2013. My contribution began through my job as a student which I quit back then.
Now I am studying computer science and my actual work is about software development.
Therefore I am not able to help you or give you further information, because I am sadly not able to regain my memory from back then.

Good luck with your work!

Regards,
Chris
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
Reply all
Reply to author
Forward
0 new messages