Looking for users wanting to read their Luxembourgish smart meter (also called Smarty) with openHAB

This is a call for users who want to read their Luxembourgish smart meter (also called Smarty) with openHAB. The Smarty meter uses a protocol based on the Dutch smart meter protocol: DSMR, but with some encryption added. For the Dutch smart meter there is a binding available. Last year I worked with a user to add support for the Luxembourg variant. But that got stalled. So I don’t know if it actually works. But there is support for this meter in the DSMR binding that is available in the Eclipse Market Place.

So if you are a resident of Luxembourg and want to read your smart meter with openHAB install the DSMR binding that is available in the Eclipse Market Place and let me know if that works. And if so I’m going to include it in openHAB. Note it doesn’t support discovery (yet), so you need to manually add the thing either in files or in PaperUI (and it’s not yet .

Some background information about the Luxembourgish smart meter can be found here:
https://www.nexxtlab.lu/smarty-dongle

1 Like

Hello from Luxembourg

I got my P1 key and tested it successfully with the Nexxtlab solution.
Next I wanted to include it in Openhab but I always get the error “Failed to decrypt P1 telegram due to invalid encryption key”.
Key should be ok but maybe there is something wrong with the communication?

Many thanks
Claude

If it gives no other warning it might be the key is not correctly configured. It gives this error without other warnings if the key was null internally, meaningthe bindingt didn’t read any key.

Hello and many thanks for your quick reply.
While I’, quite new with Openhab can you advice me what and where I can check for more informations ?
I saw also that in the definition for the Dutch meter I can enter the parameters for the port which is no the case for the Lux.meter.
Thanks
Claude

Here the error in the log:

2020-02-26 15:19:52.338 [WARN ] [dsmr.internal.device.SmartyDecrypter] - Decrypting smarty telegram failed:

javax.crypto.AEADBadTagException: Input too short - need tag

at com.sun.crypto.provider.GaloisCounterMode.decryptFinal(GaloisCounterMode.java:540) ~[sunjce_provider.jar:1.8.0_222]

at com.sun.crypto.provider.CipherCore.finalNoPadding(CipherCore.java:1116) ~[sunjce_provider.jar:1.8.0_222]

at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1053) ~[sunjce_provider.jar:1.8.0_222]

at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853) ~[sunjce_provider.jar:1.8.0_222]

at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446) ~[sunjce_provider.jar:1.8.0_222]

at javax.crypto.Cipher.doFinal(Cipher.java:2222) ~[?:1.8.0_222]

at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.decrypt(SmartyDecrypter.java:207) [bundleFile:?]

at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.processCompleted(SmartyDecrypter.java:185) [bundleFile:?]

at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.parse(SmartyDecrypter.java:100) [bundleFile:?]

at org.openhab.binding.dsmr.internal.device.DSMRTelegramListener.handleData(DSMRTelegramListener.java:74) [bundleFile:?]

at org.openhab.binding.dsmr.internal.device.connector.DSMRBaseConnector.handleDataAvailable(DSMRBaseConnector.java:116) [bundleFile:?]

at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.handleDataAvailable(DSMRSerialConnector.java:309) [bundleFile:?]

at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.serialEvent(DSMRSerialConnector.java:268) [bundleFile:?]

at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort$1.serialEvent(RxTxSerialPort.java:81) [bundleFile:?]

at gnu.io.RXTXPort.sendEvent(RXTXPort.java:780) [bundleFile:3.15.0.OH2]

at gnu.io.RXTXPort.eventLoop(Native Method) [bundleFile:3.15.0.OH2]

at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1611) [bundleFile:3.15.0.OH2]

==> /var/log/openhab2/events.log <==

2020-02-26 15:19:52.370 [hingStatusInfoChangedEvent] - ‘dsmr:smartyBridge:22d72c3a’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Failed to decrypt P1 telegram due to invalid encryption key

Hello, is this binding working for the Luxembourgish Smarty? I just tried it out and I am getting a

Failed to decrypt P1 telegram due to invalid encryption key

error in PaperUI.

Here my error log:

