LD2410 not working over UART

Hi, I will write under this thread as I have a similar issue.
I am just starting my adventure with HA and I am building my first module based on Wemos D1 mini V4 and LD2410. After configuring everything I get all readings as ‘unknown’. I have ‘read the whole Internet’ and tried everything I found without any success. I have tested it on two different D1 minis and two different LD2410 and it is the same.
I would be greatful for any help as I am running out of ideas. :frowning:

My config:

esphome:
  name: czujnik-obecnosci-jadalnia
  friendly_name: Czujnik Obecności Jadalnia

esp8266:
  board: d1_mini

# Enable logging
logger:
  baud_rate: 0

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

ota:
  password: "##########"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
# Optional manual IP
  manual_ip:
    static_ip: 192.168.50.200
    gateway: 192.168.50.1
    subnet: 255.255.255.0

# Example configuration entry
uart:
  id: uart0
  tx_pin: TX
  rx_pin: RX
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  timeout: 150s
  max_move_distance : 6m
  max_still_distance: 0.75m
  g0_move_threshold: 10
  g0_still_threshold: 20
  g1_move_threshold: 10
  g1_still_threshold: 20
  g2_move_threshold: 20
  g2_still_threshold: 21
  g3_move_threshold: 30
  g3_still_threshold: 31
  g4_move_threshold: 40
  g4_still_threshold: 41
  g5_move_threshold: 50
  g5_still_threshold: 51
  g6_move_threshold: 60
  g6_still_threshold: 61
  g7_move_threshold: 70
  g7_still_threshold: 71
  g8_move_threshold: 80
  g8_still_threshold: 81

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

binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target


captive_portal:
    

No logs. Please post.

Have you tried using different pins? The default RX/TX pins on my D1 Minis do not work correctly with the LD2410s, but other pins do.

Is the HiLink a c3? having the same issues integrating into HA and using ESPHome.

AliExpress Kit link

I am using a LD2410C with UART directly go to usb port by a ch340 adapter, no ESP. It worked fine for 2-3 days then the state got stuck. A bluetooth connection and re-init device could make it work again. I tried to add a restart cmd each 10 mins but it didnt help.

can you please share your YAML when you only used the OUT pin?
Thank you

I had the same issue with two LD2410B. I’ve setup them using ESPHome on an ESP8266 connected to TX and RX (TX -RX, RX - TX). They both worked great for a week or less. Then, Still Energy and Still Target stopped working on Home Assistant, it’s always as zero. I feel that the other data is also bogus.

I’ve connected to the module using the app, tried restarting the module but it didn’t work. Can you explain how do you restart the radar like you said, please?

Thanks in advance.

Ok, I found out what I was doing wrong. Basically, the default settings from ESPHome page for LD2410 didn’t work for me, this is my settings for the sensor now:

ld2410:
  timeout: 10s
  max_move_distance : 3m
  max_still_distance: 3m
  g0_move_threshold: 20
  g0_still_threshold: 20
  g1_move_threshold: 20
  g1_still_threshold: 20
  g2_move_threshold: 20
  g2_still_threshold: 20
  g3_move_threshold: 20
  g3_still_threshold: 20
  g4_move_threshold: 20
  g4_still_threshold: 20
  g5_move_threshold: 100
  g5_still_threshold: 100
  g6_move_threshold: 100
  g6_still_threshold: 100
  g7_move_threshold: 100
  g7_still_threshold: 100
  g8_move_threshold: 100
  g8_still_threshold: 100

I didn’t even realize this before, setting max_still_distance to only 0.75m will make the sensor detect still distance only on the first gate. According to the app, when I’m sitting in front of the sensor, the energy is being picked from gate 2, so that was my problem and why the sensor wasn’t detecting still energy anymore for me.

When I first uploaded ESPHome, I had the sensor disconnected. So it was operating on factory defaults initially, and it was working nicely. After a time, I think ESPHome setup the sensor with the “wrong” configuration and then it stopped working.

In case you are wondering, I’m setting the threshold to 100 on higher gates because I don’t want detection on those distances.

And to answer my own question, if you want to factory reset the sensor, using the app. You can set your Android device language to English, so the app will load in English instead of Chinese. When you connect to the sensor, click More (更多) and then Initialize (恢复出厂) on the top right.

1 Like

Hi, Victor! I ran into the thing that I cannot set up the distnace treshold because esphome now moved it to “number component”. So, following construction does not work.

I hope that you managed to migrate and update your code. Do you mind to share it?
Thanks!