Help With ESP32/LD2410C

Can someone please tell me what I’ve gotten wrong in this code?

It’s a standard ESP32 WROOM I’m using and, using it as a BT proxy as well as trying to set up presence using an LD2410C based on the code here:

I can’t for the life of me work out where I’ve gone wrong after 2 hours staring at it! Everything shows up fine, just all entries show as “unavailable” or :unknown".

`substitutions:
name: “media-room-esp32”
friendly_name: Media Room ESP32
packages:
esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic/esp32-generic.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
api:
encryption:
key: ********************************=

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

captive_portal:
uart:
id: ld2410_uart
tx_pin: 32
rx_pin: 33
baud_rate: 256000
parity: NONE
stop_bits: 1

ld2410:
uart_id: ld2410_uart

select:

  • platform: ld2410
    distance_resolution:
    name: distance resolution
    baud_rate:
    name: baud rate
    light_function:
    name: light function
    out_pin_level:
    name: out pin level

button:

  • platform: ld2410
    factory_reset:
    name: “Reset”
    restart:
    name: “restart”
    query_params:
    name: query params

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

text_sensor:

  • platform: ld2410
    version:
    name: “presenece sensor version”
    mac_address:
    name: “presenece sensor mac address”

switch:

  • platform: ld2410
    engineering_mode:
    name: “engineering mode”
    bluetooth:
    name: control Bluetooth

sensor:

  • platform: ld2410
    moving_distance:
    name: “Moving distance (cm)”
    still_distance:
    name: “Still Distance (cm)”
    moving_energy:
    name: “Move Energy (%)”
    still_energy:
    name: “Still Energy (%)”
    detection_distance:
    name: “Distance Detection (cm)”
    g0:
    move_energy:
    name: g0 move energy
    still_energy:
    name: g0 still energy
    g1:
    move_energy:
    name: g1 move energy
    still_energy:
    name: g1 still energy
    g2:
    move_energy:
    name: g2 move energy
    still_energy:
    name: g2 still energy
    g3:
    move_energy:
    name: g3 move energy
    still_energy:
    name: g3 still energy
    g4:
    move_energy:
    name: g4 move energy
    still_energy:
    name: g4 still energy
    g5:
    move_energy:
    name: g5 move energy
    still_energy:
    name: g5 still energy
    g6:
    move_energy:
    name: g6 move energy
    still_energy:
    name: g6 still energy
    g7:
    move_energy:
    name: g7 move energy
    still_energy:
    name: g7 still energy
    g8:
    move_energy:
    name: g8 move energy
    still_energy:
    name: g8 still energy
    light:
    name: light

binary_sensor:

  • platform: ld2410
    has_target:
    name: Presence
    has_moving_target:
    name: Moving Target
    has_still_target:
    name: Still Target``
    type or paste code here

sorry, I thought Id’ done that.

substitutions:
  name: "media-room-esp32"
  friendly_name: Media Room ESP32
packages:
  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic/esp32-generic.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: w9wiAZmZ1mYtIMThFvzEUCijXRNYoN2g8ik9AHluzmE=

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

captive_portal:
uart:
  id: ld2410_uart
  tx_pin: 32
  rx_pin: 33
  baud_rate: 256000
  parity: NONE
  stop_bits: 1


ld2410:
  uart_id: ld2410_uart
 
select:
  - platform: ld2410
    distance_resolution:
      name: distance resolution
    baud_rate:
      name: baud rate
    light_function:
      name: light function
    out_pin_level:
      name: out pin level
 
button:
  - platform: ld2410
    factory_reset:
      name: "Reset"
    restart:
      name: "restart"
    query_params:
      name: query params
 
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
 
text_sensor:
  - platform: ld2410
    version:
      name: "presenece sensor version"
    mac_address:
      name: "presenece sensor mac address"
 
switch:
  - platform: ld2410
    engineering_mode:
      name: "engineering mode"
    bluetooth:
      name: control Bluetooth
 
sensor:
  - platform: ld2410
    moving_distance:
      name: "Moving distance (cm)"
    still_distance:
      name: "Still Distance (cm)"
    moving_energy:
      name: "Move Energy (%)"
    still_energy:
      name: "Still Energy (%)"
    detection_distance:
      name: "Distance Detection (cm)"
    g0:
      move_energy:
        name: g0 move energy
      still_energy:
        name: g0 still energy
    g1:
      move_energy:
        name: g1 move energy
      still_energy:
        name: g1 still energy
    g2:
      move_energy:
        name: g2 move energy
      still_energy:
        name: g2 still energy
    g3:
      move_energy:
        name: g3 move energy
      still_energy:
        name: g3 still energy
    g4:
      move_energy:
        name: g4 move energy
      still_energy:
        name: g4 still energy
    g5:
      move_energy:
        name: g5 move energy
      still_energy:
        name: g5 still energy
    g6:
      move_energy:
        name: g6 move energy
      still_energy:
        name: g6 still energy
    g7:
      move_energy:
        name: g7 move energy
      still_energy:
        name: g7 still energy
    g8:
      move_energy:
        name: g8 move energy
      still_energy:
        name: g8 still energy
    light:
      name: light
 
binary_sensor:
 
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target

So everything shows up but is unknown?
What ESP32 chip are you using exactly? (What board/make/brand) You might have the wrong pins.

1 Like

Thanks, you are correct, I changed the pins and it all sprung to life.

Typical, driving me nuts for hours and comes down a simple, silly error.

1 Like