2020-05-13 21:39:09.370 [WARN ] [dsmr.internal.device.SmartyDecrypter] - Decrypting smarty telegram failed:
javax.crypto.AEADBadTagException: Input too short - need tag
at com.sun.crypto.provider.GaloisCounterMode.decryptFinal(GaloisCounterMode.java:539) ~[sunjce_provider.jar:1.8.0_242]
at com.sun.crypto.provider.CipherCore.finalNoPadding(CipherCore.java:1116) ~[sunjce_provider.jar:1.8.0_242]
at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1053) ~[sunjce_provider.jar:1.8.0_242]
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853) ~[sunjce_provider.jar:1.8.0_242]
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446) ~[sunjce_provider.jar:1.8.0_242]
at javax.crypto.Cipher.doFinal(Cipher.java:2222) ~[?:1.8.0_242]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.decrypt(SmartyDecrypter.java:207) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.processCompleted(SmartyDecrypter.java:185) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.parse(SmartyDecrypter.java:100) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.DSMRTelegramListener.handleData(DSMRTelegramListener.java:74) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRBaseConnector.handleDataAvailable(DSMRBaseConnector.java:116) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.handleDataAvailable(DSMRSerialConnector.java:309) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.serialEvent(DSMRSerialConnector.java:268) [bundleFile:?]
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort$1.serialEvent(RxTxSerialPort.java:81) [bundleFile:?]
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:780) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort.eventLoop(Native Method) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1611) [bundleFile:3.15.0.OH2]
2020-05-13 21:39:09.380 [WARN ] [device.connector.DSMRSerialConnector] - RuntimeException during handling serial event: 1
java.nio.BufferOverflowException: null
at java.nio.Buffer.nextPutIndex(Buffer.java:521) ~[?:1.8.0_242]
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169) ~[?:1.8.0_242]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.processStateActions(SmartyDecrypter.java:122) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.parse(SmartyDecrypter.java:99) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.DSMRTelegramListener.handleData(DSMRTelegramListener.java:74) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRBaseConnector.handleDataAvailable(DSMRBaseConnector.java:116) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.handleDataAvailable(DSMRSerialConnector.java:309) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.serialEvent(DSMRSerialConnector.java:268) [bundleFile:?]
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort$1.serialEvent(RxTxSerialPort.java:81) [bundleFile:?]
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:780) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort.eventLoop(Native Method) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1611) [bundleFile:3.15.0.OH2]
2020-05-13 21:39:10.370 [WARN ] [device.connector.DSMRSerialConnector] - RuntimeException during handling serial event: 1
java.nio.BufferOverflowException: null
at java.nio.Buffer.nextPutIndex(Buffer.java:521) ~[?:1.8.0_242]
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169) ~[?:1.8.0_242]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.processStateActions(SmartyDecrypter.java:122) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.parse(SmartyDecrypter.java:99) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.DSMRTelegramListener.handleData(DSMRTelegramListener.java:74) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRBaseConnector.handleDataAvailable(DSMRBaseConnector.java:116) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.handleDataAvailable(DSMRSerialConnector.java:309) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.serialEvent(DSMRSerialConnector.java:268) [bundleFile:?]
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort$1.serialEvent(RxTxSerialPort.java:81) [bundleFile:?]
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:780) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort.eventLoop(Native Method) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1611) [bundleFile:3.15.0.OH2]

Thanks for any help.

Hello does anybody have this working in Luxembourg?

Yes, have it working since some month.
Works fine.

Hi, would be happy to help. Had it working for a few weeks beginning of 2019 than it stopped working beginning of may 2019. Fails with “Failed to decrypt P1 telegram due to invalid encryption key”. Until now I never had the time to look into it.

Started digging around the last days and upgraded openhab2 to latest version 2.5.11 but the issue remains. Creos confirms that the Decryption key is correct.
By looking into the logs I see an warn message similar to what others reported:

2020-12-20 16:37:07.091 [WARN ] [dsmr.internal.device.SmartyDecrypter] - Decrypting smarty telegram failed:
javax.crypto.AEADBadTagException: Input too short - need tag
at com.sun.crypto.provider.GaloisCounterMode.decryptFinal(GaloisCounterMode.java:563) ~[sunjce_provider.jar:1.8.0_275]
at com.sun.crypto.provider.CipherCore.finalNoPadding(CipherCore.java:1116) ~[sunjce_provider.jar:1.8.0_275]
at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1053) ~[sunjce_provider.jar:1.8.0_275]
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853) ~[sunjce_provider.jar:1.8.0_275]
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446) ~[sunjce_provider.jar:1.8.0_275]
at javax.crypto.Cipher.doFinal(Cipher.java:2226) ~[?:1.8.0_275]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.decrypt(SmartyDecrypter.java:213) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.processCompleted(SmartyDecrypter.java:190) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.parse(SmartyDecrypter.java:103) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.DSMRTelegramListener.handleData(DSMRTelegramListener.java:74) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRBaseConnector.handleDataAvailable(DSMRBaseConnector.java:116) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.handleDataAvailable(DSMRSerialConnector.java:317) [bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.serialEvent(DSMRSerialConnector.java:276) [bundleFile:?]
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort$1.serialEvent(RxTxSerialPort.java:81) [bundleFile:?]
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:780) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort.eventLoop(Native Method) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1611) [bundleFile:3.15.0.OH2]

One thing you can do to check here is to remove the bdsmr bridge and see start discovery and see if discovery will find the meter bridge. It should find the meter even without encryption key. This can give an indication where the problem might be.

Hi, I removed the dsmr bridge, discovery does not find the bridge.

Does this mean there is a more general issue (maybe with my usb-serial conector) and not an issue related to encryption? If yes, I will start to look into that direction.

I by the way now saw that, even without any dsmr bridge configured I get the following warnings in the logs

2020-12-20 17:28:39.464 [WARN ] [device.connector.DSMRSerialConnector] - RuntimeException during handling serial event: 1

java.nio.BufferOverflowException: null
at java.nio.Buffer.nextPutIndex(Buffer.java:524) ~[?:1.8.0_275]
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:173) ~[?:1.8.0_275]
at >org.openhab.binding.dsmr.internal.device.SmartyDecrypter.processStateActions(SmartyDecrypter.java:125) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.parse(SmartyDecrypter.java:102) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.DSMRTelegramListener.handleData(DSMRTelegramListener.java:74) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRBaseConnector.handleDataAvailable(DSMRBaseConnector.java:116) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.handleDataAvailable(DSMRSerialConnector.java:317) ~[bundleFile:?]
at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.serialEvent(DSMRSerialConnector.java:276) [bundleFile:?]
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort$1.serialEvent(RxTxSerialPort.java:81) [bundleFile:?]
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:780) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort.eventLoop(Native Method) [bundleFile:3.15.0.OH2]
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1611) [bundleFile:3.15.0.OH2]

It could be a problem with the communication. Either the meter is not enabled (anymore) to send the data (this must be enabled by the provider if I’m correct) or problems with connection between meter and openHAB.
From other similar cases I guess that when the meter is not enabled to send data it sends data that is unknown to the binding. The binding tries to parse this and this can cause unexpected errors because it doesn’t handle all possible random cases. This is what you see in the log. If it would be known what the meter sends when not enabled the binding could be adapted to handle that case better.

Hi, ok, thanks for the feedback. I will try to find out if the meter is really still correctly enabled and sends out data as expected. I will also recheck my usb serial converter etc.

Hi, just to give you some feedback. After having told me the last 2 times I asked that everything was fine, Creos (the luxembourgish infrastructure provider) this time found out that the meter was not correctly enabled to send out the information on the local interface. They did some changes and now everything works like a charm. Thanks a lot for pointing me in the right direction.

1 Like

Hi Pierre,
I had the binding running for some time on 0penHAB2.
It worked fine at the beginning, but since the binding was updated it failed frequently.
A month ago I installed openHAB3 and the DSMR-binding works properly again.
The counter is detected as a thing and all the channels are available.

Hi Ernest. Thanks for that update. For me it also works quite fine on openhab3 now since end of 2020. Last week it failed twice and I had to reboot the server to get it back up but I think it is probably an issue with the forwarding of the usb port from my host server to the VM that runs openhab and not an issue with the binding. I have to dive into that when I have the time.

Hi :slight_smile: can you tell me the exact steps to integrate a Luxembourgish smart meter into OpenHab? (What equipment do I need, which binding do I have to install etc…I want to try it with a sagemcom t210-d

Hello,
You need an adapter-cable P1 to USB. (Can be bought at Amazon).
" Dutch Smart Meter Kommunikationskabel"
I run it on a RaspberryPi.
The binding to use is the DSMR Binding.
You need the decryption key you can get from Enovos.
All cannels are recognized (click advanced channels on thing)
but not all channels shown are supported by Enovos.

Can anyone confirm that they have this working currently?

I have same errors in log as @piggel and my Smarty Meter thing status is ‘Failed to decrypt P1 telegram due to invalid encryption key’ but I can successfully read the data with the decrypt.py script from here :
GitHub - mweimerskirch/smarty_dsmr_proxy.

Hi, the binding works fine for me now. Running OH3 on an ubuntu VM on proxmox. As explained the issues I had were linked to creos somehow not correctly activating the P1 interface which produced the error messages even though the decryption key was correct.