Modubs configuration for EE800 device

Hi,

I attached a EE800 device to my raspberry - (USB serial adapter mapped to tty099).
Next I installed the modbus binding from paperui.
I also located the configuration file and added:

serial.EE800.connection=/dev/ttyUSB99:9600:8:even:1:rtu:35:1500:none:none

serial.EE800.type:input
serial.EE800.start:25
serial.EE800.length:2
serial.EE800.valuetype:float32

Regarding to the documentation tow registers starting 0x19 (dec 25) hold the temperature.
see documentation http://downloads.epluse.com/fileadmin/data/product/ee800/BA_EE800_e.pdf

My problem now - how to get the modbus addon to read the value.
And how to map it for usage in the UI.

The E+E website also has some documentation about their modbus implementation:
http://downloads.epluse.com/fileadmin/data/product/ee071/AN0103.pdf

I’m also not sure if I have to use the “communication address” which would be 30026 or the register number (as I tried).
By the way - my final approach is to read (every 15 seconds or so) all values from the sensor which are:
Addr. Register
30026 0x19 temperature [°C], [°F]
30028 0x1B relative humidity [%]
30030 0x1D water vapour partial pressure [°C], [°F]
30032 0x1F dew point temperature [°C], [°F]
30036 0x23 absolute humidity [g/m³], [g/ft³]
30038 0x25 maxing ratio [g/kg], [gr/lb]
30040 0x27 specifi c enthalpy [kJ/kg], [BTU/lb]
30042 0x29 frost point temperature [°C], [°F]
30046 0x2D CO2 Raw* [ppm]
30048 0x2F CO2 [ppm]

Manfred

Examples:

Hi,

I forgot to mention that I use OH2
And I also have made a modbus.things file with the content:
Number MBTemp “Temp [%d]” (ALL) {modbus=“EE800:0”}
The “thing” isn’t listed in paper UI.
Are “modbus bindingins” not available in paperui???

Just (helpless :slight_smile:) I added an Item filewith the content
Number MBTempI “Temp [%d]” (ALL) {modbus=“EE800:0”}
This shows up in paperui under items…but not in control.

Next I added a sitemap:
sitemap demo label=“My home automation” {
Frame label=“Date” {
Text item=Date
}
Frame label=“Demo” {
Text item=MBTemp valuecolor=[>25=“orange”,>15=“green”,<=15=“blue”]
Text item=MBTempI valuecolor=[>25=“orange”,>15=“green”,<=15=“blue”]
}
}
}

The sitmap (found in the documentation) doen’t seem to work.
It shows the Text “Date” instead of the current date - and nothing for my modbus value.

I already checked git and also the forums as well as the wiki.
What I found before on the one of the links you provided was a command to start modbus TCP.
Is there also a command needed to start serial modbus?

Mobus is a 1.9 binding. No Things. Only Items. 1.9 bindings and they’re Items cannot be managed by PaperUI.

Move that Item definition to a .Items file.

Only Things appear in Control on PaperUI. PaperUI is intended to be an administrative UI, not a user’s UI.

I would have to see the definition for the Date Item to know why nothing shows up there. Simplify your sitemap to:

sitemap demo label="My home automation" {
    Frame label=test {
      Text item=MBTemp
    }
}

Look in events.log and see if MBTemp is receiving updates.

Look in openhab.log for errors and messages from mobus.

I don’t know if the version 2 Modbus binding is in the OH2 release package, but if so it is very rudimentary and I would uninstall it completely.
Use instead the “old” but more functional 1.9 Modbus binding, but you will have to look at “how to install 1.X bindings in OH2” to do that.

Then you will need to create and edit a modbus.cfg file, and finally set up your Items. There is nothing to “start”, Modbus binding will just start polling devices.

So far I got the following configuration now:
modbus.items:
Number MBTempI “Temp [%d]” (ALL) {modbus=“eehtc:0”}

modbus.cfg
serial.eehtc.connection=/dev/ttyUSB99:9600:8:even:1:rtu:50:1500:none:none
serial.eehtc.id=11
serial.eehtc.type:input
serial.eehtc.start:25
serial.eehtc.length:2
serial.eehtc.valuetype:float32

I assume .id is for the modbus address which is 11 for my device.

mymap.sitemap:
sitemap demo label=“My home automation” {
Frame label=“Demo” {
Text item=MBTempI
}
}

When I open http://MYIP:8080/basicui/app?sitemap=mymap I get:
an icon http://MYIP:8080/icon/number?state=NULL&format=svg
a label showing the text Temp
and a - (minus) sing

No value(s) - nothing.

I (hope) modbus 1.9 is installed since
a.) I installed it via paperui
b.) I found \MYIP\openHAB-userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.modbus\1.9.0 containing org.openhab.binding.modbus-1.9.0.jar (and sha1)

