12-29-2023, 04:04 PM
Hi,
I would like to control my A16S board with modbus protocol. The controller is an ESP32 with esphome firmware. The switch part of the esphome config is as follows:
switch:
- platform: modbus_controller
name: 'testsw1'
address: 0
register_type: coil
bitmask: 1
…. to switch 8
- platform: modbus_controller
name: 'testsw8'
address: 7
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw9'
address: 8
register_type: coil
bitmask: 1
Everything works perfectly as long as only the first 8 switches are defined. However, if relay 9 is also configured, when it is switched on, the 9th relay switches but the status feedback comes back from the first relay (in esphome 1st relay on - 9th relay off ; on the relay board 9th relay on 1st off) and vice versa. How to program esphome so that it works correctly?
I would like to control my A16S board with modbus protocol. The controller is an ESP32 with esphome firmware. The switch part of the esphome config is as follows:
switch:
- platform: modbus_controller
name: 'testsw1'
address: 0
register_type: coil
bitmask: 1
…. to switch 8
- platform: modbus_controller
name: 'testsw8'
address: 7
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw9'
address: 8
register_type: coil
bitmask: 1
Everything works perfectly as long as only the first 8 switches are defined. However, if relay 9 is also configured, when it is switched on, the 9th relay switches but the status feedback comes back from the first relay (in esphome 1st relay on - 9th relay off ; on the relay board 9th relay on 1st off) and vice versa. How to program esphome so that it works correctly?