LD2410 mmWave sensor no longer recognised in ESPHome

Thanks for that.

I don’t know how to make it work since the update. Is it a change in the ESP32’s YAML code or something else?

Are there any examples I can see?

Thanks

the documentation is quite extensive :page_with_curl:

I’m still stymied. This was my original YAML that worked until the ESPHome update:

esphome:
  name: esphome-web-2036d8
  friendly_name: bedroom 2410 radar
  platform: ESP32
  board: esp32dev
 
external_components:
  - source: github://esphome/esphome@dev
    components: [ ld2410 ]
 
# Enable logging
logger:
  level: WARN
  baud_rate: 0
 
# Enable Home Assistant API
api:
  encryption:
    key: "a07N3I4rZLHvaRcCk4/OqXTU4Gly8xFlRmFwWZx8j6w="
 
ota:
  
 
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
 
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-2036D8"
    password: "jod88CYZMRZ2"
 
uart:
  id: uart01
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 256000
  parity: NONE
  stop_bits: 1
 
ld2410:
  timeout: 10s
  max_move_distance : 6m
  max_still_distance: 6m
  g0_move_threshold: 50
  g0_still_threshold: 20
  g1_move_threshold: 50
  g1_still_threshold: 20
  g2_move_threshold: 40
  g2_still_threshold: 20
  g3_move_threshold: 30
  g3_still_threshold: 20
  g4_move_threshold: 30
  g4_still_threshold: 20
  g5_move_threshold: 20
  g5_still_threshold: 20
  g6_move_threshold: 20
  g6_still_threshold: 20
  g7_move_threshold: 40
  g7_still_threshold: 30
  g8_move_threshold: 40
  g8_still_threshold: 30
 
binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target
 
sensor:
  - platform: ld2410
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance
     

What do I need to change to make it work?

what do the log(s) say why it doesn’t work?

The documentation linked above has the code there to get it to work. Replace your YAML code sections with the example in the documentation.
With the update, all the configuration is now done in HA and not in the ESPHome code so all the gate thresholds are defined differently and in the following format now:

sensor:
  - platform: ld2410
    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

number:
  - platform: ld2410
    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

and so on.

You should also try using the search function on this forum. There is a long thread with extensive information on the LD2410 sensor with ESPHome:

1 Like

Many thanks for your reply.

You’ll have to forgive my ignorance, if possible!

Do you mean that the 2410 is now configured in configuration.yaml instead of the ESPHome yaml?

Either way, I can’t figure out how the code should be formatted. I’ve tried replacing blocks of code as suggested, but keep getting errors. I could really use a walk through.

My apologies if I’ve violated the Helpdesk dictum, but I’ve seen hundreds of posts on this forum that do seem to ask for code examples. In fact, I cobbled together the original code in my example and shared it to others here.

I’ve been using HA for years now, but I am still only at an intermediate level as far as coding goes. Any and all help is greatly appreciated.

You really missed it totally :man_facepalming:

How to help us help you - or How to ask a good question

Before we begin…

This forum is not a helpdesk

The people here don’t work for Home Assistant, that’s an open source project. We are volunteering our free time to help others. Not all topics may get an answer, never mind one that helps you solve your problem.

image

Thanks for your help.

Not.

No the configuration is now done from the Home Assistant UI. Once setup you no longer need to edit any YAML code for configuration.

I have replaced the sections of your YAML with the code snippets from the LD2410 documentation page.

Next time, if you are requesting for help, please also post the errors that you are getting and others can help you understand what the problem is and how to fix it. Spacing in YAML is very important and most issues are often due to formatting with incorrect spacing.

Try the following:

esphome:
  name: esphome-web-2036d8
  friendly_name: bedroom 2410 radar
  platform: ESP32
  board: esp32dev
 
# Enable logging
logger:
  level: WARN
  baud_rate: 0
 
# Enable Home Assistant API
api:
  encryption:
    key: "a07N3I4rZLHvaRcCk4/OqXTU4Gly8xFlRmFwWZx8j6w="
 
