2x uart ld 2410 sensor on one esp32

Hello,
does anyone have this option installed? are you using two uart ld2410 sensors on one esp32?
can you please show your yaml?
I need to know exactly how to make it work. Ideally with the possibility to edit the parameters of both ld2410.
Thank you very much

Use different pins.
And remember that ESP32- S3 might only have 2 hardware UARTs, where ESP32-S2 have 3.
One is used for the logger, so if you do not disable the logger, then one of your extra UARTs might be a software one, which is prone to data loss at high speed connections.

But I need to see the yaml. that I have to use other pins is perhaps clear

Post your YAML of your first UART setup.

esphome:
  name: esp32-senzore-kupelna
  friendly_name: esp32 senzore kupelna

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  encryption:
    key: "xfL2UtWhRsGnXDLLRuNDLsoMjXfidy8j6zpDcvKmiHY="

ota:
  password: "c8f85f0ab8019c82b31cc00efe2e2a29"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:

i2c:
  sda: GPIO22
  scl: GPIO21
  scan: true
  id: bus_a

sensor:
  - platform: bme280_i2c
    temperature:
      name: "kupelna teplota"
      id: teplota_1
      oversampling: 1x
    pressure:
      name: "kupelna tlak"
      id: tlak_1
      filters:
        - calibrate_linear:
          # Map 0.0 (from sensor) to 0.0 (true value)
            - 0.0 -> 0.0
            - 972.4 -> 1017.4
    humidity:
      name: "kupelna vlhkost"
      id: vlhkost_1
    address: 0x76
    update_interval: 1s

  - platform: ld2410
    
    still_distance:
      name: "Still Distance (cm)"
   
    still_energy:
      name: "Still Energy (%)"
    
uart:
  id: ld2410_uart
  tx_pin: GPIO16
  rx_pin: GPIO17
  baud_rate: 256000
  parity: NONE
  stop_bits: 1
 
ld2410:
  uart_id: ld2410_uart
  throttle: 1500ms
  id: ld2410_comp
 
select:
  - platform: ld2410
    distance_resolution:
      name: distance resolution
    baud_rate:
      name: baud rate
    light_function:
      name: light function
 
button:
  - platform: ld2410
    factory_reset:
      name: "factory reset"
  - platform: restart
    name: "Restart"
   
 
number:
  - platform: ld2410
    timeout:
      name: timeout
    max_move_distance_gate:
      name: max move distance gate
    max_still_distance_gate:
      name: max still distance gate
    g0:
      move_threshold:
        name: g0 move threshold
      still_threshold:
        name: g0 still threshold
    g1:
      move_threshold:
        name: g1 move threshold
      still_threshold:
        name: g1 still threshold
    g2:
      move_threshold:
        name: g2 move threshold
      still_threshold:
        name: g2 still threshold
    g3:
      move_threshold:
        name: g3 move threshold
      still_threshold:
        name: g3 still threshold
    g4:
      move_threshold:
        name: g4 move threshold
      still_threshold:
        name: g4 still threshold
    g5:
      move_threshold:
        name: g5 move threshold
      still_threshold:
        name: g5 still threshold
    g6:
      move_threshold:
        name: g6 move threshold
      still_threshold:
        name: g6 still threshold
    g7:
      move_threshold:
        name: g7 move threshold
      still_threshold:
        name: g7 still threshold
    g8:
      move_threshold:
        name: g8 move threshold
      still_threshold:
        name: g8 still threshold
    light_threshold:
      name: light threshold
 
 
switch:
  - platform: ld2410
    engineering_mode:
      name: "engineering mode"
    bluetooth:
      name: control Bluetooth

binary_sensor:
 
  - platform: ld2410
    has_target:
      name: Pritomnost kupelna
    has_still_target:
      name: Still Target

First you need to research your board a bit.
A pinout description and picture is a good thing, because that will tell you what pins are available to use.
If you can find a description with what pins are floating or have weird behavior at boot, then it would be great too, like this one: ESP32 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials

Once you have that, then you need to select RX and TX pins for the extra LD2410.
When those are selected then you need to state ids in the different sections, so ESPHome knows which one to use.

uart:
  - id: ld2410_uart
    tx_pin: GPIO16
    rx_pin: GPIO17
    baud_rate: 256000
    parity: NONE
    stop_bits: 1
  - id: ld2410_uart_2
    tx_pin: GPIO14
    rx_pin: GPIO15
    baud_rate: 256000
    parity: NONE
    stop_bits: 1
 
ld2410:
  - id: ld2410_comp
    uart_id: ld2410_uart
    throttle: 1500ms
  - id: ld2410_comp_2
    uart_id: ld2410_uart_2
    throttle: 1500ms
    
 
select:
  - platform: ld2410
    ld2410_id: ld2410_comp
    distance_resolution:
      name: distance resolution
    baud_rate:
      name: baud rate
    light_function:
      name: light function
  - platform: ld2410
    ld2410_id: ld2410_comp_2
    distance_resolution:
      name: distance resolution
    baud_rate:
      name: baud rate
    light_function:
      name: light function

Here the uart, ld2410 and a select section have been set up. You need to add the ld2410_id entry to all your other references to the ld2410 and then doublicate it and rename that ld2410_id entry for one of them to get your double.

BEWARE! The pins I set for uart_2 is just some random ones. I do not know if they work, so do the search on the net for your board.

this is exactly what I needed to know. Thank you for your help. I’ll try it and see if it works

hi, so I tried it, but your suggestion doesn’t work. Please send me your yaml, let me try to edit it. Thank you.

I do not have have those sensors set up through UART.
You can get my UART set up from my Onkyo Amp, but it is only the UART setup I need for that.

okay, stick it up :smiley:

This is my use of UART.

api:
  encryption:
    key: !secret api_key
  services:
    - service: write
      variables:
        command: string
      then:
        - uart.write:
            id: uart_onkyo
            data: !lambda |-
              std::string str = command;
              std::vector<uint8_t> vec(str.begin(), str.end());
              return vec;

uart:
  - id: uart_onkyo
    baud_rate: 9600
    data_bits: 8
    stop_bits: 1
    parity: NONE
    rx_buffer_size: 512
    tx_pin:
      number: GPIO18
      inverted: false
    rx_pin:
      number: GPIO17
      inverted: false
    debug:
      direction: RX
      dummy_receiver: true
      after:
        delimiter: "\r"
      sequence:
        - lambda: |-
            UARTDebug::log_string(direction, bytes);
            std::string str(bytes.begin(), bytes.end());
            id(rawString).publish_state(str.c_str());

text_sensor:
  - platform: template
    name: "Response"
    icon: mdi:audio-video
    id: "rawString"