further I found:
\MYIP\openHAB-userdata\tmp\mvn\org\openhab\addons\openhab-addons-external\1.9.0
containing openhab-addons-external-1.9.0-modbus.cfg with the same content as I showed above for modbus.cfg

I find no logs…

Sorry for asking dumb questions but I’m new to openhab as well as new to linux.

hi

At least the syntax is a bit off, the parameter value should be separated by equals sign (=), not by colon (:).

So instead of

serial.eehtc.type:input

have

serial.eehtc.type=input

instead .

You should see error in the logs but I’m not yet proficient enough with openhab2 to advice you how to access those.

Best
Sami

@ssalonen:

Thank you very much!
I didn’t notice this - changing to = made the things much better.
In my dashboard I now can see Err instead of the hyphen.

So something seems to be working now - which is much more than before.
I guess I can now play around and check if I’m right with the assumption that …id means the modbus address and so forth.
At least it tries to talk now - which is much more than I had before!

Thank you again!

id is the device Modbus address. Note that its in decimal, not hex. (So are addresses, come to that)

OH2 logging (no experience here either)
http://docs.openhab.org/administration/logging.html

After coming home in the evening the number has been gone.
Again I can only see a minus sign.

Further things I discovered:

With early test I tried to name my slave EE800 - since I had no luck I changed it to eehtc.
Now my \MYIP\openHAB-conf\services\modbus.cfg looks like this:
serial.eehtc.connection=/dev/ttyUSB99:9600:8:even:1:rtu:50:1500:none:none
serial.eehtc.id=11
serial.eehtc.type=input
serial.eehtc.start=25
serial.eehtc.length=1
serial.eehtc.valuetype=float32
serial.eehtc.postundefinedonreaderror=true
serial.eehtc.updateunchangeditems=true

I further found a file \MYIP\openHAB-userdata\config\org\openhab\modbus.config
with the content:

poll=“500"
serial.EE800.connection=”/dev/ttyUSB99:9600:8:even:1:rtu:50:1500:none:none"
serial.EE800.id="11"
serial.EE800.length="2"
serial.EE800.start="25"
serial.EE800.type="input"
serial.EE800.valuetype=“float32"
serial.eehtc.connection=”/dev/ttyUSB99:9600:8:even:1:rtu:50:1500:none:none"
serial.eehtc.id="11"
serial.eehtc.length="1"
serial.eehtc.postundefinedonreaderror="true"
serial.eehtc.start="25"
serial.eehtc.type="input"
serial.eehtc.updateunchangeditems="true"
serial.eehtc.valuetype="float32"
service.pid=“org.openhab.modbus”

this file changes (updates) from time to time when I change \MYIP\openHAB-conf\services\modbus.cfg

But I don’t know where it finds the EE800 setting (earlier in modbus.cfg but now deleted).

And I can see traffic on my USB-Serial adapter - so something tries to read there…

I checked the logfiles and found:
22:54:06.818 [ERROR] [et.wimpi.modbus.net.SerialConnection] - open port failed: Modbus Serial Master
22:54:06.819 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: open port failed: Modbus Serial Master. Connection SerialConnection@d7c38d[portName=/dev/ttyUSB99,port=]. Endpoint ModbusSerialSlaveEndpoint@91a932[portName=/dev/ttyUSB99]

“Ghost” configuration settings keep catching folk out with OH2
See

I finally got it running!!

My modbus.cfg

poll=1000
serial.eehtc.connection=/dev/ttyUSB99:9600:8:even:1:rtu:35:1500:none:none
serial.eehtc.id=11
serial.eehtc.type=input
serial.eehtc.start=25
serial.eehtc.length=24
serial.eehtc.valuetype=float32_swap
serial.eehtc.postundefinedonreaderror=true
serial.eehtc.updateunchangeditems=false

My modbus.items

Number MB0 “Temp [%.2f °C]” (ALL) {modbus=“eehtc:0”}
Number MB1 "Feuchte [%.2f %%rf] " (ALL) {modbus=“eehtc:1”}
Number MB2 “H²O-PD [%.2f mbar]” (ALL) {modbus=“eehtc:2”}
Number MB3 “Taupunkt [%.2f °C]” (ALL) {modbus=“eehtc:3”}
Number MB4 “FKTemp (nicht vorh.) [%.0f]” (ALL) {modbus=“eehtc:4”}
Number MB5 “H²0-Dichte [%.2f g/m³]” (ALL) {modbus=“eehtc:5”}
Number MB6 “Mischungsv. [%.2f g/kg]” (ALL) {modbus=“eehtc:6”}
Number MB7 “Enthalpie [%.2f kJ/kg]” (ALL) {modbus=“eehtc:7”}
Number MB8 “Tau-/Frostpunkt [%.2f °C]” (ALL) {modbus=“eehtc:8”}
Number MB9 “Leer [%.0f]” (ALL) {modbus=“eehtc:9”}
Number MB10 “CO² ung. [%.0f ppm]” (ALL) {modbus=“eehtc:10”}
Number MB11 “CO² [%.0f ppm]” (ALL) {modbus=“eehtc:11”}

