12-30-2023, 07:04 AM
Sorry I was misunderstood.
If 8 switches are defined on esphome side, everything works perfectly. The order is irrelevant, any 8 switches can be defined like: 1-2-9-10-11-12-13-14-15. It works perfectly.
The moment a 9th switch is defined, the following pairs start to malfunction: 1-9, 2-10, .....7-15, 8-16.
The flow when 16 switches are defined: switching 1st HA - 1st relay switch - 1st switch turns off in HA and 9th turns on. On relay board the 1st relay is still on.
The error may be somewhere on the esphome side, or I'm trying to use the wrong configuration:
switch:
- platform: modbus_controller
name: 'testsw1'
address: 0
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw2'
address: 1
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw3'
address: 2
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw4'
address: 3
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw5'
address: 4
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw6'
address: 5
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw7'
address: 6
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw8'
address: 7
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw9'
address: 8
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw10'
address: 9
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw11'
address: 10
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw12'
address: 11
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw13'
address: 12
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw14'
address: 13
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw15'
address: 14
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw16'
address: 15
register_type: coil
bitmask: 1
If 8 switches are defined on esphome side, everything works perfectly. The order is irrelevant, any 8 switches can be defined like: 1-2-9-10-11-12-13-14-15. It works perfectly.
The moment a 9th switch is defined, the following pairs start to malfunction: 1-9, 2-10, .....7-15, 8-16.
The flow when 16 switches are defined: switching 1st HA - 1st relay switch - 1st switch turns off in HA and 9th turns on. On relay board the 1st relay is still on.
The error may be somewhere on the esphome side, or I'm trying to use the wrong configuration:
switch:
- platform: modbus_controller
name: 'testsw1'
address: 0
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw2'
address: 1
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw3'
address: 2
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw4'
address: 3
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw5'
address: 4
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw6'
address: 5
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw7'
address: 6
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw8'
address: 7
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw9'
address: 8
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw10'
address: 9
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw11'
address: 10
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw12'
address: 11
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw13'
address: 12
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw14'
address: 13
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw15'
address: 14
register_type: coil
bitmask: 1
- platform: modbus_controller
name: 'testsw16'
address: 15
register_type: coil
bitmask: 1