[SOLVED] DSMR-binding

Hello to everybody

I try to get the DSMR Binding working on my openhab2 system.
Unfortunately the power-provider protects the data-transfert by an encryption-code.
I know the code, but I can not find any parameter on the binding to introduce it.
The same problem consists on the IEC 62056-21 Meter Binding.
Does anybody knows what can be done to introduce the encryption-code to the Binding configuration ?

Thanks for any help

Ernest

Yes I know how: someone needs to programmatically implement it in the binding as there is no option to configure it. I can add it. But I have no idea how it should work. Can you provide me with some details or documents on how this should work?

hi Hilbrand,
thank you for the fast reply.

Here some informations I got:
All data outputs are encrypted using the AES128-GCM algorithm, with each smart meter having a different key to decrypt the messages.
Some useful informations maybe found on the following link:
https://www.nexxtlab.lu/smarty-dongle/

best regards

Ernest

I think I can build something with the given information. I’ll let you know when I have something to test, probably next week.

Hi Ernest,

I’ve created a first version of the DSMR binding with support for the “Smarty” meter. The binding is available via the Eclipse Market place as the DSMR Binding or you can get the jar file directly from my openhab2 github release page: https://github.com/Hilbrand/openhab2-addons/releases/tag/DSMR

Can you test this version and give me feedback if it works?

The binding smarty Bridge cannot be detected automatically. So you need to add the bridge manually, configure it and then you can start discovery to detect the actual (electricity) meter.

Hi Hilbrand,

I did’nt expect such a fast response , so thanks very much.

I tried to install the binding by activating the market-place add-on from the paper UI, but this did not show any additional bindings.

Then I tried to install the binding by drag&drop from the market-place. This did not work either.

After this I copied the jar-file from your site to the openhab2/addons directory. But it did not create a cfg.file in the openhab2/services directory.

What did I wrong??

What means “ add the bridge manually”?

I have openhab2 installed for trials an tests on windows.

Unfortunately I will be on holiday until next year, (yes, on my age that’s possible) .

So I cannot test the binding on my counter, but I would like to get it working on the system.

Kind regards

Ernest

I don’t know why the market-place didn’t work. It might be related to some problems with security certificates changes on the market-place website that resulted in errors. But placing the file in the addons map should make it work.

It doesn’t create a cfg file (I think that is something openhab1 specific, but I’m not familiar with openhab1 so I’m guessing here.)

You can add a bridge as follows:

  • In PaperUI go to the inbox.
  • Click on the + icon
  • This should give you a list of installed bindings. This should show the dsmr binding. It should mention the word Luxembourg (If not you might have installed the original version of the binding earlier and need to clean the cache)
  • Click on the row of the DSMR binding.
  • It will start Searching for things. But that won’t find anything.
  • Click on Add Manually
  • Select Luxembourgian Smart Meter
  • Enter the Serial port and Decryption key (The meter must be connected to this serial port).
  • Click the checkbox.

This would add the main thing
Then you need to add the actual meter.
This can be done via auto discovery. This can be done as follows:

  • In PaperUI go to the inbox.
  • Click on the + icon
  • This should give you a list of installed bindings. This should show the dsmr binding. It should mention the word Luxembourg
  • Click on the row of the DSMR binding.
  • It will start Searching for things. This should find the electricity meter.

If it won’t find anything then there is some work to do…You then could see the logs if you see anything mentioned.

Do you have time to test it before you go on holiday? (Just the steps described above, assuming it that won’t work it will take more time and not be possible to get it to work before your holiday).

1 Like

hi Hilbrand
I tryed to do what you suggestet, but when activating + on inbox, the box stays empty.
I deleted the whole openhab2 directory and reinstalled openhab2 completly to be shure to have a virgin system.
the jar-file has been copied to the addons directory.
Here what the log-file says:

SESSION 2018-10-04 23:50:28.757 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_144
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR

!ENTRY org.openhab.binding.dsmr 4 0 2018-10-04 23:50:28.757
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.dsmr [189]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:=“optional”
Unresolved requirement: Import-Package: org.eclipse.smarthome.io.transport.serial

at org.eclipse.osgi.container.Module.start(Module.java:444)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1613)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

best regards

Ernest

This looks like it’s missing other services. When the binding is part of the standard distribution this is automatically taken care off or if you have a binding installed that uses the same services it works too. But in this case you need to manually install them (I always forget about this) I’m not 100% sure what are the correct commands, but I think you can run the following command in the karaf console to install the missing dependencies:

feature:install org.eclipse.smarthome.io.transport.serial
feature:install esh-io-transport-serial-rxtx

If it would still give an error about the annotation missing, you could probably install any openhab2 binding as it’s used by all other bindings.

Hello Hilbrand,
We have been in contact some month ago in order to get the DSMR-Binding working on a Luxembourgian smart counter.
Unfortunately I spent the last few month in the south of France, so I was unable to test your binding.
Since a week I am back in Luxembourg and I tried to read my counter (partly successfully).

