New DSMR-binding for OpenHAB 2

(Guido Van Haasteren) #121

I installed the binding in OH2.4Snapshot and it worked as soon as I configured the right serial port.
But after a reboot I got the error: ‘Serial Port already in use’.
In the binding manual there is a reference to: serial port configuration and there it is stated:

Note: openHABian comes with a menu option to configure the serial ports automatically. So all the rest here is only relevant for non-openHABian users.

I am using HABIAN on a Debian 9 install on a laptop. It is therefor Habian, but not from the image-file but through github. And as it turns out, I have a problem with reboots and the formentioned error message.

Should I follow the configuration manual, or do you think I have a different problem?
The manual goes on with:

  • When using more than one USB-Serial converters, it may happen that the /dev/ttyUSB0 device is named /dev/ttyUSB1 after a reboot. To prevent this problem, alias names can be assigned to serial devices by adding them to /etc/udev/rules.d/99-com.rules . Example:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AE01F0PD", SYMLINK+="ttyMySensors"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="0001", SYMLINK+="ttyCulStick"

You need to find relevant pieces of information using e.g. udevadm command line utility:

udevadm info -a -p $(udevadm info -q path -n /dev/ttyACM0)

I tryed this last command, but I have no clue what to do with the output?

udev.txt (4.0 KB)

(Guido Van Haasteren) #122

I got things working now. It turned out not to be a case of configuring the serial ports, it had more to do with the binding. I will post about it separately and refer to here.
new post

(Thomas) #123

I am living in Austria and since a half of a year I have a ISKRA AM550-TD0.11 smartmeter.
Does somebody know if this binding is working with this ISKRA model?

(SierraNL) #124

DSMR is a dutch standard, maybe you can figure out of Austria has it’s own or uses another standard?
Googleing I found that the ISKRA AM550-TD0’s are used in the Netherlands aswel, but the last two numbers of the serial are different.
Does the device has an RJ11 port? This is used in the DSMR binding where you can use an USB to serial 5V-TTL cable and add an RJ11 connector to the serial and then you will receive “telegrams” of data every 10 seconds, that are parsed by this binding.

(Thomas) #125

Yes it has this port in the right upper corner.

Here is a pdf, it’s in german. It’s a simple end user manual. At least you see a picture of the device.

Regarding the standard I have to google.

(Han) #127

I also started using the binding on my OH 2.4 installation after the installation of smart meters. Setting up is a breeze (after u know what to do :sunglasses:).
I am interested in reading out the “emeter_actual_delivery” variable very frequently because I want to trace where I can save on electricity, I tried to set the refresh rate to 10 seconds. Updates however keep coming in once every 60 seconds …

Things file:

        device_v5 dsmrV5Device [channel=-1]
        m3_v5_0 mygasmeter [channel=1]
        electricity_v5_0 electricityV5 [refresh=10, channel=0]

kr Han

(Hilbrand Bouwkamp) #128

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.

(Han) #129


Bridge dsmr:dsmrBridge:myDSMRDevice [serialPort="/dev/ttyUSB0"] {
        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…



(Hilbrand Bouwkamp) #130

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

(Han) #131

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"] {
        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"}``