New DSMR-binding for OpenHAB 2

A verification question. If you set the refresh to more than 60 seconds, like 120. Does it still update every minute?
You can enable the logging in karaf console which will show the updates given by the meter. (log:set DEBUG org.openhab.binding.dsmr) that should give some insight in if the meter does give those values within your desired time frame or if something might not working in the binding.

@hilbrand

Bridge dsmr:dsmrBridge:myDSMRDevice [serialPort="/dev/ttyUSB0"] {
     Things:
        device_v5 dsmrV5Device [channel=-1]
        m3_v5_0 mygasmeter [channel=1]
        electricity_v5_0 electricityV5 [refresh=120, channel=0]
}
root@homeautomation:/openhab/userdata/logs# tail -f events.log | grep Meter
2019-01-19 10:01:38.972 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 128.680 to 128.687
2019-01-19 10:01:38.977 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.396 to 0.405
2019-01-19 10:01:38.979 [vent.ItemStateChangedEvent] - MeterVoltageNow changed from 237.4 to 237.8
2019-01-19 10:02:38.975 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 128.687 to 128.695
2019-01-19 10:02:38.982 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.405 to 0.400
2019-01-19 10:02:38.986 [vent.ItemStateChangedEvent] - MeterVoltageNow changed from 237.8 to 237.5
2019-01-19 10:03:38.989 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 128.695 to 128.702
2019-01-19 10:03:39.000 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.400 to 0.407
2019-01-19 10:03:39.003 [vent.ItemStateChangedEvent] - MeterVoltageNow changed from 237.5 to 237.3
2019-01-19 10:04:39.015 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 128.702 to 128.709
2019-01-19 10:04:39.018 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.407 to 0.405
2019-01-19 10:04:39.020 [vent.ItemStateChangedEvent] - MeterVoltageNow changed from 237.3 to 237.1

so I guess the refresh parameter does not change the refresh rate, it still comes in every 60 secs. If I look directly at the serial port there are numerous reports every 30 seconds…

kr

Han

Hmm. Some more checks. What if you remove the thing? And what if you set the refresh value to 0?

Thanks, with doing this I saw an error in my item declaration so it was not using the thing but I think the channel directly…
Changed the items and now its reporting every 10 secs.

