Hi all
I've created modbus tcp binding - works as master. Just put attached jar to your addons folder and make changes to openhab.cfg and .items file. If somebaody could explain me how to share sources I will happily share it. Please find short description of the binding below.
Modbus binding allows to connect to multiple Modbus slaves as TCP master. This implementation works with coils (boolean values) only.
Entries in openhab config file should look like below.
Most of config parameters are related to specific slaves, the only exception is
modbustcpmaster:poll=<value>
which sets refresh interval to Modbus polling service. Value is in milliseconds - optional, default is 200
modbustcpmaster:<slave-name>:<slave-parameter>
<slave-name> is unique name per slave you are connecting to.
<slave-parameter> are pairs key=value
Valid keys are
host mandatory
port TCP port, optional, default 502
id slave id, optional, default 1
start slave start address, optional, default 0
length number of data item to read, default 0 (but set it to something meaningful :)
type data type, can be either "coil" or "register", now only "coil" is supported
Minimal construction in openhab.config will look like
modbustcpmaster:slave1.host=192.168.1.50
modbustcpmaster:slave1.length=10
modbustcpmaster:slave1.type=coil
connects to slave on ip=192.168.1.51 and reads 10 coils starting from address 0
More complex setup could look like
modbustcpmaster:slave1.host=192.168.1.50
modbustcpmaster:slave1.port=502
modbustcpmaster:slave1.id=41
modbustcpmaster:poll=300
modbustcpmaster:slave1.start=0
modbustcpmaster:slave1.length=32
modbustcpmaster:slave1.type=coil
ModbusBindingProvider provides binding for Openhab Items
There are two ways to bind an item to modbus coils/registers
1) single coil/register per item
Switch MySwitch "My Modbus Switch" (ALL) {modbustcpmaster="slave1:5"}
This binds MySwitch to modbus slave defined as "slave1" in openhab.config reading/writing to the coil 5
2) separate coils for reading and writing
Switch MySwitch "My Modbus Switch" (ALL) {modbustcpmaster="slave1:<6:>7"}
In this case coil 6 is used as status coil (readonly) and commands are put to coil 7 by setting coil 7 to true.
You hardware should then set coil 7 back to false to allow further commands processing.
I've created modbus tcp binding - works as master. Just put attached jar to your addons folder and make changes to openhab.cfg and .items file. If somebaody could explain me how to share sources I will happily share it.
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/7MF-9DwhHG0J.
Is yet planned the release date?
Hi all
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/J86b-lnnrs0J.
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.