Smart Home Automation Forum
AIO connection rs485 modbus temperature humididty sensor - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-AIO (https://www.kincony.com/forum/forumdisplay.php?fid=46)
+--- Thread: AIO connection rs485 modbus temperature humididty sensor (/showthread.php?tid=4306)



AIO connection rs485 modbus temperature humididty sensor - Tolyanskiy - 02-13-2024

Hi! I have a problem with connect   CWT-TH03S Series RS485 temperature humidity sensor  to my   AIO board.    
This is my esphome code :

uart:
  id: mod_bus
  tx_pin: 33
  rx_pin: 32
  baud_rate: 9600
  stop_bits: 1
  parity: EVEN

 
modbus:
  id: modbus1
  uart_id: mod_bus
  send_wait_time: 200ms


modbus_controller:
  - id: temp_hum_meter
    modbus_id: modbus1
    address: 0x03
    update_interval: 5s


sensor:
  - platform: modbus_controller
    modbus_controller_id: temp_hum_meter
    name: "Temperature"
    id: modbus_temperature
    register_type: holding
    address: 0x00
    unit_of_measurement: "%rh"
    value_type: FP32
    accuracy_decimals: 1    
  - platform: modbus_controller
    modbus_controller_id: temp_hum_meter
    name: "Humifdity"
    id: modbus_humidity
    register_type: holding
    address: 0x01
    unit_of_measurement: "℃"
    value_type: FP32
    accuracy_decimals: 1


And in log file i have this errors

[W][modbus_controller:136]: Duplicate modbus command found: type=0x3 address=1 count=2
[20:30:21][D][modbus_controller:043]: Modbus command to device=3 register=0x01 countdown=0 no response received - removed from send queue

What i doing wrong? Please help.  

RS485 comunication parameters

20:2


RE: AIO connection rs485 modbus temperature humididty sensor - admin - 02-14-2024

do you want AIO work as "MASTER", your sensor work as "SLAVE"?


RE: AIO connection rs485 modbus temperature humididty sensor - Tolyanskiy - 02-14-2024

(02-14-2024, 01:12 AM)admin Wrote: do you want AIO work as "MASTER", your sensor work as "SLAVE"?

Yes AIO board - MASTER   Sensor - SLAVE

Previously, I changed the baud rate, which was by default 4800, to 9600. I also changed the default SLAVE address , which was by default 1 to 3. Therefore, I wrote these parameters in the code.