ota:
  
 
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
 
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-2036D8"
    password: "jod88CYZMRZ2"
 
uart:
  id: uart01
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  uart_id: uart01
  id: ld2410_comp
 
binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target
 
sensor:
  - platform: ld2410
    light:
      name: light
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance
    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

switch:
  - platform: ld2410
    engineering_mode:
      name: "engineering mode"
    bluetooth:
      name: "control bluetooth"

number:
  - platform: ld2410
    timeout:
      name: timeout
    light_threshold:
      name: light threshold
    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

button:
  - platform: ld2410
    factory_reset:
      name: "factory reset"
    restart:
      name: "restart"
    query_params:
      name: query params

text_sensor:
  - platform: ld2410
    version:
      name: "firmware version"
    mac_address:
      name: "mac address"

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
2 Likes

Thank you so much for this. And thanks for your patience and understanding.

I’ve managed to flash it to the ESP32 and it is now in ESPHome.

Unfortunately, the entities are reporting ‘Unknown’. Don’t know why.

I think this is the relevant bit of the log:

    "documentation": "https://www.home-assistant.io/integrations/esphome",
    "integration_type": "device",
    "iot_class": "local_push",
    "loggers": [
      "aioesphomeapi",
      "noiseprotocol"
    ],
    "requirements": [
      "async_interrupt==1.1.1",
      "aioesphomeapi==16.0.5",
      "bluetooth-data-tools==1.11.0",
      "esphome-dashboard-api==1.2.3"
    ],
    "zeroconf": [
      "_esphomelib._tcp.local."
    ],
    "is_built_in": true
  },
  "data": {
    "config": {
      "entry_id": "b9fd702b513ec886539f71315d3a5257",
      "version": 1,
      "domain": "esphome",
      "title": "bedroom 2410 radar",
      "data": {
        "host": "192.168.0.127",
        "port": 6053,
        "password": "",
        "noise_psk": "**REDACTED**",
        "device_name": "esphome-web-2036d8"
      },
      "options": {
        "allow_service_calls": true
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "30:c6:f7:20:36:d8",
      "disabled_by": null
    },
    "storage_data": {
      "device_info": {
        "uses_password": false,
        "name": "esphome-web-2036d8",
        "friendly_name": "bedroom 2410 radar",
        "mac_address": "**REDACTED**",
        "compilation_time": "Sep 23 2023, 10:31:53",
        "model": "esp32dev",
        "manufacturer": "Espressif",
        "has_deep_sleep": false,
        "esphome_version": "2023.8.3",
        "project_name": "",
        "project_version": "",
        "webserver_port": 0,
        "voice_assistant_version": 0,
        "legacy_bluetooth_proxy_version": 0,
        "bluetooth_proxy_feature_flags": 0
      },
      "services": [],
      "api_version": {
        "major": 1,
        "minor": 9
      },
      "select": [
        {
          "object_id": "distance_resolution",
          "key": 2407818581,
          "name": "distance resolution",
          "unique_id": "esphome-web-2036d8selectdistance_resolution",
          "disabled_by_default": false,
          "icon": "mdi:ruler",
          "entity_category": 1,
          "options": [
            "0.2m",
            "0.75m"
          ]
        },
        {
          "object_id": "out_pin_level",
          "key": 3000056664,
          "name": "out pin level",
          "unique_id": "esphome-web-2036d8selectout_pin_level",
          "disabled_by_default": false,
          "icon": "mdi:scale",
          "entity_category": 1,
          "options": [
            "low",
            "high"
          ]
        },
        {
          "object_id": "light_function",
          "key": 1120099778,
          "name": "light function",
          "unique_id": "esphome-web-2036d8selectlight_function",
          "disabled_by_default": false,
          "icon": "mdi:lightbulb",
          "entity_category": 1,
          "options": [
            "off",
            "below",
            "above"
          ]
        },
        {
          "object_id": "baud_rate",
          "key": 1943701202,
          "name": "baud rate",
          "unique_id": "esphome-web-2036d8selectbaud_rate",
          "disabled_by_default": false,
          "icon": "mdi:thermometer",
          "entity_category": 1,
          "options": [
            "9600",
            "19200",
            "38400",
            "57600",
            "115200",
            "230400",
            "256000",
            "460800"
          ]
        }
      ],
      "number": [
        {
          "object_id": "timeout",
          "key": 4043259814,
          "name": "timeout",
          "unique_id": "esphome-web-2036d8numbertimeout",
          "disabled_by_default": false,
          "icon": "mdi:timelapse",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 65535.0,
          "step": 1.0,
          "unit_of_measurement": "s",
          "mode": 0,
          "device_class": ""
        },
        {
          "object_id": "max_move_distance_gate",
          "key": 1163595883,
          "name": "max move distance gate",
          "unique_id": "esphome-web-2036d8numbermax_move_distance_gate",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 2.0,
          "max_value": 8.0,
          "step": 1.0,
          "unit_of_measurement": "",
          "mode": 0,
          "device_class": "distance"
        },
        {
          "object_id": "max_still_distance_gate",
          "key": 233155630,
          "name": "max still distance gate",
          "unique_id": "esphome-web-2036d8numbermax_still_distance_gate",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 2.0,
          "max_value": 8.0,
          "step": 1.0,
          "unit_of_measurement": "",
          "mode": 0,
          "device_class": "distance"
        },
        {
          "object_id": "light_threshold",
          "key": 2564962383,
          "name": "light threshold",
          "unique_id": "esphome-web-2036d8numberlight_threshold",
          "disabled_by_default": false,
          "icon": "mdi:lightbulb",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 255.0,
          "step": 1.0,
          "unit_of_measurement": "",
          "mode": 0,
          "device_class": "illuminance"
        },
        {
          "object_id": "g0_move_threshold",
          "key": 1835011868,
          "name": "g0 move threshold",
          "unique_id": "esphome-web-2036d8numberg0_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g0_still_threshold",
          "key": 1032039703,
          "name": "g0 still threshold",
          "unique_id": "esphome-web-2036d8numberg0_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g1_move_threshold",
          "key": 1165436303,
          "name": "g1 move threshold",
          "unique_id": "esphome-web-2036d8numberg1_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g1_still_threshold",
          "key": 2500793650,
          "name": "g1 still threshold",
          "unique_id": "esphome-web-2036d8numberg1_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g2_move_threshold",
          "key": 1062193294,
          "name": "g2 move threshold",
          "unique_id": "esphome-web-2036d8numberg2_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g2_still_threshold",
          "key": 68806113,
          "name": "g2 still threshold",
          "unique_id": "esphome-web-2036d8numberg2_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g3_move_threshold",
          "key": 1062296601,
          "name": "g3 move threshold",
          "unique_id": "esphome-web-2036d8numberg3_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g3_still_threshold",
          "key": 1864033532,
          "name": "g3 still threshold",
          "unique_id": "esphome-web-2036d8numberg3_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g4_move_threshold",
          "key": 1920654816,
          "name": "g4 move threshold",
          "unique_id": "esphome-web-2036d8numberg4_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g4_still_threshold",
          "key": 1484134091,
          "name": "g4 still threshold",
          "unique_id": "esphome-web-2036d8numberg4_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g5_move_threshold",
          "key": 4089395667,
          "name": "g5 move threshold",
          "unique_id": "esphome-web-2036d8numberg5_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g5_still_threshold",
          "key": 2478568102,
          "name": "g5 still threshold",
          "unique_id": "esphome-web-2036d8numberg5_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g6_move_threshold",
          "key": 323894082,
          "name": "g6 move threshold",
          "unique_id": "esphome-web-2036d8numberg6_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g6_still_threshold",
          "key": 1255051861,
          "name": "g6 still threshold",
          "unique_id": "esphome-web-2036d8numberg6_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g7_move_threshold",
          "key": 684400093,
          "name": "g7 move threshold",
          "unique_id": "esphome-web-2036d8numberg7_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g7_still_threshold",
          "key": 3119422736,
          "name": "g7 still threshold",
          "unique_id": "esphome-web-2036d8numberg7_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g8_move_threshold",
          "key": 2425154948,
          "name": "g8 move threshold",
          "unique_id": "esphome-web-2036d8numberg8_move_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        },
        {
          "object_id": "g8_still_threshold",
          "key": 463099071,
          "name": "g8 still threshold",
          "unique_id": "esphome-web-2036d8numberg8_still_threshold",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 1,
          "min_value": 0.0,
          "max_value": 100.0,
          "step": 1.0,
          "unit_of_measurement": "%",
          "mode": 0,
          "device_class": "signal_strength"
        }
      ],
      "button": [
        {
          "object_id": "factory_reset",
          "key": 3740619177,
          "name": "factory reset",
          "unique_id": "esphome-web-2036d8buttonfactory_reset",
          "disabled_by_default": false,
          "icon": "mdi:restart-alert",
          "entity_category": 1,
          "device_class": "restart"
        },
        {
          "object_id": "restart",
          "key": 1203400786,
          "name": "restart",
          "unique_id": "esphome-web-2036d8buttonrestart",
          "disabled_by_default": false,
          "icon": "mdi:restart",
          "entity_category": 2,
          "device_class": "restart"
        },
        {
          "object_id": "query_params",
          "key": 4213001148,
          "name": "query params",
          "unique_id": "esphome-web-2036d8buttonquery_params",
          "disabled_by_default": false,
          "icon": "mdi:database",
          "entity_category": 2,
          "device_class": ""
        }
      ],
      "binary_sensor": [
        {
          "object_id": "presence",
          "key": 978369850,
          "name": "Presence",
          "unique_id": "esphome-web-2036d8binary_sensorpresence",
          "disabled_by_default": false,
          "icon": "mdi:account",
          "entity_category": 0,
          "device_class": "occupancy",
          "is_status_binary_sensor": false
        },
        {
          "object_id": "moving_target",
          "key": 374282329,
          "name": "Moving Target",
          "unique_id": "esphome-web-2036d8binary_sensormoving_target",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 0,
          "device_class": "motion",
          "is_status_binary_sensor": false
        },
        {
          "object_id": "still_target",
          "key": 4116807735,
          "name": "Still Target",
          "unique_id": "esphome-web-2036d8binary_sensorstill_target",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 0,
          "device_class": "occupancy",
          "is_status_binary_sensor": false
        }
      ],
      "sensor": [
        {
          "object_id": "moving_distance",
          "key": 1233208219,
          "name": "Moving Distance",
          "unique_id": "esphome-web-2036d8sensormoving_distance",
          "disabled_by_default": false,
          "icon": "mdi:signal-distance-variant",
          "entity_category": 0,
          "device_class": "distance",
          "unit_of_measurement": "cm",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "still_distance",
          "key": 106864333,
          "name": "Still Distance",
          "unique_id": "esphome-web-2036d8sensorstill_distance",
          "disabled_by_default": false,
          "icon": "mdi:signal-distance-variant",
          "entity_category": 0,
          "device_class": "distance",
          "unit_of_measurement": "cm",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "move_energy",
          "key": 2548343533,
          "name": "Move Energy",
          "unique_id": "esphome-web-2036d8sensormove_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 0,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "still_energy",
          "key": 802281200,
          "name": "Still Energy",
          "unique_id": "esphome-web-2036d8sensorstill_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 0,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "light",
          "key": 1935470627,
          "name": "light",
          "unique_id": "esphome-web-2036d8sensorlight",
          "disabled_by_default": false,
          "icon": "mdi:lightbulb",
          "entity_category": 2,
          "device_class": "illuminance",
          "unit_of_measurement": "",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "detection_distance",
          "key": 313650660,
          "name": "Detection Distance",
          "unique_id": "esphome-web-2036d8sensordetection_distance",
          "disabled_by_default": false,
          "icon": "mdi:signal-distance-variant",
          "entity_category": 0,
          "device_class": "distance",
          "unit_of_measurement": "cm",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g0_move_energy",
          "key": 3789804827,
          "name": "g0 move energy",
          "unique_id": "esphome-web-2036d8sensorg0_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g0_still_energy",
          "key": 345133782,
          "name": "g0 still energy",
          "unique_id": "esphome-web-2036d8sensorg0_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g1_move_energy",
          "key": 1355503966,
          "name": "g1 move energy",
          "unique_id": "esphome-web-2036d8sensorg1_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g1_still_energy",
          "key": 1657679485,
          "name": "g1 still energy",
          "unique_id": "esphome-web-2036d8sensorg1_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g2_move_energy",
          "key": 1824890105,
          "name": "g2 move energy",
          "unique_id": "esphome-web-2036d8sensorg2_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g2_still_energy",
          "key": 1587645436,
          "name": "g2 still energy",
          "unique_id": "esphome-web-2036d8sensorg2_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g3_move_energy",
          "key": 2362456900,
          "name": "g3 move energy",
          "unique_id": "esphome-web-2036d8sensorg3_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g3_still_energy",
          "key": 271987835,
          "name": "g3 still energy",
          "unique_id": "esphome-web-2036d8sensorg3_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g4_move_energy",
          "key": 3035157695,
          "name": "g4 move energy",
          "unique_id": "esphome-web-2036d8sensorg4_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g4_still_energy",
          "key": 339819194,
          "name": "g4 still energy",
          "unique_id": "esphome-web-2036d8sensorg4_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g5_move_energy",
          "key": 3940028850,
          "name": "g5 move energy",
          "unique_id": "esphome-web-2036d8sensorg5_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g5_still_energy",
          "key": 3749522305,
          "name": "g5 still energy",
          "unique_id": "esphome-web-2036d8sensorg5_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g6_move_energy",
          "key": 3684743309,
          "name": "g6 move energy",
          "unique_id": "esphome-web-2036d8sensorg6_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g6_still_energy",
          "key": 4174630288,
          "name": "g6 still energy",
          "unique_id": "esphome-web-2036d8sensorg6_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g7_move_energy",
          "key": 3027576296,
          "name": "g7 move energy",
          "unique_id": "esphome-web-2036d8sensorg7_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g7_still_energy",
          "key": 2856783471,
          "name": "g7 still energy",
          "unique_id": "esphome-web-2036d8sensorg7_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g8_move_energy",
          "key": 797515603,
          "name": "g8 move energy",
          "unique_id": "esphome-web-2036d8sensorg8_move_energy",
          "disabled_by_default": false,
          "icon": "mdi:motion-sensor",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        },
        {
          "object_id": "g8_still_energy",
          "key": 1335491342,
          "name": "g8 still energy",
          "unique_id": "esphome-web-2036d8sensorg8_still_energy",
          "disabled_by_default": false,
          "icon": "mdi:flash",
          "entity_category": 2,
          "device_class": "",
          "unit_of_measurement": "%",
          "accuracy_decimals": 0,
          "force_update": false,
          "state_class": 0,
          "last_reset_type": 0
        }
      ],
      "text_sensor": [
        {
          "object_id": "firmware_version",
          "key": 1459297423,
          "name": "firmware version",
          "unique_id": "esphome-web-2036d8text_sensorfirmware_version",
          "disabled_by_default": false,
          "icon": "mdi:chip",
          "entity_category": 2
        },
        {
          "object_id": "mac_address",
          "key": 4039452215,
          "name": "mac address",
          "unique_id": "esphome-web-2036d8text_sensormac_address",
          "disabled_by_default": false,
          "icon": "mdi:bluetooth",
          "entity_category": 2
        }
      ],
      "switch": [
        {
          "object_id": "engineering_mode",
          "key": 2112689740,
          "name": "engineering mode",
          "unique_id": "esphome-web-2036d8switchengineering_mode",
          "disabled_by_default": false,
          "icon": "mdi:pulse",
          "entity_category": 1,
          "assumed_state": false,
          "device_class": "switch"
        },
        {
          "object_id": "control_bluetooth",
          "key": 2143053479,
          "name": "control bluetooth",
          "unique_id": "esphome-web-2036d8switchcontrol_bluetooth",
          "disabled_by_default": false,
          "icon": "mdi:bluetooth",
          "entity_category": 1,
          "assumed_state": false,
          "device_class": "switch"
        }
      ]
    },
    "dashboard": "5c53de3b_esphome"
  }
}

Are all the entities returning unknown or just the energy ones? The energy values are only sent if engineering mode is enabled.
Does anything change if you turn on engineering mode on the LD2410?
Can you connect to the LD2410 via bluetooth using the HLKRadarTool app on your phone to confirm that the LD2410 is working and detecting presence?

You can also try changing the esp framework to be type: esp-idf

Here is my YAML config. I’ve enabled bluetooth proxy and also added some extra functionality to turn on the on-board LED on my ESP32 board when there is either movement or presence detected and swithces to toggle that on or off.

substitutions:
  name: esp32-lounge-room

esphome:
  name: ${name}
  name_add_mac_suffix: false

debug:
  update_interval: 120s

api:
  services:
    - service: set_ld2410_bluetooth_password
      variables:
        password: string
      then:
        - bluetooth_password.set:
            id: ld2410_comp
            password: !lambda 'return password;'

ota:
#improv_serial:

logger:
  level: INFO
  baud_rate: 0

esp32:
  board: esp32dev
  framework:
    type: esp-idf

esp32_ble_tracker:
  scan_parameters:
    active: true

bluetooth_proxy:
  active: true
  cache_services: false

wifi:
  networks:
  - ssid: !secret wifi2_ssid
    password: !secret wifi2_password
    priority: 2
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
    priority: 1
  output_power: 10dB

uart:
  id: ld2410_uart
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  uart_id: ld2410_uart
  throttle: 1500ms
  id: ld2410_comp

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"

button:
  - platform: restart
    name: "ESP32 Restart"
  - platform: safe_mode
    name: "ESP32 Safe Mode Boot"
    entity_category: diagnostic
  - platform: ld2410
    factory_reset:
      name: "LD2410 Factory Reset"
      entity_category: diagnostic
    restart:
      name: "LD2410 Restart"
      entity_category: config
    query_params:
      name: "LD2410 query params"

switch:
  - platform: ld2410
    engineering_mode:
      name: "LD2410 Engineering Mode"
    bluetooth:
      name: "LD2410 Control Bluetooth"
  - platform: template
    name: "Movement LED"
    id: movementLED
    optimistic: True
  - platform: template
    name: "Presence LED"
    id: presenceLED
    optimistic: True

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"

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "ESP IP Address"
    ssid:
      name: "ESP Connected SSID"
    bssid:
      name: "ESP Connected BSSID"
    mac_address:
      name: "ESP Mac Wifi Address"
    scan_results:
      name: "ESP Latest Scan Results"
  - platform: ld2410
    version:
      name: "Presenece Sensor Version"
    mac_address:
      name: "Presenece Sensor Mac Address"

binary_sensor:
  - platform: status
    name: "ESP Status"
  - platform: ld2410
    has_target:
      name: "Presence"
      on_press:
        then:
          - if:
              condition:
                switch.is_on: presenceLED
              then:
                - light.turn_on: led
      on_release:
        then:
          - if:
              condition:
                switch.is_on: presenceLED
              then:
                - light.turn_off: led
    has_moving_target:
      name: "Moving Target"
      on_press:
        then:
          - if:
              condition:
                switch.is_on: movementLED
              then:
                - light.turn_on: led
      on_release:
        then:
          - if:
              condition:
                switch.is_on: movementLED
              then:
                - light.turn_off: led
    has_still_target:
      name: "Still Target"

output:
  - platform: ledc
    id: onboard_led
    pin:
      number: GPIO2
      inverted: false

light:
 - platform: monochromatic
   name: "Onboard LED"
   output: onboard_led
   id: led
   effects:
     - pulse:

sensor:
  - platform: debug
    free:
      name: "ESP Memory Free"
  - platform: internal_temperature
    name: "ESP Temperature"
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"
  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "%"
    entity_category: "diagnostic"
  - platform: uptime
    name: "ESP Uptime 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"

All the entities are Unknown. Enabling Engineering Mode makes no difference.

The HLK Radar Tool doesn’t find any devices. This is odd as I have another LD2410b which is just connected to power and is acting as a presence detector for Home Assistant via BLE. It is functioning perfectly and is really quick and reliable. It is working through the inbuilt Bluetooth on the NUC which runs my HA.

I originally tried connecting the problem 2410 via an ESP32 Bluetooth proxy, but it would drop out all the time. So I investigated and finally figured out how to connect it directly to the ESP32 as a sensor. That worked great until the ESPHome upgrade.

I also tried your suggestion of changing the framework to esp-idf. No joy.

I’ve tried copying bits of your YAML into mine, but most times it won’t compile.

I remember when I first patched together my then working YAML, that I had to try different names for the uart_id. Seems uart0 and uart1 are reserved. uart00 didn’t work, but uart01 did. I’ve tried now changing the uart names, but again, it doesn’t help.

It might be worth checking the wiring connections from the LD2410 to the ESP32 board. If it is not appearing in the HLKRadarTool app then it sounds like the LD2410 board is not receiving power and thus not actually working at all.

Even when connected via the ESP32 board, you should be able to connect via bluetooth to the LD2410 B/C boards (unless it is the LD2410A board which does not have bluetooth).

Thanks. I’ll check, but it was working flawlessly until the ESPHome upgrade. Also, it is being picked up by my router and ESPHome, so power must be getting to it.

Also, that doesn’t explain why the other, working 2410 is not being seen by the Radar Tool either.

They’re both 2410b.

Where did yoy get your code from in the first place?

I believe the Bluetooth on the LD2410 board can only have one active connection, so if HA is connected to it, then the HLKRadarTool app is not able to connect to it.

Your router would be picking up the ESP32 board and not the LD2410 board. You said that ESPHome has all the sensors as unknown so that would mean that ESPHome is not seeing the LD2410 board either.

So it is worth double checking the wiring and any soldering to make sure the LD2410 board is getting the 5v it needs

I cobbled it together from various places on the internet. Mainly from posts on this forum.

Took me a lot of trial and error to get it right.

But that is redundant now. The new YAML code is working!

Damn! You were right!!!

It’s working. Must have been a loose connection in the wiring.

I can’t tell you how grateful I am for your help and perseverance.

I’ve been using HA for years, but in some ways, I am still a noob. I’m always learning.

Many thanks again.

1 Like

Nice! Now mark his answer as the solution so others can benefit from it :slight_smile:

Glad to hear that you got it to work :smiley:

Everyone has to start somewhere and I was like you not that long ago. I have been using HA for quite some time but only got into using ESPHome towards the end of last year experimenting with Bluetooth Proxies. I then found out about the LD2410 sensor earlier this year and purchased a couple of them to see if I could make my own sensor by connecting them to my ESP32 boards that I have running as Bluetooth Proxies.

My suggestion to check the wiring was due to me experiencing a very similar situation that happened to me after re-positioning my unit. Due to my poor soldering skills, the power pin had disconnected and I lost connection to the LD2410.

Your situation was a little trickier as it occurred at the same time as a Breaking Change for the LD2410 sensor in ESPHome.

I learnt lots from the LD2410 Esphome tips thread that I had posted above and its worth going through it. Also, before updating either HA or ESPHome, do read the release notes carefully and especially pay attention to any ‘Breaking Changes’ that may apply to your setup and if there are any, spend some time learning about what they are and what changes are required before performing the upgrade.

That will save you lots of headache having to try to fix things that have broken and not know what to do to fix it. It much better to hold off on an update and learn what needs to be done first then the update will be much less painful. I also avoid ‘x.0’ releases as many releases also introduce bugs which are quickly fixed in the x.1 or x.2 release.