I installed openHAB on a raspberryPi 3 and I got your binding from marketplace.
After I configured the port and the encryption-key, I connected the RPi to my counter with an P1-USB cable, I got following results:
-First I had to install the classic binding 2.4.0 too, to have the Luxembourgian binding working.
-On the things-list I can see following things: Dutch Smart Meter (unknown) ; Generic DSMR Device (online) ; Luxembourgian Smart Meter (online)
-Under “Generic DSMR Device” I can see three channels: “Text Message” , “Version” and “Time Stamp”.
-This channels are also shown on the Control-page.
In the Log File the time stamp is updated every minute.
The other values are read and decrypted.
But I don’t know how to get this values as channels.
I join a copy of the Log-File and some screen-shots.
This should help us to get the binding completed.

Kind Regards,<a class=“attachment” href="//community-openhab-org.s3.dualstack.eu-Log-File.txt (8.0 KB)
central-1.amazonaws.com/original/3X/3/5/3516e58fd285c447618840d5f28478844d77e8b7.pdf">Screenshots.pdf (615.3 KB)

Ernest

I am not shure you got the screenshots Screenshots.pdf (615.3 KB)

The good news it looks like decryption works and you even might be able to get it to work. It looks like it doesn’t identify the electricity meter. I’m going to see what’s wrong.

What you can do is to manually add a V5 electricity meter in PaperUI (or file config) and select the Smarty Bridge as bridge. I think this might work.

I believe you can uninstall the classic binding. It would be better as it uses the same namespace as the market place binding. The issue with the market place binding is it depends on other features that are not automatically installed. When you install the classic binding it will install these features. I believe when you uninstall the classic binding these features are not uninstalled, and the market place binding should continue to work. (this problem is the same as I mentioned in my previous comment).

You can remove the Dutch Smart Meter from your installation as it’s the dutch version only.

Hello Hilbrand,
When uninstalling the classic DSMR Binding, the market place binding looses connection to the counter.

On things list the Generic DSMR Device and the Luxembourgian Smart Meter both indicate “UNINITIALIZED-HANDLER_MISSING_ERROR”.

After reinstalling the classic binding both things go “ONLINE” again.

You proposed to add a V5 electricity meter in Paper UI (or file config) and select the Smarty Bridge as bridge. ???
Could you please tell me what that means an how it can be done.

Thanks in advance,

Ernest

Ok I need to use the binding more. it’s not possible to add them manually in paper UI.

It would be possible to add the meter in a things file
In the partially updated readme the smarty meter is documented: https://github.com/Hilbrand/openhab2-addons/blob/dsmr_smarty/addons/binding/org.openhab.binding.dsmr/README.md

I found out the meter you need has some specific cosem id’s for the luxembourgish meter. I’m going to add this as a new meter and update the binding. I need to do some research to figure out what id’s should be added. I’ll give an update once if added the meter.

Thank you very much for your help.
Ernest

@Ernest I’ve updated the binding in the eclipse iot market place with more improvements. It now should have support for the electricity meter and also has some discovery support. Can you test this version?
In PaperUI. Remove any added meters. Reinstall the binding from the market place. Start discovery. It should detect the smarty meter. Add it. Then edit this bridge and add your key. Then start discovery again. It then should detect the electricity meter. Add it and see if it shows all values correctly.

Hello Hilbrand,
I installed and tested your last version. It works fine and I can see the most important channels from the smart meter.

Remarks:

  • the Paper-UI detects three things: “Generic DSMR Device” ; “Main Electricity Meter” and “Smarty Meter”.
  • all three are online when I have the DSMR-Binding 2.4.0 installed together with the market-binding.
  • if the DSMR-Binding is uninstalled and only the market-binding installed, all three things go offline (uninitialized - handler_missing_error).
  • with both, DSMR 2.4.0 and marked-binding installed, all three things go online.
  • the “generic DSMR-Divice” generates Time Stamp and Version Nr. as Channels, while the “Main Electricity Meter” generates 6 most important values as channels.

Further questions:

  • is it possible to introduce some more measurements from the counter to the binding ?
  • I am also interested by the measurements of my Gas-Counter that is radio-linked to the Electricity-Counter ?

best regards and thank’s for your help
Ernest

The requirement of the 2.4 binding is due to the dependency on the serial transport. This should not be an issue once the market binding version is part of openHAB.

Already all electricity channels should be available. The’re probably hidden in PaperUI under the “Show more” (On the right side next to Channels in the edit page of the thing).

I didn’t add any other meter as they seem to be similar to standard DSMR gas, water meters. Your log file you originally posted doesn’t seem to contain log information about the gasmeter, which could explain you don’t see the meter. However, it also might simply not be detected by the binding. When running the discovery process it logs additional information and might give details if it doesn’t recognize the device or might miss something else.

Hello Hilbrand,

I found the hidden channels.
All electricity channels are shown.
The binding works fine.

thank’s a lot
Ernest

1 Like