Hi there
I’ve been reading this forum for a long time already and found a lot of helpful information here while learning and configuring OpenHab. I think now it’s time to give back some info from my side to the forum since I didn’t find here these devices’ config for 2nd version bindings.
I have several relatively cheap Modbus devices from AliExpress. And they work pretty well in my apartment for a several months now.
Volison ADM-5850G (Modbus TCP <> Modbus RTU/ASCII)
The base one is the Volison gateway (Modbus TCP <> Modbus RTU/ASCII). I chose it because it has Ethernet.
The only one thing I don’t like about it is that it should be accessed via Internet Explorer (other browser simply do not work with it). But the good point is that you don’t need to configure/reconfigure something too often. Beside some sections like Password, Firmware Update, Reset etc. we have 3 main settings sections:
Network section - here you can set IP address, Netmask, Gateway Address, chose between Static or DHCP IP configuration and also set DNS server.
Serial Settings - here you can configure Baud Rate, Data Bits, Stop Bits, Parity, Timeout and interface (RS-485/RS-232/RS-422) - I set RS-485. Baud rate should be the same as on all devices in your Modbus network (devices, connected to this specific gateway via RS-485 port).
Modbus Operating Settings - here we set operation mode (TCP_Master-RTU_Slaver), Max connection (it supports up to 32 connected devices), better to set real amount of connected devices to make polling faster. Local TCP port (default is 502), message timeout, ID mapping and Fixed ID Value (I don’t know what these last two stand for, so I left them as is).
Wellpro WP8028ADAM (8DI/8DO module)
First device that I connected to this gateway was Wellpro WP8028ADAM (8DI/8DO module). And about it I want to write here.
On WellPro’s page you can find User’s Manual and Software in English (direct link on the page - third one)
You can use any USB-to-RS-485 dongle (I used this) to play with their modules using this program (you can change outputs’ states using it, read inputs’ states, change device’s address and baud rate).
When baud rate is aligned on Volison Gateway and on the Input/Output module - we can wire them to each other via RS-485 and switch to OpenHab now (and don’t forget to connect Volison Gateway to your local home network ).
modbus.things configuration
For WellPro we need to setup 2 pollers (for inputs and outputs separately), wrapped by our modbus tcp thing config:
Bridge modbus:tcp:wellPro8028DiDo [ host="192.168.1.2", port=502, id=1 ] {
Bridge poller coils [ start=0, length=8, refresh=350, type="coil" ] {
Thing data DigitalOutput1 "Digital Output 1" [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
Thing data DigitalOutput2 "Digital Output 2" [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
Thing data DigitalOutput3 "Digital Output 3" [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
Thing data DigitalOutput4 "Digital Output 4" [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
Thing data DigitalOutput5 "Digital Output 5" [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
Thing data DigitalOutput6 "Digital Output 6" [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
Thing data DigitalOutput7 "Digital Output 7" [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
Thing data DigitalOutput8 "Digital Output 8" [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
}
Bridge poller discreteInputs [ start=0, length=8, refresh=1000, type="discrete" ] {
Thing data DigitalInput1 "Input 1" [ readStart="0", readValueType="bit" ]
Thing data DigitalInput2 "Input 2" [ readStart="1", readValueType="bit" ]
Thing data DigitalInput3 "Input 3" [ readStart="2", readValueType="bit" ]
Thing data DigitalInput4 "Input 4" [ readStart="3", readValueType="bit" ]
Thing data DigitalInput5 "Input 5" [ readStart="4", readValueType="bit" ]
Thing data DigitalInput6 "Input 6" [ readStart="5", readValueType="bit" ]
Thing data DigitalInput7 "Input 7" [ readStart="6", readValueType="bit" ]
Thing data DigitalInput8 "Input 8" [ readStart="7", readValueType="bit" ]
}
}
Outer Bridge has following parameters:
“wellPro8028DiDo” - name of thing, can be any, but it will be used in the *.items config;
“host” - local IP address of 5850G;
“port” - port of 5850G;
“id” - address of our WellPro Input/Output module (default is 1, but you need to set it on all modbus devices if you use more than one)
First inner Bridge works in both read and write mode - can read state of outputs and change them. I set refresh here to ~1/3 of a second.
Second inner Bridge is read only - it reads the state of inputs and change it. I set refresh here to 1 second.
wellpro.items configuration
Switch DigitalOutput1 "Digital Output 1 [%d]" <switch> { channel="modbus:data:wellPro8028DiDo:coils:DigitalOutput1:switch" }
Switch DigitalOutput2 "Digital Output 2 [%d]" <switch> { channel="modbus:data:wellPro8028DiDo:coils:DigitalOutput2:switch" }
Switch DigitalOutput3 "Digital Output 3 [%d]" <switch> { channel="modbus:data:wellPro8028DiDo:coils:DigitalOutput3:switch" }
Switch DigitalOutput4 "Digital Output 4 [%d]" <switch> { channel="modbus:data:wellPro8028DiDo:coils:DigitalOutput4:switch" }
Switch DigitalOutput5 "Digital Output 5 [%d]" <switch> { channel="modbus:data:wellPro8028DiDo:coils:DigitalOutput5:switch" }
Switch DigitalOutput6 "Digital Output 6 [%d]" <switch> { channel="modbus:data:wellPro8028DiDo:coils:DigitalOutput6:switch" }
Switch DigitalOutput7 "Digital Output 7 [%d]" <switch> { channel="modbus:data:wellPro8028DiDo:coils:DigitalOutput7:switch" }
Switch DigitalOutput8 "Digital Output 8 [%d]" <switch> { channel="modbus:data:wellPro8028DiDo:coils:DigitalOutput8:switch" }
Contact DigitalInput1 "Digital Input 1 [%d]" <door> { channel="modbus:data:wellPro8028DiDo:discreteInputs:DigitalInput1:contact" }
Contact DigitalInput2 "Digital Input 2 [%d]" <door> { channel="modbus:data:wellPro8028DiDo:discreteInputs:DigitalInput2:contact" }
Contact DigitalInput3 "Digital Input 3 [%d]" <door> { channel="modbus:data:wellPro8028DiDo:discreteInputs:DigitalInput3:contact" }
Contact DigitalInput4 "Digital Input 4 [%d]" <door> { channel="modbus:data:wellPro8028DiDo:discreteInputs:DigitalInput4:contact" }
Contact DigitalInput5 "Digital Input 5 [%d]" <door> { channel="modbus:data:wellPro8028DiDo:discreteInputs:DigitalInput5:contact" }
Contact DigitalInput6 "Digital Input 6 [%d]" <door> { channel="modbus:data:wellPro8028DiDo:discreteInputs:DigitalInput6:contact" }
Contact DigitalInput7 "Digital Input 7 [%d]" <door> { channel="modbus:data:wellPro8028DiDo:discreteInputs:DigitalInput7:contact" }
Contact DigitalInput8 "Digital Input 8 [%d]" <door> { channel="modbus:data:wellPro8028DiDo:discreteInputs:DigitalInput8:contact" }
Here everything is pretty clear I believe.
Sitemap
Frame label="Modbus" {
Text label="Inputs" icon="door" {
Text item=DigitalInput1
Text item=DigitalInput2
Text item=DigitalInput3
Text item=DigitalInput4
Text item=DigitalInput5
Text item=DigitalInput6
Text item=DigitalInput7
Text item=DigitalInput8
}
Text label="Outputs" icon="switch" {
Switch item=DigitalOutput1
Switch item=DigitalOutput2
Switch item=DigitalOutput3
Switch item=DigitalOutput4
Switch item=DigitalOutput5
Switch item=DigitalOutput6
Switch item=DigitalOutput7
Switch item=DigitalOutput8
}
}
Next two parts will be about WellPro Relay module (WP8025ADAM) and Eastron SDM230 Energy Meter if someone needs this kind of examples. I post this one because I was not familiar with Modbus and with OpenHab Modbus binding 2 configuration and each new device was a challenge for me so I really needed this kind of info but found only some pieces.