Skip to content

vitbaisa/pycts602

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

A simple Python API for NILAN CT2 602 Modbus

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages