Posts: 10
Threads: 0
Joined: Jul 2022
Reputation:
0
I have a KinCony ESP32 Tuya IoT adapter module. Is there a library you would recommend to use as modbus_switch in home assistant? My aim is to use it as a gateway between home assistant and TUYA. Is it possible?
Posts: 6,393
Threads: 830
Joined: Oct 2020
Reputation:
158
can you draw a photo, what do you want to do? no any relay controller connected?
Posts: 10
Threads: 0
Joined: Jul 2022
Reputation:
0
There are 32 buttons on the KinCony ESP32 Tuya IoT adapter module that we can control from TUYA. I want to introduce them as Home assistanta modbus_switch. It will be as if the module has a virtual relay. When I open switch_1 from Modbus, I will see that it is opened from the TUYA application. The KinCony ESP32 Tuya IoT adapter module already has rs485 hardware. But I am trying to add the modbus code.
Posts: 6,393
Threads: 830
Joined: Oct 2020
Reputation:
158
do you want to use ESP32 tuya adapter connect to your own relay board by modbus protocol?
Posts: 6,393
Threads: 830
Joined: Oct 2020
Reputation:
158
ok, you need to modify ESP32 arduino code, replace KinCony's protocol with your board's.
Posts: 6,393
Threads: 830
Joined: Oct 2020
Reputation:
158
this need test, debug with your board.
Posts: 6
Threads: 1
Joined: Jul 2023
Reputation:
0
would this be a correct config with 4 A16 boards?
uart:
id: mbus
tx_pin: GPIO13
rx_pin: GPIO16
baud_rate: 9600
modbus:
id: modbus1
uart_id: mbus
send_wait_time: 200ms
modbus_controller_board2:
- id: a16-Board2
address: 1
modbus_id: modbus1
update_interval: 1s
modbus_controller_board3:
- id: a16-Board3
address: 2
modbus_id: modbus1
update_interval: 1s
modbus_controller_board4:
- id: a16-Board4
address: 3
modbus_id: modbus1
update_interval: 1s
switch:
- platform: modbus_controller_board2
name: 'modbus_board2-switch1'
address: 0 # 0:relay1 1:relay2 ......
register_type: coil
bitmask: 1c
....
switch:
- platform: modbus_controller_board2
name: 'modbus_board2-switch16'
address: 15 # 0:relay1 1:relay2 ......
register_type: coil
bitmask: 1
#Board 3
switch:
- platform: modbus_controller_board3
name: 'modbus_board3-switch1'
address: 0 # 0:relay1 1:relay2 ......
register_type: coil
bitmask: 1c
....
switch:
- platform: modbus_controller_board3
name: 'modbus_board3-switch16'
address: 15 # 0:relay1 1:relay2 ......
register_type: coil
bitmask: 1
#Board 4
switch:
- platform: modbus_controller_board4
name: 'modbus_board4-switch1'
address: 0 # 0:relay1 1:relay2 ......
register_type: coil
bitmask: 1c
....
switch:
- platform: modbus_controller_board4
name: 'modbus_board4-switch16'
address: 15 # 0:relay1 1:relay2 ......
register_type: coil
bitmask: 1