Modbus openHAB2 binding available for alpha testing

Problem Solved. I had not realized that I had to set for every poller a different name (holding1, holding2, …)

1 Like

Seems to be an answer of my first Question :grinning:, each poller needs a different name…

Yet another question:
How do you edit your things file under full run conditions?

If I change it and save, then chaos… warnings… nothing work anymore… => restart raspi … all fine

Should I stop or unregister something before?

I do it while the System is up and running without any issue. Not shure it‘s relevant but I use a different hardware (because of corupt sd-cards)

Yes it show work, otherwise something to fix. There might be warnings etc since ongoing polls are interrupted… How does it work for you @alexopenhab?

B) I am using marketplace binding inside openhab (level beta) to install the two modbus bindings. How to keep them updated? How can I see which “version” I use?

Do refer to the modbus transport and modbus binding?

Not sure if you can find out the exact versions from paper UI. At least bundle:list will print out the versions. You can filter the list to make it more easily readable: bundle:list | grep -i modbus

Regarding update, not sure… Perhaps people on this thread would know. The original thread for marketplace is here:

C) Here are some log-Errors, I am not sure, what I can do to avoid this:

Not sure either. If it is with serial devices, it might be something low level even (physical connections).

Personally would not mind too much if the operations succeed with the retries.

Hope someone more knowledgeable can help you…

EDIT: if you like, you can try the scripts similar to posted here, and try if you can reproduce any issues with those. This is more like troubleshooting where the real issue is, in the binding or the device.

works!

It’s quite weird… In principle the first method should work but cannot tell for sure.

Appreciate if you try out the alternative modbus master implementations, see the above posts for python implementations with pymodbus and minimalmodbus

openhab> bundle:list | grep -i modbus
219 │ Active │ 80 │ 2.3.0.201712240733 │ openHAB MODBUS Transport Bundle
220 │ Active │ 80 │ 2.3.0.201712240733 │ Modbus Binding

Seems to be the current version, is the same as here
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/io/org.openhab.io.transport.modbus/2.3.0-SNAPSHOT/

The actual solution works (after replacing teh first faulty SDM630 Powermeter), and i am now very happy.

I am not happy with the serial modbus-usb converter, the delivered software shows more errors and strange behaviour than I see under the actual bindings in openhab (ok it also eats up my CPU and stresses more than I do at the moment).
Maybe next time I will look for a Modbus-Wifi converter. I plan a second Powermeter far away from my current installation, and Wifi would be a better solution.

Only for interest:

Several weeks ago, I want to test the newest bindings, but I didn’t know the way to install via marketplace binding.

I downloaded the jar file to addon and then I got java errors (several functions missing…).
After some hours of searching i found gnu.io.rxtx…jar, which resolved the missing dependencies.
One of the next updates/upgrades it was getting much worser (much more dependency issues), so I decided to look for another way and I found the marketplace binding.

I don’t know, where the problem was… openhab … apt … binding …
Since using marketplace binding (and cleaning addon-folder) it works fine.

I have a Carlo Gavazzi Energy Analyzer that uses 64 Unit word for kWh and kW measurement.

I was under the impression that the new binding wasn’t supporting that, but I can read those Input registers using uInt32 - I’m I missing something here ? :slight_smile:

Hey @Nanna_Agesen,

(u)int64 support would mean to me that there is a value type int64 and uint64. Binding would then read 4 (or more) consecutive registers, combine them, and would provide them as a ready-to-use number. Similar to float32 or int32, for example.

Now you have to combine the data yourself, and construct the number from two uint32.

It’s mostly for convenience, otherwise we could just use “uint16” for registers and do all conversions in e.g. rules.

Furthermore, writing (u)int64 would be quite advanced now, since you would have to use the “Advanced write using JSON” if you like to write it with single modbus request.

Best,
Sami

1 Like

rxtx means that you are missing the serial transport feature… that’s why. So that was quite expected.

If you install jars manually, you need to also install the serial feature since it is an dependency of the modbus transport.

All this will be way more simple / transparent when/if the addon gets official, and there would be no need even for the marketplace.

@Nanna_Agesen

Reading the 64bit Value with uInt32 “works” in some cases:

  • if uInt32 reads the “lower” 32bit part of the 64bit value, and
  • if the 32bit value is lower/equal than 4294967296 (the other 32bit value is “0”)

If the kWh value is saved as “Wh” you first come in trouble with uInt32 Reading after 4294967.296 kWh.

Powering 120kW (3*100A @ 400V) constant to this PowerMeter all over the time, you will reach this value after about 4 years and costs you > 1Mill. € (at 0.30€/kWh) :crazy_face:.

1 Like

Carlo Gavazzi Energy Analyzer was also a choice for me, but i didn’t found a retailer with fast order.
My B+G E-Tech SDM630Modbus was available via Amazon.
It uses float32 for all values, quite simple …

Nevertheless the first Power Meter was broken, with 32A constant current :open_mouth: on L2 and L3 even if all fuses were off…

Hi @ssalonen

Thanks for your explanation.

i’m I correct that in some of your first versions of the binding, I would receive an error if I tried to read an Uint64 word?

@alexopenhab

I’m a Carlo Gavazzi retailer so it was my first choice :slight_smile:

I don’t think any error occurs. This is because at modbus protocol level there are no concepts such as int64 or even float32. There are just 16 bit registers (input and holding), 1 bit coils, and 1 bit discrete inputs.

Naturally you would get an configuration error if you try to use unknown valuetypes such “foobar” or “int64”.

So the binding can poll the data just fine. Constructing the number just needs some work as mentioned above. Arithmetic is following similar logic @alexopenhab explains above.

Best
Sami

1 Like

Hi. I use a couple of power-meters all connected by modbus rtu (RS485). They are all conected to a modbus rtu to modbus-tcp converter (not wifi but LAN). This works like a charm :slight_smile:
But i have not converted the modbus.cfg yet (I started with OH 1.6). Do you have already a thing-file with all the registers and would share this?

@aco, that would be specific to everyone’s devices. I doubt that there is anyone created a file holding ALL registers just for ‘fun’ :slight_smile:
As from my personal experience - if you define things file holding all registers and define a poll for that - there is a chance you’re end up in high memory/cpu usage of your server.
…unless you find anyone who has the same device.

Regards