Datasheet for registers taken from github/roggmaeh/nilan-openhab
Another nice repository: github/nickma82/nilan_communication_bringup
Protocol Modbus (RTU mode)
Property | Value |
---|---|
Node address | Default 30, Address is selectable between 1 and 247 |
Device type CTS 602 is a Modbus slave | |
Baud rate | 19.200 |
Databits | 8 |
Stopbits | 1 |
Parity | Even |
Packet size | Max. 255 bytes |
The communication speed and parameter can not be changed.
Currently only holding and input registers are supported.
Function | Name | Description |
---|---|---|
03 | Read Holding Registers | Read one or more holding registers |
04 | Read Input Registers | Read one or more input registers |
16 | Preset Multiple Registers | Write one or more holding registers |
# pycts602api.py must be somewhere in PATH
from pycts602api import CTS602API
m = CTS602API('/dev/ttyUSB0') # change appropriately
data = m.get_realtime_data()
# print out humidity (%)
print data['humidity']['value']
# set bottom water temperature
m.set_water_bottom(20)