SML Reader - how to integrate

oh, all right! It’s weather1 in the addons.cfg, you’re right! :wink:

So - I’ll open a new thread for channel-configuring, perhaps somebody will know…

Solved it with much help from Udo:

with the declaration of the Thing, the channels can be configured as follows:

smlreader:meter:BinderPower		[port="/dev/ttyUSB0", refresh=20] {
    Channels:
        Type NumberChannel : 1-0#1-8-0 [
            conversionRatio=1000
        ]
    }

With that, the conversionRate is applied in the configuration! YEAH!

Great! I will add it to the Docs soon.

I did an openhab update (snapshot) today and after that, my sml reader wasn´t giving new values.

My openhab runs on esxi and i did a snapshot before, so i was able to revert the whole upgrade process. After recovery of the snapshot, smsl reader was giving new values.

All other bindings worked without problems.

I don´t have any log-files.

Anybody made the same experience with latest snapshot build of openhab? Could someone try this too?

I will make a new try soon, then i will save the log-files after starting the updadet openhab.

@msteigenberger I’ve seen on your Git page under known limitations/issues that the binding isn’t able to read from meters running in pull mode. Sadly my reader is running in this mode. Would it be possible to extend the binding to support meters in pull mode?

I had an volkszähler installation running for testing purposes and it worked quiete well but the volkszähler installation is a “little” bit oversized just to get one value from the meter. This was the point why I was hoping to use your binding. Sadly I’m not capable of extending it myself because I don’t know very much Java. I can read it to some point but cant extend the code.

I really would appreciate any help.

I’m using openHABian on a Reaspberry 3 with the USB-IR-Reader from Volkszähler.

If you just want to read the values from your energy meter you don’t need a full volkszaehler installation. Then you can just install the vzlogger component which actually reads your data. The vzlogger offers a websocket port which you can bind to (e.g with node-red) and then bring the values to OpenHAB. That’s how I read my energy meter and visualise the values in OpenHAB.

Hi Michel, thanks for the hint. I will keep this in mind and test if it is working for me. Nevertheless it would be great to use a binding for this purpose.

So the Binding needs to configure a pull sequence and probably also the parity.
Its probably not so hard to implement, but i don’t have time at the moment to implement this.
I can’t promise you anything, sorry…

Sounds promising.

At the moment it is not really time critical as I will try using the workaround with vzlogger but if you could implement it in the future I would be really happy.

@Sanjiro: Can you please test the following version:
https://drive.google.com/file/d/0B-d9fUWjvIoVX2J2X01EN3AxOXc/view?usp=sharing

You can set a pull sequence here. But I saw that some meters also have a handshake for baudrate negotiation or needs an an ACK and so on.
Do you know which mode your meter supports (A, B, C, D)? Which meter is it?

@msteigenberger: Thank you for this new version. I’ve installed this new snapshot version. I can configure the thing and it went online afterwards. Promising so far but no items can be discoverd. I think the reason for that is that my meter needs an ACK.

Sorry I don’t know which mode my meter supports. The model is the 12EC3g from Apator.

Today i made a new test to update openhab to the latest snapshot.

But again, sml reader doesn´t work after that. I don´t get any values from my two powermeters. In paper ui they are online, but i don´t get new values.

I even tried the latest snapshot you provided, but no luck.

If i go back to the state before the update, all works again.

Any idea? Did openhab change something in the latest snapshots? Now i´m on 2.2.0 build #1065, but i tried this a few days before, too.

I made a snapshot inside esxi of my whole openhab-server, so a change back to the old version is no problem.

Any idea what this could be? Could you tell me, what i have to check, to find the error?

@halloween: can you please add a log here?

Which log do you need? openhab.log?

There is a debug log of the binding too? Can you tell me, how i can get this log?

yes I mean the openhab.log.
Please log in to karaf console (see http://docs.openhab.org/administration/console.html)
Then set the log level to debug:

 log:set debug org.openhab.binding.smlreader

see:
http://docs.openhab.org/administration/logging.html#karaf-console

@Sanjiro: Can you please test the latest version?
https://drive.google.com/open?id=0B-d9fUWjvIoVX2J2X01EN3AxOXc

I added handling for IEC62056-21 Modes A,B,C and D. Probably your meter supports mode C. You can configure this in the thing configuration.

@msteigenberger: Thank you for this new version. With your suggested mode I can establish a communication with my meter but get the following error: UID segment '1-8-0*00' contains invalid characters. The last segment of the channel UID must match the pattern [A-Za-z0-9_-#]*.

This are the log entries before the above mentioned error:

Summary

2017-10-20 09:55:29.875 [INFO ] [onnectors.Iec62056_21SerialConnector] - Datamessage read: {
“data message”: {
“manufacturer ID”: “APA”,
“meter ID”: “EC3g00006”,
“enhanced ID/capability”: “”,
“data block”: {
“data set”: {“address”: “0.0.0”, “value”: “91411407”, “unit”: “”},
“data set”: {“address”: “0.0.1”, “value”: “001APADA”, “unit”: “”},
“data set”: {“address”: “F.F”, “value”: “00”, “unit”: “”},
“data set”: {“address”: “0.2.0”, “value”: “1.29”, “unit”: “”},
“data set”: {“address”: “1.8.0*00”, “value”: “005031.36”, “unit”: “”},
“data set”: {“address”: “C.2.1”, “value”: “150910501116”, “unit”: “”},
“data set”: {“address”: “”, “value”: " ", “unit”: “”},
“data set”: {“address”: “0.2.2”, “value”: “:::::G11”, “unit”: “”}
}
}
}
2017-10-20 09:55:29.986 [WARN ] [org.openmuc.jsml.EObis ] - Unknown OBIS Code: 30 2E 30 2E 30
2017-10-20 09:55:29.988 [WARN ] [org.openmuc.jsml.EObis ] - Unknown OBIS Code: 30 2E 30 2E 31
2017-10-20 09:55:29.990 [WARN ] [org.openmuc.jsml.EObis ] - Unknown OBIS Code: 46 2E 46
2017-10-20 09:55:29.992 [WARN ] [org.openmuc.jsml.EObis ] - Unknown OBIS Code: 30 2E 32 2E 30
2017-10-20 09:55:29.996 [WARN ] [org.openmuc.jsml.EObis ] - Unknown OBIS Code: 31 2E 38 2E 30 2A 30 30
2017-10-20 09:55:29.998 [WARN ] [org.openmuc.jsml.EObis ] - Unknown OBIS Code: 43 2E 32 2E 31
2017-10-20 09:55:30.000 [WARN ] [org.openmuc.jsml.EObis ] - Unknown OBIS Code: 30 2E 32 2E 32

2017-10-20 10:15:17.646 [DEBUG] [g.smlreader.handler.SmlReaderHandler] - Adding channel: 1-8-0*00 with item type: Number

The data set in error represents the actual meter value which is correct. I think that the *00 could be the problem as maybe the regex doens’t match.

Great!
I’ve uploaded another version that should fix that bug.
I didn’t test that (sorry I don’t have time to think about unit tests)

https://drive.google.com/open?id=0B-d9fUWjvIoVcDFyS3ZOb25sSzA

Thank you very very much! Now it is working fine.
I am very grateful for the very quick installation of the additional function, especially in view of the limited time available to you.

Thanks for testing it.
I will do some cleanup and Push my changes to get them integrates.