SML Reader - how to integrate

Now i did another try. I made a snapshot update and rebooted the whole server.

Now i don´t get any new values.

How can i provide you a log from karaf?

I´m logged in into karaf and entered your log:set debug …

But there i don´t get anything.

If i enter
log:display org.openhab.binding.smlreader
the same, i don´t get anything. karaf stays empty…

EDIT:
SML-Reader binding was not here anymore i think. I installed it from market using paper ui and now i get values again…

Do i have to set the debug level back to another value or will this be done automatically after each restart of OH2?

When will this binding move from market to official bindings?

To see the Log in karaf you have to type “log:tail”.
The PR is currently blocked by https://github.com/NeuronRobotics/nrjavaserial/pull/109.
Meaning there must be a Release of nrjavaserial first and then need to be integrates in openhab.

I installed your latest test-version and now i get many of the following warnings:

2017-10-26 04:17:02.615 [WARN ] [org.openmuc.jsml.EObis              ] - Unknown OBIS Code: 01 00 02 08 00 FF

My powermeter doesn´t need the new pull functionality, it worked before.

Actually this warning is not for the pull functionallity.
The Binding now tries to parse the obis Code for a well known one. If it can not find it, this warning is logged.
I will remove that.
Besides that, is it working for you now?

Yes, binding is working. I get new values from my two powermeters every 20 second, i think.

@all: I changed the binding name to “MeterReaderBinding” and therefore the id of the binding from “smlreader” to “meterreader”. If you update to the new binding on the marketplace you have to change your configuration as well. Sorry for the inconvenience due to this change, but due to the changes that it’s now also IEC 62056-21 compliant, I’ve choose a more general name.

@halloween: The warning is now removed.

How can i download the new bidning from market? I don´t want to install it with paper ui, because if i restart openhab, all market bindings are gone.

Can you provide a link?

The market bindings should not be gone after restart of openhab (It’s not the case for myself).
But you can also download the binding from this location:
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.meterreader/2.2.0-SNAPSHOT/org.openhab.binding.meterreader-2.2.0-SNAPSHOT.jar

I changed to new meterbinding, but now the unit conversion is not there anymore.

In the old binding i could set the factor 1000 and it worked.

Was this removed or is my installation buggy?

EDIT:
Another restart and now it is back again.

Binding from the market don’t work for me, i’ve got the following:

2018-01-04 14:14:55.484 [me.event.ThingUpdatedEvent] - Thing ‘meterreader:meter:b6a6f12b’ has been updated.
==> /var/log/openhab2/openhab.log <==
2018-01-04 14:14:55.482 [INFO ] [ing.meterreader.internal.MeterDevice] - Read out following values:
2018-01-04 14:15:06.792 [ERROR] [.iec62056.Iec62056_21SerialConnector] - Exception while listening for mode D data message
org.openmuc.jrxtx.SerialPortTimeoutException: null
at org.openmuc.jrxtx.JRxTxPort$SerialInputStream.read(JRxTxPort.java:176) [248:org.openhab.binding.meterreader:2.2.0.201711231748]
at java.io.DataInputStream.readByte(DataInputStream.java:265) [?:?]
at org.openmuc.j62056.internal.Helper.readByteAndCalculateBcc(Helper.java:47) [248:org.openhab.binding.meterreader:2.2.0.201711231748]
at org.openmuc.j62056.DataSet.readDataSet(DataSet.java:81) [248:org.openhab.binding.meterreader:2.2.0.201711231748]
at org.openmuc.j62056.DataMessage.readModeDDataMessage(DataMessage.java:126) [248:org.openhab.binding.meterreader:2.2.0.201711231748]
at org.openmuc.j62056.Iec21Port$ModeDReceiver.run(Iec21Port.java:71) [248:org.openhab.binding.meterreader:2.2.0.201711231748]

vzlogger on rpi with openhabian works well, here is my config:

“meters” : [
{
“enabled” : true ,
“protocol” : “d0”,
“baudrate” : 9600,
“device” : “/dev/ttyUSB0”,
“parity” : “8n1”,
“pullseq” : “2f3f210d0a”, // nur wenn Aufforderung notwendig, sonst auskommentieren.
“interval” : 30, // Wartezeit bis zum nächsten Pull, NUR wenn Aufforderung notwendig. Sonst auskommentieren.
}
]

