Last active
March 28, 2024 18:14
-
-
Save RafaelKa/099fb28fd0adb60f5508912e29ccbaae to your computer and use it in GitHub Desktop.
OpenHab : WAVESHARE Modbus RTU Relay 16CH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WAVESHARE Modbus RTU Relay 16CH : OpenHab : items | |
Switch RTU_16CH_01 "DC-Relay 01" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_01:switch"} | |
Switch RTU_16CH_02 "DC-Relay 02" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_02:switch"} | |
Switch RTU_16CH_03 "DC-Relay 03" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_03:switch"} | |
Switch RTU_16CH_04 "DC-Relay 04" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_04:switch"} | |
Switch RTU_16CH_05 "DC-Relay 05" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_05:switch"} | |
Switch RTU_16CH_06 "DC-Relay 06" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_06:switch"} | |
Switch RTU_16CH_07 "DC-Relay 07" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_07:switch"} | |
Switch RTU_16CH_08 "DC-Relay 08" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_08:switch"} | |
Switch RTU_16CH_09 "DC-Relay 09" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_09:switch"} | |
Switch RTU_16CH_10 "DC-Relay 10" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_10:switch"} | |
Switch RTU_16CH_11 "DC-Relay 11" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_11:switch"} | |
Switch RTU_16CH_12 "DC-Relay 12" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_12:switch"} | |
Switch RTU_16CH_13 "DC-Relay 13" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_13:switch"} | |
Switch RTU_16CH_14 "DC-Relay 14" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_14:switch"} | |
Switch RTU_16CH_15 "DC-Relay 15" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_15:switch"} | |
Switch RTU_16CH_16 "DC-Relay 16" <switch> {channel="modbus:data:RTU_16CH:RTU_16CH:Relay_16:switch"} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WAVESHARE Modbus RTU Relay 16CH : OpenHab : sitemap | |
sitemap debug16CH label="<WAVESHARE Modbus RTU Relay 16CH>" { | |
Frame label="WaveShare 16CH RTU relais" { | |
Switch item=RTU_16CH_01 label="Relay 01" icon="switch" | |
Switch item=RTU_16CH_02 label="Relay 02" icon="switch" | |
Switch item=RTU_16CH_03 label="Relay 03" icon="switch" | |
Switch item=RTU_16CH_04 label="Relay 04" icon="switch" | |
Switch item=RTU_16CH_05 label="Relay 05" icon="switch" | |
Switch item=RTU_16CH_06 label="Relay 06" icon="switch" | |
Switch item=RTU_16CH_07 label="Relay 07" icon="switch" | |
Switch item=RTU_16CH_08 label="Relay 08" icon="switch" | |
Switch item=RTU_16CH_09 label="Relay 09" icon="switch" | |
Switch item=RTU_16CH_10 label="Relay 10" icon="switch" | |
Switch item=RTU_16CH_11 label="Relay 11" icon="switch" | |
Switch item=RTU_16CH_12 label="Relay 12" icon="switch" | |
Switch item=RTU_16CH_13 label="Relay 13" icon="switch" | |
Switch item=RTU_16CH_14 label="Relay 14" icon="switch" | |
Switch item=RTU_16CH_15 label="Relay 15" icon="switch" | |
Switch item=RTU_16CH_16 label="Relay 16" icon="switch" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WAVESHARE Modbus RTU Relay 16CH : OpenHab : things | |
Bridge modbus:serial:RTU_16CH "RTU 16CH relays" [ id=1, port="/dev/ttyUSB0", baud=9600, stopBits="1.0", parity="none", dataBits=8, receiveTimeoutMillis=75, echo=false, encoding="rtu", timeBetweenTransactionsMillis="70", flowControlIn="none", flowControlOut="none", connectTimeoutMillis=1500, afterConnectionDelayMillis=0, enableDiscovery=false ] { | |
Bridge poller RTU_16CH "RTU 16CH relays :: poller" [start=0, length=16, refresh=1000, type="coil" ] { | |
Thing data Relay_01 "RTU 16CH relays :: 01" [ readStart="8", readValueType="bit", writeType="coil", writeStart="0", writeValueType="bit" ] | |
Thing data Relay_02 "RTU 16CH relays :: 02" [ readStart="9", readValueType="bit", writeType="coil", writeStart="1", writeValueType="bit" ] | |
Thing data Relay_03 "RTU 16CH relays :: 03" [ readStart="10", readValueType="bit", writeType="coil", writeStart="2", writeValueType="bit" ] | |
Thing data Relay_04 "RTU 16CH relays :: 04" [ readStart="11", readValueType="bit", writeType="coil", writeStart="3", writeValueType="bit" ] | |
Thing data Relay_05 "RTU 16CH relays :: 05" [ readStart="12", readValueType="bit", writeType="coil", writeStart="4", writeValueType="bit" ] | |
Thing data Relay_06 "RTU 16CH relays :: 06" [ readStart="13", readValueType="bit", writeType="coil", writeStart="5", writeValueType="bit" ] | |
Thing data Relay_07 "RTU 16CH relays :: 07" [ readStart="14", readValueType="bit", writeType="coil", writeStart="6", writeValueType="bit" ] | |
Thing data Relay_08 "RTU 16CH relays :: 08" [ readStart="15", readValueType="bit", writeType="coil", writeStart="7", writeValueType="bit" ] | |
Thing data Relay_09 "RTU 16CH relays :: 09" [ readStart="0", readValueType="bit", writeType="coil", writeStart="8", writeValueType="bit" ] | |
Thing data Relay_10 "RTU 16CH relays :: 10" [ readStart="1", readValueType="bit", writeType="coil", writeStart="9", writeValueType="bit" ] | |
Thing data Relay_11 "RTU 16CH relays :: 11" [ readStart="2", readValueType="bit", writeType="coil", writeStart="10", writeValueType="bit" ] | |
Thing data Relay_12 "RTU 16CH relays :: 12" [ readStart="3", readValueType="bit", writeType="coil", writeStart="11", writeValueType="bit" ] | |
Thing data Relay_13 "RTU 16CH relays :: 13" [ readStart="4", readValueType="bit", writeType="coil", writeStart="12", writeValueType="bit" ] | |
Thing data Relay_14 "RTU 16CH relays :: 14" [ readStart="5", readValueType="bit", writeType="coil", writeStart="13", writeValueType="bit" ] | |
Thing data Relay_15 "RTU 16CH relays :: 15" [ readStart="6", readValueType="bit", writeType="coil", writeStart="14", writeValueType="bit" ] | |
Thing data Relay_16 "RTU 16CH relays :: 16" [ readStart="7", readValueType="bit", writeType="coil", writeStart="15", writeValueType="bit" ] | |
} | |
} |
It is a bug in WaveShares firmware. The device behaves the same with Node Modbus serial.
https://github.com/yaacov/node-modbus-serial
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note:
There is trouble either on firmware of https://www.waveshare.com/wiki/Modbus_RTU_Relay_16CH or a bug on OpenHab.
The readStart differs from write writeStart, see from 1-8 and 8-16...