Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RS485 not receiving anything
#4
I have use KC868-A16 work with KC868-H32BS by RS485 cable via modbus.
   
   
I edit config files. mainly command at here:

uart:
  id: mbus
  tx_pin: GPIO13
  rx_pin: GPIO16
  baud_rate: 9600


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


modbus_controller:
- id: h32bs
  address: 1
  modbus_id: modbus1
  update_interval: 3s


switch:
  - platform: modbus_controller
    name: 'modbus-switch1'
    address: 0  # 0:relay1  1:relay2 ......
    register_type: coil
    bitmask: 1


.txt   ESPHome_A16_modbus_relay.txt (Size: 6.5 KB / Downloads: 227)

this is a demo , i have created one switch button in ESPHome, you can create many others.

H32BS use modbus command:
01 05 00 00 FF 00   turn on relay1
01 05 00 00 00 00   turn off relay1

make sure your relay board as these:
ON = 0xFF00 OFF=0000

if your relay board not use by this protocol. you can also write esphome as "write_lambda" way. i have tested, "write_lambda" to create switch also work fine. just need to create ON and OFF two command.
Reply


Messages In This Thread
RS485 not receiving anything - by victorclaessen - 03-28-2023, 03:53 PM
RE: RS485 not receiving anything - by admin - 03-29-2023, 12:20 AM
RE: RS485 not receiving anything - by admin - 03-31-2023, 04:55 AM
RE: RS485 not receiving anything - by admin - 03-31-2023, 01:21 PM
RE: RS485 not receiving anything - by admin - 03-31-2023, 02:11 PM
RE: RS485 not receiving anything - by admin - 04-11-2023, 01:24 PM
RE: RS485 not receiving anything - by admin - 04-12-2023, 06:19 AM
RE: RS485 not receiving anything - by admin - 04-19-2023, 12:54 AM
RE: RS485 not receiving anything - by admin - 04-20-2023, 06:34 AM
RE: RS485 not receiving anything - by admin - 05-01-2023, 11:45 AM
RE: RS485 not receiving anything - by Yocee - 01-14-2024, 03:35 PM
RE: RS485 not receiving anything - by aucirc - 10-06-2024, 03:36 PM
RE: RS485 not receiving anything - by admin - 10-07-2024, 01:10 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)