Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.33 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.33 KB

Python API for Nilan CTS602 ModBus

Datasheet for registers taken from github/roggmaeh/nilan-openhab

CTS602 documentation

Another nice repository: github/nickma82/nilan_communication_bringup

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.

Modbus functions

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

Example

# 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)