Hi, thank you very much for the question. I can collect data from the SMA inverter. Thank you really much for the work, that’s amazing!
I was working on integrating my energy meter using the infrared interface that send information to MQTT. My “week-end” work is on https://github.com/gabrielklein/EnergyMeterIEC62056. I have a small raspberry that collect this information. I share this information because other people may be interested by this ~50€ project that give information concerning your power consumption, voltage, power factor and it’s not far from this project…
I’ll come back to the SMA part as soon as I can process the information I receive from my energy meter using MQTT.
What would be funny is to provide a modbus interface on my “energy meter raspberry” as I saw a few server in java… but it’s another project.
It’s certainly recommended to use the prebuilt binary. See the first post with links. You can download the jar from eclipse marketplace or install it directly using marketplace addon.
from the first post links I cannot find the jars. I can just go to
github package source or Eclipse Smarthome.
Can you please provide me an explicit link or instructions about to get
the jars?
Easiest for you is to install IoT Marketplace extension in PaperUI. After that you can find both modbus and modbus transport bundles under addons -> bindings.
Finally got this stuff working after spending too many hours trying to use the obsolete readwrite keywords as I only read post 24. @ssalonen you should edit that post 24 (and some other too) as obsolete!
Anyway looking forward to be able to poll at different rates which is the reason I want to try this new binding, so far I have only connected one item.
@ddozza you can find the jars for OH2.2.0 here: https://github.com/aviborg/ecl110/tree/master/OH2/addons they are downloaded from the eclipse marketplace. I wanted to be able to pull the files to my raspberry and I couldn’t figure out how to pull them to my rpi from eclipse marketplace thats why I made copies.
The download links have been updated in marketplace and above, version bumped to 2.3.0-SNAPSHOT. There were also some smaller fixes implemented (Thanks @gabriel.klein)
Here i am (coming from here: Modbus RTU Drexel & Weiss <> openHAB)
i installed (meaning: i put the 2 *jar files in addon folder) the 2.2 snapshot (as i’m on OH 2.2?) and i’d like to communicate with my heating system (read AND write).
with these settings i was able to read on 1.x addon:
2017-12-27 11:03:33.492 [WARN ] [ore.thing.internal.ThingRegistryImpl] - Cannot create thing. No binding found that supports creating a thing of type 'modbus:serial'.
Please use the versions linked on the opening post, or use the direct download links above. 2.2-SNAPSHOT is older version than 2.3-SNAPSHOT. Please note that generally speaking binding versions can differ from openHAB versions – for example, quite many bindings are 1.x still.
Status: OFFLINE - CONFIGURATION_ERROR readStart=202, and readValueType=int32 were specified even though the data thing is child of endpoint (that is, write-only)!
For the record, I have seen the following ERROR if you update the binding on-the-go, and not restart the binding afterwards (it has been discussed in this thread as well):
2017-12-27 13:51:44.536 [ERROR] [org.openhab.io.transport.modbus ] - [MODBUS Connection Service(247)] The activate method has thrown an exception
java.lang.IllegalArgumentException: [org.apache.commons.pool2.impl.DefaultEvictionPolicy] does not implement EvictionPolicy
at org.apache.commons.pool2.impl.BaseGenericObjectPool.setEvictionPolicyClassName(BaseGenericObjectPool.java:618)
I highly recommend you to use jar files from the “official” sources I mentioned. This ensures you have the latest version (the instructions refer to https://github.com/aviborg/ecl110/tree/master/OH2/addons which has the old version, containing some now-known, now-fixed, bugs). It’s also good to be safe and refer standard sources for the jar files.
Hi
to confirm I use the latest snapshot and it’s working as intended. One additional (sorry if again the same) question: what data type should be used for temperature readings?
I get this: (events.log)
2017-12-27 15:25:17.320 [vent.ItemStateChangedEvent] - holding1 changed from 0.000000000000000000000000000000000000019469202256909675 to 0.00000000000000000000000000000000000001946920085561121
2017-12-27 15:25:17.356 [vent.ItemStateChangedEvent] - holding2 changed from 55 to 54
if I change “Thing data holding1” to readValueType=“uint16”:
I get this: (events.log)
2017-12-27 15:23:52.784 [vent.ItemStateChangedEvent] - holding1 changed from 212 to 211
2017-12-27 15:23:54.999 [vent.ItemStateChangedEvent] - holding2 changed from 54 to 55
so as far as I can check on my vent unit, its 19.4 degrees of celsius
It’s indeed invalid configuration, in order to read data, you need to define poller. See “Supported things” in README:
[data thing] is responsible of converting openHAB commands to Modbus write requests. Is child of poller (read-only or read-write things) or tcp/serial (write-only things).
So set-up a Poller, and make it parent of data.
Best,
Sami
P.s. It’s still unclear to me what jar you are using. You talk about 2.3.0 but link 2.2.0 snapshot bindings
These things are highly dependent on device manufacturera and the conventions differ. The good news is that the binding is pretty flexible, and should cover the known cases pretty well. You just have to refer to the manual for details.
How do you interpret this equation (?) yourself? The formatting is a bit off? Does it describe some sort of equation?
In order to apply equations to read number, you can use transformation. The readme has an example of scaling the number read, for example, 123 in register would be interpreted as 12.3. Now the question is what kind of equation to use…
I’ll take a guess it means to expect a register value between -500 and +1200, representing -50C to +120C.
We’ve no way to tell what format the value comes in, but you could try out as signed integer and see what you get
In your log, 212 looks like reasonable indoor temperature needing a divide-by-ten, see the scaling already pointed to.
and get nice readings:
2017-12-27 20:22:29.925 [vent.ItemStateChangedEvent] - holding1 changed from 19.1 to 19.2
2017-12-27 20:23:17.126 [vent.ItemStateChangedEvent] - holding2 changed from 21.5 to 21.4
And the last question related to Register readings: say I have below named in the manual:
Registers 906-907 “Current supply flow” RO unsigned int 0 - 200000 m3/h, l/s
how I should make my Number item to store this data read from 2 registers (906 and 907)? should I combine it somehow? sorry, I’m new - that’s why asking.