2019-01-19 13:17:04.425 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 130.660 to 130.662
2019-01-19 13:17:04.428 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.731 to 0.493
2019-01-19 13:17:14.427 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 130.662 to 130.664
2019-01-19 13:17:14.432 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.493 to 0.741
2019-01-19 13:17:14.435 [vent.ItemStateChangedEvent] - MeterVoltageNow changed from 237.9 to 237.6
2019-01-19 13:17:24.432 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 130.664 to 130.666
2019-01-19 13:17:24.439 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.741 to 0.735
2019-01-19 13:17:34.441 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 130.666 to 130.668
2019-01-19 13:17:34.443 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.735 to 0.730
2019-01-19 13:17:34.444 [vent.ItemStateChangedEvent] - MeterVoltageNow changed from 237.6 to 237.4
2019-01-19 13:17:44.441 [vent.ItemStateChangedEvent] - MeterDeliveryTariff0 changed from 130.668 to 130.669
2019-01-19 13:17:44.451 [vent.ItemStateChangedEvent] - MeterDeliveryNow changed from 0.730 to 0.484
Bridge dsmr:dsmrBridge:myDSMRDevice [serialPort="/dev/ttyUSB0"] {
     Things:
        device_v5 dsmrV5Device [channel=-1]
        m3_v5_0 mygasmeter [channel=1]
        electricity_v5_0 electricityV5 [refresh=10, channel=0]
}
`

Number MeterDeliveryTariff0 "Laag tarief [%.3f kWh]" {channel="dsmr:electricity_v5_0:myDSMRDevice:electricityV5:emeter_delivery_tariff1"}
Number MeterDeliveryTariff1 "Hoog Tarief [%.3f kWh]" {channel="dsmr:electricity_v5_0:myDSMRDevice:electricityV5:emeter_delivery_tariff2"}
Number MeterDeliveryNow "Momentaan gebruik [%.3f kWh]" {channel="dsmr:electricity_v5_0:myDSMRDevice:electricityV5:emeter_actual_delivery"}
Number MeterVoltageNow "Huidige spanning [%.1f V]"	{channel="dsmr:electricity_v5_0:myDSMRDevice:electricityV5:emeter_instant_voltage_l1"}``

Hello Guys,

wondering if somebody can help me configure the serial port to the DSMR binding. I tried everything (I think) but still I get the “connector don’t exist” message. Can some maybe guide me through this?

My meter is a SMR5.0

Things file:

Bridge dsmr:dsmrBridge:mysmartmeter [serialPort="/dev/ttyUSB0"] {
    Things:
        device_v5 dsmrV5Device [channel=-1]
        electricity_v5_0 electricityV5 [channel=0]
}

Many thanks,

Piet

Hi Piet,

Have you set the EXTRA_JAVA_OPTS, as described here? I’d also advice to use symlinks to give your USB device a meaningful and constant name, as described here.

Good luck!
Bart

Also did you look into these suggestions in the documentation:
https://www.openhab.org/docs/administration/serial.html

Thanks for the fast reply guys appreciate it,

I added the following code the the openhab2 file (/etc/default/openhab2)

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0:/dev/ttyUSB0"

I already tried before to add symlinks but I think something went wrong because I don’t see the name apearing which I added.

This is the line I added in the 99-rules file:

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A13M4HEW", SYMLINK+="ttyFT232-P1"

I could not find ttyF232-P1 anywhere. Tried both F232-P1 and USB0. Currently my dutch meters are giving offline - configuration error and “unknown”.

Got a piece of my log here:

18:16:42.415 [DEBUG] [mr.internal.handler.DSMRBridgeHandler] - No data received for 270 seconds, restarting port if possible.
18:16:42.420 [DEBUG] [.device.connector.DSMRSerialConnector] - Closing DSMR serial port
18:16:42.423 [DEBUG] [.internal.device.DSMRSerialAutoDevice] - Stop discovery of port settings.
18:16:42.425 [DEBUG] [.internal.device.DSMRSerialAutoDevice] - Stop discovery of port settings.
18:16:42.429 [DEBUG] [.device.connector.DSMRSerialConnector] - Port /dev/ttyF232-P1 does not exists
18:16:42.496 [DEBUG] [.internal.device.DSMRSerialAutoDevice] - Error during discovery of port settings: @text/error.connector.dont_exists, current state:DISCOVER_SETTINGS.
18:16:42.498 [DEBUG] [.internal.device.DSMRSerialAutoDevice] - Stop discovery of port settings.
18:16:42.620 [DEBUG] [mr.internal.handler.DSMRBridgeHandler] - No data received for 270 seconds, restarting port if possible.
18:16:42.622 [DEBUG] [.device.connector.DSMRSerialConnector] - Closing DSMR serial port
18:16:42.623 [DEBUG] [.internal.device.DSMRSerialAutoDevice] - Stop discovery of port settings.
18:16:42.625 [DEBUG] [.internal.device.DSMRSerialAutoDevice] - Stop discovery of port settings.
18:16:42.627 [DEBUG] [.device.connector.DSMRSerialConnector] - Port /dev/ttyUSB0 does not exists
18:16:42.628 [DEBUG] [.internal.device.DSMRSerialAutoDevice] - Error during discovery of port settings: @text/error.connector.dont_exists, current state:DISCOVER_SETTINGS.
18:16:42.629 [DEBUG] [.internal.device.DSMRSerialAutoDevice] - Stop discovery of port settings.

Gr Piet

:grinning: It’s working now! Now I don’t know exactly what steps are required (next time, after a clean install) but I do know that the last missing link was adding openhab user to dailout.

adduser openhab dialout

The log eventually showed something like:

Failed to read: No provider for port /dev/ttyUSB0 found.

Which eventually led me to Add openhab user to dialout group #18. And after some reverse searching I found it mentioned on this thread also. Problem was that I only added openhab to tty an NOT dailout.

Any way thanks for the help guys.

I have a problem with the DSMR items. I think the binding itself puts a unit behind the value of an item. For example the Kwh.
Now I want to export the values ​​to node-red, but it cannot handle these values.
I have already tried to convert the value with a proxy item but I have not yet succeeded. Does anyone have a solution for this so that I only get the value without unity?

Without specific details I have no idea on how to fix this. But It’s not the problem of the binding. It’s probably because the items are UoM types. Those have unit information. Search for UoM related questions here on the forum. That might give you some information. Or else open a new topic with specific details on what you have configured and how you send the information to node-red.

Hi all,

I installed the latest SMDR binding after first trying the 2.4 version, but that does not resolve my problem:

I have a new “/Ene5\XS210 ESMR 5.0” meter, with some sunpanels delivering power back.
I installed the “Slimme Meter Bridge”, after that is detects two smart meters:
“Algemene DSMR Meter” (DSMR V5), with 2 channels: P1 Versie, and Tijd.
“Elektriciteitsmeter” (DSMR V5.0), with 3 channels: Elektriciteitsverbruik Daltarief, Elektriciteitsverbruik Piektarief and Huidige Elektriciteitsverbruik.

What is should expect somewhere is also something like “Elektriciteitgeleverd Dal/Piektarief”. But these values are not detected. However can see them passing by in de datagrams, and also in the debug logs:

21:05:09.178 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel p1_version_output to value 50
21:05:09.181 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel p1_timestamp to value 2019-12-02T21:04:42.000+0100
21:05:09.181 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel p1_text_string to value
21:05:42.012 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_equipment_identifier to value E0047000055950719
21:05:42.013 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_delivery_tariff1 to value 581.622 kWh
21:05:42.015 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_delivery_tariff2 to value 497.707 kWh
21:05:42.015 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_production_tariff1 to value 113.142 kWh
21:05:42.016 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_production_tariff2 to value 279.564 kWh
21:05:42.017 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_tariff_indicator to value 0002
21:05:42.017 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_actual_delivery to value 0.286 kW
21:05:42.018 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_actual_production to value 0.000 kW
21:05:42.028 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_power_failures to value 2
21:05:42.029 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_long_power_failures to value 1
21:05:42.031 [DEBUG] [smr.internal.handler.DSMRMeterHandler] - Updating state for channel emeter_power_failure_log_entries to value 0

What can i do the get these values into openhab?

(I stole this image from @wborn :wink: and it’s for an other binding, but the message is the same)

Really? Aaarghh. I was stumbling too long for this… Thank you!

Thanks for building this new binding for openhab2.

I finally found some time to move away the old dmsr1 binding to this new one.
I guess i found a small snack in the binding, but i’m not quite sure.

According the the interwebs my meter (Landis Gyr+ ZFM110CBt) is a DSMR v4 meter, and in my old dsmr.cfg i used

#Version
version=v4.0

When i create a electricity_v4_0 meter, i am no longer able to read out my L2 and L3 delivery.
(All other values are working)

When set trace logging enabled i do see

Object(type:EMETER_INSTANT_POWER_DELIVERY_L1, cosemValues:{=0.022 kW}), Cosem Object(type:EMETER_INSTANT_POWER_DELIVERY_L2, cosemValues:{=0.148 kW}), Cosem Object(type:EMETER_INSTANT_POWER_DELIVERY_L3, cosemValues:{=0.068 kW}),

But i never see the channels being updated.

How-ever when i change to electricity_v5_0 i do see these channels being updated.

Should i just select v5 meter, or is this indeed a little snack within the binding?

There are more versions of version 4 supported: 4.0.4 and 4.2. In the documentation of DSMR v4.0 the instant power data is not specified, and therefor not in the 4.0 version of the binding. It could be your meter has variation of 4.0 or isn’t completely compatible with 4.0. You might try discovery to see what the binding comes up with or try 4.0.4 or 4.2.

Yes that was it indeed!

Changed to V4_2 meter and now it works!

I Just noticed now that it was just a few lines above the ones i posted here:
Object(type:P1_VERSION_OUTPUT, cosemValues:{=42})

Thanks for the support!

I have a DSMR v5 meter. Electricity works fine. But Gas is -NaN. My Gasmeter has channel 2. The first connected meter did not work. So it was replaced, but got channel 2. eg.
0-2:96.1.0(4730303339303031383433313135303138)
0-2:24.2.1(201022184506S)(00847.336*m3)

What should I place in dsmr.things?
Gasmeter (DSMR V3.0) is online.

Did you try anything mentioned in the documentation? Does it discover any gasmeter if you try to discover it?

In paperui it says Gasmeter Online.