After changing any modbus parameter the modbus service makes a restart.
But it looks as if it doesn’t close the serialport in this case.
So the port is locked after the restart - and everything breaks.
Log:

19:08:04.715 [ERROR] [et.wimpi.modbus.net.SerialConnection] - open port failed: Modbus Serial Master
19:08:04.717 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: open port failed: Modbus Serial Master. Connection SerialConnection@1e19c7d[portName=/dev/ttyUSB99,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1098b8e[portName=/dev/ttyUSB99]
19:08:34.754 [ERROR] [et.wimpi.modbus.net.SerialConnection] - open port failed: Modbus Serial Master
19:08:34.756 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 2/3 error: open port failed: Modbus Serial Master. Connection SerialConnection@1e19c7d[portName=/dev/ttyUSB99,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1098b8e[portName=/dev/ttyUSB99]
19:09:04.793 [ERROR] [et.wimpi.modbus.net.SerialConnection] - open port failed: Modbus Serial Master
19:09:04.795 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 3/3 error: open port failed: Modbus Serial Master. Connection SerialConnection@1e19c7d[portName=/dev/ttyUSB99,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1098b8e[portName=/dev/ttyUSB99]
19:09:04.796 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 3, throwing last error: open port failed: Modbus Serial Master. Connection SerialConnection@1e19c7d[portName=/dev/ttyUSB99,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1098b8e[portName=/dev/ttyUSB99]
19:09:04.798 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - Error connecting connection SerialConnection@1e19c7d[portName=/dev/ttyUSB99,port=<null>] for endpoint ModbusSerialSlaveEndpoint@1098b8e[portName=/dev/ttyUSB99]: open port failed: Modbus Serial Master
19:09:04.799 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (eehtc): Error getting a new connection for endpoint ModbusSerialSlaveEndpoint@1098b8e[portName=/dev/ttyUSB99]. Error was: Unable to validate object
19:09:04.800 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (eehtc) not connected -- aborting read request net.wimpi.modbus.msg.ReadInputRegistersRequest@59d9aa. Endpoint ModbusSerialSlaveEndpoint@1098b8e[portName=/dev/ttyUSB99]
19:09:35.003 [ERROR] [et.wimpi.modbus.net.SerialConnection] - open port failed: Modbus Serial Master
19:09:35.005 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: open port failed: Modbus Serial Master. Connection SerialConnection@1e962d4[portName=/dev/ttyUSB99,port=<null>]. Endpoint ModbusSerialSlaveEndpoint@1098b8e[portName=/dev/ttyUSB99]

since I didn’t know how to restart modbus corectly I solved the problem restarting openhab2

sudo systemctl restart openhab2

What did I learn from this (maybe it helps someone else):
First - documentation is (somehow wrong or at least irritating).
In the modbus.cfg template I found:

The number of data item to read
(optional, defaults to ‘0’ - but set it to something meaningful)
serial.slave1.length=…

My device has the following values:

Addr   Item     Type     Val
25       0      float32  Temp
27       1      float32   RelHum
...
47      11      float32   CO2

So I thought
Start 25 (correct)
Length 12 (items – 0-11 - from reading template)
This was the problem - lenght means not “number of items” - it means “number of registers”.
After finding out this I only had to learn, that changes in modbus.cfg bring up the “port keeps open problem”.

I’m only afraid, that some problems (connection lost - or device not answering) may lead to a restart of the service - which may result in the “port already open problem”.
I guess that should be fixed somehow (closing the port if the modbus addon needs a restart).

Thank’s to every community member helping me with my “newcomer problems”.

Manfred

Hi thanks for the response

I’m not sure how to improve the documentation, the docs say the following on the length says

number of data items to read. Data items here refers to registers, coils or discrete inputs depending on the slave type. For example, if the goal is to read one item with valuetype=int32, one needs to read two registers (2 * 16bit = 32bit), thus length = 2. If three coils are of interest, one should specify length = 3

How could we make it better?

( https://github.com/openhab/openhab1-addons/wiki/Modbus-Binding)

Another thing, would you be willing to report the port-not-closed as a bug in github?

Best
Sami

@ssalonen
What you posted from the documentation explains the things perfectly.
Maybe you can change the text in the “template” to this text - in my case it would have saved me a lot of messing around.

I reported an issue here:

Maybe remove the text from the cfg template and say “see docs” - which are more likely to be up to date, have hints and tips, crossreferences, etc.