11-18-2024, 05:02 AM
I'd like to greet all the forum members. I’m reaching out to ask for your help with an issue I’m experiencing.
I connected 7 sensors to an RS485 Modbus bus, but only 4 of them work simultaneously. When I connect each sensor individually, they all respond correctly. However, when I try to initialize more than 4 sensors in the YAML configuration (e.g., 1-2-3-4), they are displayed and work fine. But as soon as I add more sensors (e.g., 5-6-7), some of them stop responding or are not displayed at all.
I am using an A16 with ESPHome integrated into Home Assistant.
...
uart:
- id: uart_modbus
tx_pin: GPIO13
rx_pin: GPIO16
baud_rate: 4800
modbus:
- uart_id: uart_modbus
setup_priority: -10
send_wait_time: 500 ms
id: modbus1
modbus_controller:
- id: modbus_sensor_2
address: 0x02
modbus_id: modbus1
update_interval: 5s
offline_skip_updates: 2
max_cmd_retries: 4
- id: modbus_sensor_4
address: 0x04
modbus_id: modbus1
update_interval: 5s
offline_skip_updates: 2
max_cmd_retries: 4
- id: modbus_sensor_7
address: 0x07
modbus_id: modbus1
update_interval: 5s
offline_skip_updates: 2
max_cmd_retries: 4
- id: modbus_sensor_8
address: 0x08
modbus_id: modbus1
update_interval: 5s
offline_skip_updates: 2
max_cmd_retries: 4
...
...
sensor:
- platform: modbus_controller
modbus_controller_id: modbus_sensor_2
name: "t_2"
id: temperature_sensor_2
address: 0x0001
register_type: holding
value_type: U_WORD
force_new_range: true
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_sensor_2
name: "h_2"
id: humidity_sensor_2
address: 0x0000
register_type: holding
value_type: U_WORD
unit_of_measurement: "%"
accuracy_decimals: 2
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_sensor_4
name: "t_4"
id: temperature_sensor_4
address: 0x0001
register_type: holding
value_type: U_WORD
force_new_range: true
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_sensor_4
name: "h_4"
id: humidity_sensor_4
address: 0x0000
register_type: holding
value_type: U_WORD
unit_of_measurement: "%"
accuracy_decimals: 2
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_sensor_7
name: "t_i"
id: temperature_sensor_7
address: 0x0001
register_type: holding
value_type: U_WORD
force_new_range: true
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
- lambda: |-
if (x > 32767) {
return (x - 65536) / 10.0;
} else {
return x / 10.0;
}
- platform: modbus_controller
modbus_controller_id: modbus_sensor_8
name: "t_k"
id: temperature_sensor_8
address: 0x0001
register_type: holding
value_type: U_WORD
force_new_range: true
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
- multiply: 0.1
...
I connected 7 sensors to an RS485 Modbus bus, but only 4 of them work simultaneously. When I connect each sensor individually, they all respond correctly. However, when I try to initialize more than 4 sensors in the YAML configuration (e.g., 1-2-3-4), they are displayed and work fine. But as soon as I add more sensors (e.g., 5-6-7), some of them stop responding or are not displayed at all.
I am using an A16 with ESPHome integrated into Home Assistant.
...
uart:
- id: uart_modbus
tx_pin: GPIO13
rx_pin: GPIO16
baud_rate: 4800
modbus:
- uart_id: uart_modbus
setup_priority: -10
send_wait_time: 500 ms
id: modbus1
modbus_controller:
- id: modbus_sensor_2
address: 0x02
modbus_id: modbus1
update_interval: 5s
offline_skip_updates: 2
max_cmd_retries: 4
- id: modbus_sensor_4
address: 0x04
modbus_id: modbus1
update_interval: 5s
offline_skip_updates: 2
max_cmd_retries: 4
- id: modbus_sensor_7
address: 0x07
modbus_id: modbus1
update_interval: 5s
offline_skip_updates: 2
max_cmd_retries: 4
- id: modbus_sensor_8
address: 0x08
modbus_id: modbus1
update_interval: 5s
offline_skip_updates: 2
max_cmd_retries: 4
...
...
sensor:
- platform: modbus_controller
modbus_controller_id: modbus_sensor_2
name: "t_2"
id: temperature_sensor_2
address: 0x0001
register_type: holding
value_type: U_WORD
force_new_range: true
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_sensor_2
name: "h_2"
id: humidity_sensor_2
address: 0x0000
register_type: holding
value_type: U_WORD
unit_of_measurement: "%"
accuracy_decimals: 2
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_sensor_4
name: "t_4"
id: temperature_sensor_4
address: 0x0001
register_type: holding
value_type: U_WORD
force_new_range: true
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_sensor_4
name: "h_4"
id: humidity_sensor_4
address: 0x0000
register_type: holding
value_type: U_WORD
unit_of_measurement: "%"
accuracy_decimals: 2
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_sensor_7
name: "t_i"
id: temperature_sensor_7
address: 0x0001
register_type: holding
value_type: U_WORD
force_new_range: true
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
- lambda: |-
if (x > 32767) {
return (x - 65536) / 10.0;
} else {
return x / 10.0;
}
- platform: modbus_controller
modbus_controller_id: modbus_sensor_8
name: "t_k"
id: temperature_sensor_8
address: 0x0001
register_type: holding
value_type: U_WORD
force_new_range: true
unit_of_measurement: "°C"
accuracy_decimals: 2
filters:
- multiply: 0.1
...