Esphome daly_bms two devices on ESP32

I have two daly-bms connected to one ESP32
#1 at GPIO 1 and 3
#2 at GPIO 17 and 16

With my confugation I can reach one BMS. But how can I config the second BMS?
This is my current setup

captive_portal:

uart:
  - id: uart_0
    tx_pin: GPIO1
    rx_pin: GPIO3
    baud_rate: 9600
  - id: uart_1
    tx_pin: GPIO17
    rx_pin: GPIO16
    baud_rate: 9600

daly_bms:
  uart_id: uart_0
  update_interval: 60s

sensor:
  - platform: daly_bms
    voltage:
      name: "Battery Voltage"
    current:
      name: "Battery Current"
    battery_level:
      name: "Battery Level"
    max_cell_voltage:
      name: "Max Cell Voltage"
    max_cell_voltage_number:
      name: "Max Cell Voltage Number"
    min_cell_voltage:
      name: "Min Cell Voltage"
    min_cell_voltage_number:
      name: "Min Cell Voltage Number"
    max_temperature:
      name: "Max Temperature"
    max_temperature_probe_number:
      name: "Max Temperature Probe Number"
    min_temperature:
      name: "Min Temperature"
    min_temperature_probe_number:
      name: "Min Temperature Probe Number"
    remaining_capacity:
      name: "Remaining Capacity"
    cells_number:
      name: "Cells Number"
    temperature_1:
      name: "Temperature 1"
    temperature_2:
      name: "Temperature 2"

  - platform: pulse_counter
    pin: 12
    name: "SolarInPuls"

  - platform: pulse_counter
    pin: 13
    name: "SolarOutPuls"

Not 100% sure on this sensor but on a CT sensor I use multiples using UART you have to change the address of one of the modules and specify the address of each one here:

Have a look here, someone else has the same issue

My setup is different
I did connect the UART directly to the ESP32
If I use UART 1 I get the data from #1 BMS
If I setup YAML to use the other UART I get the data from the 2nd BMS.

But how to conf YAML and daly_bms to use both UARTs?

You need to change the address on the daly_bms and then use different addresses in the yaml. You specify the address in each daly_bms sensor config.
Not sure how you change the address but looking at the issue I posted above you need to run some software to change it.

Also have a search in the Esphome discord, there’s some posts about it

Thanks for the anwer but adresses has nothing to do in my setup

I am using 2 serial connections from the BSM’s to the ESP32
The ESP32 has two serial ports (UART0 and UART2)
It is not a NOT a RS485 bus - just two simple serial connection.

uart:
  - id: uart_0
    tx_pin: GPIO1
    rx_pin: GPIO3
    baud_rate: 9600
  - id: uart_1
    tx_pin: GPIO17
    rx_pin: GPIO16
    baud_rate: 9600

If I use this setup

daly_bms:
  uart_id: uart_0
  update_interval: 6

The sensor “- platform: daly_bms” is using the seria port uart_0 → Data from BMS1.
And with

daly_bms:
  uart_id: uart_2

I will see the data from BMS 2

Maybe it is not possible to setup daly_bms in YAML to support two BMS on different ports.
… than I will give up and use two ESP for this job.

OK gotcha, I found I have an esphome node that has 2 different devices using UART at the same time. I found a solution on here using modbus. No idea why or how it works but it does.

Only issue though is that there is no way to specify which one to use in the sensor: or binary_sensor: configs

uart:
  - id: uart_network_power
    tx_pin: GPIO1
    rx_pin: GPIO3
    baud_rate: 9600
    stop_bits: 1

  - id: uart_c02
    tx_pin: GPIO17
    rx_pin: GPIO16
    baud_rate: 9600
    stop_bits: 1
  
modbus:
  - id: mod_network_power
    uart_id: uart_network_power

sensor:
  - platform: mhz19
    id: mhz19_id
    uart_id: uart_c02
    co2:
      name: Workshop CO2
    update_interval: 10s
    automatic_baseline_calibration: false

  - platform: pzemac
    modbus_id: mod_network_power
    voltage:
      name: Network Rack Voltage
      unit_of_measurement: V
      icon: mdi:lightning-bolt-circle
    power:
      name: Network Rack Power
      unit_of_measurement: W
      icon: mdi:lightning-bolt-circle
      id: das_power
    update_interval: 5s


My solution is now to use a second ESP to control the second BMS.