I’ve try:
Protocol sml but then i got no output in vzlogger.log

An second error is, that my razberry board for z-wave communication stops working if i add the “meterreader” to things.

Have no idea anymore :frowning:

Hi msteigenberger,

i’ve installed the latest version of your plugin, unfortunately i don’t get any channels within the things.

My config is:
things/default.things
meterreader:meter:vusb0 [ port="/dev/ttyVUSB0" ]
meterreader:meter:vusb1 [ port="/dev/ttyVUSB1" ]
items/default.items
Number MR_Bezug “Power [%.2f kwh]” (gPower) { channel=“meterreader:meter:vusb0:1-0#1-8-1” }
Number MR_Lieferung “Power [%.2f kwh]” (gPower) { channel=“meterreader:meter:vusb0:1-0#2-8-1” }
Number MR_Ertrag “Power [%.2f kwh]” (gPower) { channel=“meterreader:meter:vusb1:1-0#2-8-1” }

openhab.log
2018-01-07 10:57:10.279 [DEBUG] [org.openhab.binding.meterreader ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.core.ConfigOptionProvider}={component.name=org.openhab.binding.smlreader.ConfigDescription, component.id=242, service.id=379, service.bundleid=236, service.scope=bundle} - org.openhab.binding.meterreader
2018-01-07 10:57:10.296 [DEBUG] [org.openhab.binding.meterreader ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=binding.smlreader, component.id=243, service.id=380, service.bundleid=236, service.scope=bundle} - org.openhab.binding.meterreader
2018-01-07 10:57:10.301 [DEBUG] [org.openhab.binding.meterreader ] - BundleEvent STARTING - org.openhab.binding.meterreader
2018-01-07 10:57:10.313 [DEBUG] [org.openhab.binding.meterreader ] - BundleEvent STARTED - org.openhab.binding.meterreader
2018-01-07 10:57:20.287 [DEBUG] [erreader.internal.MeterReaderHandler] - Initializing SmlReader handler.
2018-01-07 10:57:20.301 [DEBUG] [erreader.internal.MeterReaderHandler] - config port = /dev/ttyVUSB0
2018-01-07 10:57:20.322 [DEBUG] [erreader.internal.sml.SmlMeterReader] - Created SmlDevice instance meterreader:meter:vusb0 with serial connector on port /dev/ttyVUSB0
2018-01-07 10:57:20.373 [DEBUG] [erreader.internal.MeterReaderHandler] - Initializing SmlReader handler.
2018-01-07 10:57:20.381 [DEBUG] [erreader.internal.MeterReaderHandler] - config port = /dev/ttyVUSB1
2018-01-07 10:57:20.383 [DEBUG] [erreader.internal.sml.SmlMeterReader] - Created SmlDevice instance meterreader:meter:vusb1 with serial connector on port /dev/ttyVUSB1

events.log
2018-01-07 10:56:53.414 [.ItemChannelLinkAddedEvent] - Link ‘MR_Bezug-meterreader:meter:vusb0:1-0#1-8-1’ has been added.
2018-01-07 10:56:53.428 [.ItemChannelLinkAddedEvent] - Link ‘MR_Lieferung-meterreader:meter:vusb0:1-0#2-8-1’ has been added.
2018-01-07 10:56:53.492 [.ItemChannelLinkAddedEvent] - Link ‘MR_Ertrag-meterreader:meter:vusb1:1-0#2-8-1’ has been added.
2018-01-07 10:57:20.277 [hingStatusInfoChangedEvent] - ‘meterreader:meter:vusb0’ changed from UNINITIALIZED to INITIALIZING
2018-01-07 10:57:20.293 [hingStatusInfoChangedEvent] - ‘meterreader:meter:vusb0’ changed from INITIALIZING to ONLINE
2018-01-07 10:57:20.373 [hingStatusInfoChangedEvent] - ‘meterreader:meter:vusb1’ changed from UNINITIALIZED to INITIALIZING
2018-01-07 10:57:20.385 [hingStatusInfoChangedEvent] - ‘meterreader:meter:vusb1’ changed from INITIALIZING to ONLINE

looks good so far, but no item updates, messages from VUSB0 and VUSB1 connected with minicom to them looks good also:
/dev/ttyVUSB1
/HAG5eHZ010C_RWE1mA10

1-0:0.0.0255(131811-5000415)
1-0:2.8.1
255(023517.5674)
1-0:96.5.5255(00)
0-0:96.1.255
255(0000029734)
!
/HAG5eHZ010C_RWE1mA10

1-0:0.0.0255(131811-5000415)
1-0:2.8.1
255(023517.5674)
1-0:96.5.5255(00)
0-0:96.1.255
255(0000029734)
!
[…]

/dev/ttyVUSB0
/HAG5eHZ010C_RWE1ZA20

1-0:0.0.0255(797802-5000638)
1-0:1.8.1
255(039555.6249)
1-0:2.8.1255(010237.4083)
1-0:96.5.5
255(82)
0-0:96.1.255*255(0000047939)
!
/HAG5eHZ010C_RWE1ZA20

1-0:0.0.0255(797802-5000638)
1-0:1.8.1
255(039555.6251)
1-0:2.8.1255(010237.4083)
1-0:96.5.5
255(82)
0-0:96.1.255*255(0000047939)
!

Please help :wink:

@sjurkuhn: are there no further timeout exceptions? Have you tried iec62056 protocol in things configuration

problem solved, i’ve tried the wrong protocol mode (SML instead of D)…

Mode D works for you? This hast not been tested until now. Which Meter are you using?

Yes Mode D is working:
2018-01-08 21:42:42.715 [vent.ItemStateChangedEvent] - meterreader_meter_d1829e5f_1_0_1_8_1_255 changed from 39577.0402 to 39577.0404
2018-01-08 21:42:44.668 [vent.ItemStateChangedEvent] - meterreader_meter_d1829e5f_1_0_1_8_1_255 changed from 39577.0404 to 39577.0406

Meters are Hager Typ EHZ 361Z5 and EHZ 161L5

@sjurkuhn: great! Thanks for testing it!

@Marcello87: Is the pull sequence necessary? This is currently not supported. Which meter are you using?

@msteigenberger: Thanks for your answer. I use a Easymeter Q3D from Volkszähler. It won’t works with and without pull sequence. But today, after ~10 more tries it works, i got the reading in OH2 :slight_smile: . Don’t know exactly what my mistake was, maybe old entrys in the vzlogger.log. Does the binding reads this file? Today i delete this file and restart the meter script.

Thanks for this great binding! :slight_smile:

Only my second problem allready exist:
If i add the “MeterReader binding” thing an i restart OH2 my “Razberry 2” thing change it’s status to “offline” and no Z-Wave device will works anymore.

Full status of Razbery after restart of OH2 shows:
Status: OFFLINE - COMMUNICATION_ERROR Serial Error: Port /dev/ttyS0 does not exist

And i can’t edit the “Port configuration” of Razberry because there is no choice to set “/dev/ttyS0” like without “MeterReader binding”. Don’t know why? If delete “MeterReader binding” and restart OH2 works again and i can choice “/dev/ttyS0 or /dev/ttyUSB0”. Has some any idea for that?

I have a similar problem like Marcello. I installed the meterreader binding on my OH2 installation. Running on a Raspberry Pi3 with openhabian linux. I am using it with an “IR-Lesekopf” (by-id: CP2104_USB_to_UART_Bridge_Controller). PaperUI setup: SML 9600baud. And its working fine.

Additionally I am using the WR3223 Binding from michael_fraefel to connect my Heating/ventilation Unit to another USB port via a similar USB-serial Connector (by-id: CP2102_USB_to_UART_Bridge_Controller).
Here is the Problem: Once the Meterreader binding is setup my WR3223 Binding shutsdown and produces an error: java.io.IOException: Serial port ‘/dev/ttyUSB1’ could not be found.

As soon as I change the Baud Setting from 9600 to AUTO the Meterreader will bring a Server Error and the Meter will go offline. Now the WR3223 starts working again.

So far I wasn´t able to get both Bindings running simultaneously.
Could anyone give some advice?

Thank you.

I have now tested it with an other Zwave Controller “Aeotec Aeon Labs USB Stick” and got the same error.

After adding MeterReader thing, it changed the “Port Configuration” for “Z-Wave Serial Controller” and no Z-Wave device is work anymore.

Also set dev-link “/dev/lesekopf0” was no option, same error.

Any idea?