LD2410 esphome tips

Looks awesome! and this is one of the ideas I dream of when I ordered those radars.
Could you share more details?

I don’t know what’s up with bluetooth with these LD2410. I have a LD2410B and LD2410C, I could see none of them via bluetooth on my Samsung S23 Ultra but they would show up on my cheap Lenovo M7 tablet, as they would not show up using ESPHome Bluetooth proxies. I got tired of trying to make these work with bluetooth and just used the UART connect to esp32 and they do work like a charm.

BTW, at start they were way too sensitive. Not far from my PC so I guess they were somehow catching fan movements inside the computer. I switched to using this values in the config and there are very stable now:

ld2410:
  timeout: 30s
  max_move_distance : 6m
  max_still_distance: 0.75m
  g0_move_threshold: 50
  g0_still_threshold: 20
  g1_move_threshold: 50
  g1_still_threshold: 20
  g2_move_threshold: 40
  g2_still_threshold: 40
  g3_move_threshold: 40
  g3_still_threshold: 40
  g4_move_threshold: 40
  g4_still_threshold: 40
  g5_move_threshold: 40
  g5_still_threshold: 40
  g6_move_threshold: 30
  g6_still_threshold: 15
  g7_move_threshold: 30
  g7_still_threshold: 15
  g8_move_threshold: 30
  g8_still_threshold: 15

What you connect to ESP, RX-TX or OUT-D5?

RX, TX, 5v and GRND

1 Like

I had the same problem and I managed to solve it. I found a solution on GitHub.

I rewired the cables and made changes in the configuration.

uart:
  id: uart1
  tx_pin: GPIO15
  rx_pin: GPIO13
  baud_rate: 256000
  parity: NONE
  stop_bits: 1
  data_bits: 8

And works :slight_smile:

2 Likes

I’ve sadly already tried that to no success. I’ve concluded that my LD2410B boards are dodgy sadly, I might order some more at some point to retry but for now I’m just going to wait to see how the FP2 performs.

Hi everyone! I also have 5 pieces of LD2410 in tests and I have this error

Logger: homeassistant.components.sensor
Source: components/sensor/init.py:669
Integration: Sensor (documentation, issues)
First occurred: 7:42:06 AM (10 occurrences)
Last logged: 7:42:08 AM

  • Entity sensor.ld2410_5_still_energy_5 (<class ‘homeassistant.components.esphome.sensor.EsphomeSensor’>) is using native unit of measurement ‘%’ which is not a valid unit for the device class (‘energy’) it is using; expected one of [‘MJ’, ‘kWh’, ‘MWh’, ‘GJ’, ‘Wh’]; Please update your configuration if your entity is manually configured, otherwise create a bug report at Issues · home-assistant/core · GitHub
  • Entity sensor.ld2410_2_still_energy_2 (<class ‘homeassistant.components.esphome.sensor.EsphomeSensor’>) is using native unit of measurement ‘%’ which is not a valid unit for the device class (‘energy’) it is using; expected one of [‘MJ’, ‘kWh’, ‘MWh’, ‘GJ’, ‘Wh’]; Please update your configuration if your entity is manually configured, otherwise create a bug report at Issues · home-assistant/core · GitHub
  • Entity sensor.ld2410_1_still_energy_1 (<class ‘homeassistant.components.esphome.sensor.EsphomeSensor’>) is using native unit of measurement ‘%’ which is not a valid unit for the device class (‘energy’) it is using; expected one of [‘MJ’, ‘kWh’, ‘MWh’, ‘GJ’, ‘Wh’]; Please update your configuration if your entity is manually configured, otherwise create a bug report at Issues · home-assistant/core · GitHub
  • Entity sensor.ld2410_4_still_energy_4 (<class ‘homeassistant.components.esphome.sensor.EsphomeSensor’>) is using native unit of measurement ‘%’ which is not a valid unit for the device class (‘energy’) it is using; expected one of [‘MJ’, ‘kWh’, ‘MWh’, ‘GJ’, ‘Wh’]; Please update your configuration if your entity is manually configured, otherwise create a bug report at Issues · home-assistant/core · GitHub
  • Entity sensor.ld2410_3_still_energy_3 (<class ‘homeassistant.components.esphome.sensor.EsphomeSensor’>) is using native unit of measurement ‘%’ which is not a valid unit for the device class (‘energy’) it is using; expected one of [‘MJ’, ‘kWh’, ‘MWh’, ‘GJ’, ‘Wh’]; Please update your configuration if your entity is manually configured, otherwise create a bug report at Issues · home-assistant/core · GitHub

I use the official esphome setup and I use only 2 entity Still Energy and Presence.
Still Energy is always between 3% and 6% when there is no one in the room and when I enter in the room it goes up but never drops below 10% so I made the automation to turn on the bulb when still energy is above 10% and when it is below stops and works perfectly for 2 weeks
Just one day I found all still energy at the value 0% blocked and presence on the detectet and I had to open the application HLKRadar-tool on the phone and give factory settings reset to each one and they came back… Has anyone encountered this problem before?

Hello guys,

there is some fresh version, very promising : https://github.com/esphome/esphome/pull/4434

You can now set everything and test and do it again to fine tuning!!! really nice feature.

I definitively prefer the LD2410+ESP instead of the LD2410B or C because bluethooth disconnect several times per hours, what is really not accurate for a presence/occupancy sensor…
In fact, the integration no more work if you update your Node (Bluetooth proxy) so you have to restart HA after each update. And your LD2410B need to be near to your Node, about 6m maximum, to avoid disconnections.

Sadly because the bluethooth version is so simple to use and consume nothing…

image

Hello,

i have make a standalone LD2410B with relay and power supply to lighton/off automatically, all included in a wall socket :

3D file available on Thingiverse :
https://www.thingiverse.com/thing:5929077

Enjoy!

1 Like

Agreed - I have played with both the Bluetooth and non-Bluetooth versions and have come to the conclusion that the best way to add these to home assistant is to get the Bluetooth version and hook it up to an ESP on the occupancy data pin and don’t use them as Bluetooth sensors.

This way you can use the android app to adjust sensitivity as well as do firmware upgrades (I don’t think this is possible in the windows app) and not have to reboot every time it looses connectivity. Also, once added as a BLE sensor you can’t use the app to make adjustments, you have to cycle power, adjust in the app then reboot HASS.

Can you make a small Tutorial on how to hook it with ESP for noobs like us, I am new to HA and have ordered Bluetooth version and completely clueless on via integration with ESP32. Thats why I ordered the Bluetooth version to have hassle free experience but since everyone is facing issues with Bluetooth. It would be great help…:slight_smile:

I have several working with ESPHome (very pleased) and also tried BLE only. My experience with BLE is it is unreliable. They are discovered quickly, but bounce in and out of unavailable. Also they report a second or two later (same sensor reporting thru ESPHome and BLE). I see no reason to use it.

Perhaps I have overlooked the obvious, but I haven’t discovered how the default values are set for Moving Distance and Still Distance. Some have defaults, others don’t. I did nothing (that I’m aware of) to set them. How?

hello,

Ble version is great for a standalone use because it doesnt even need to be integrate in HA, only if you need the sensor for automation. It works with a Bluethooth proxy on a dedicated ESP32 : see here to create a bluetooth proxy : https://esphome.github.io/bluetooth-proxies/ and here https://esphome.io/components/bluetooth_proxy.html
Well, it works great, OUT OF THE BOX, i personnaly dont tweak or change anything for a normal use : room of 5m x 6m.
The only problem is when you update Esphome Bluethooth proxy, you need to restart HA to have the sensor alive back, and sometimes redo the integration. But it works, out of the box, you just need to connect +5v to VCC and GND to GND, i take a broken USB cable and cut the micro side and just solder on a connector with 1.24 pitch i bought on Aliexpress (see my pictures or previous posts).

To hook a LD2410 to a Wemos D1 mini, no need for a tutorial to connect 4 pins :slight_smile:
ESP8266 LD2410
5V ----------------------------------- VCC
GND--------------------------------- GND
RX ----------------------------------- Uart-Tx
TX------------------------------------ Uart-Rx

or this :

the advantage is you can tweak everything, but its much bigger sensor and need much power. Very reliable.

4 Likes

I found BLE reliable, if you dont mind the update problem. YOU NEED : a Bluetooth proxy at maximum 6m to your LD2410 (LD2410 has not a really long range BLE module). And its important to not have a bunch of active connections on your Bluetooth proxy, maximum is 3. I have only 1 active with LD2410 and 2 passives with Xiaomi_lywsd03mmc (temp + humidty) at the same BLEProxy, and it works great. I have 4 bluetooth proxy for all my house (233m² with 1 floor), its pretty enough for cover all the rooms.

It instantly detect when i move and occupancy works great. i have absolutely any delay. Perhaps you have to take care of your Wifi network (interferences, channel choose, transmit power, if you have theses settings available).

i have 4 Ubiqi LC-AP-PRO and i let them choose nightly the best channel, in mesh config, because i have a bunch of Zigbee, on 2 networks : one with Z2M on channel 11 with a Sonoff USB dongle 3.0 and another Network with ZHA on channel 25 with an Ezsp (its a Silvercrest Ethernet Gateway, hacked). So the bandwith is quite occuped…but it works great, my Wifi works great everywhere in the house. I have no Wifi 6, only 2.4Ghz and 5Ghz.

If you want to tweak settings, you need the Android app (chinese only) or better, the Windows APP. You have to plug a bluetooth dongle in your PC and you can set everything you want.

But, personnaly, i dont tweak anything and it works great OUT OF THE BOX :wink:

2 Likes

Hello, I initially had some issues with false positives (due to a ceiling fan) and some false negatives even after tuning really close to the ‘background noise’ of my setup.

Played a bit with the ESPHome Binary Sensor filters and found that this worked pretty well for me when paired with a properly calibrated setup. Hope it can help someone else out there.

This setup has enabled me to use the LD2410B + Wemos D1 Mini in a room with ceiling fan.
The LD2410B itself is angled towards the ground a little with pins on top (as per documentation describes the ‘bubble’ to be ‘weakest’ on the pins side).

Hope this helps someone!

ld2410:
  uart_id: ld2410b_uart
  timeout: 2s
  # Calibrated gate sensitivity goes below here.


binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
      filters:
        # delayed_on prevents false positives when background noise spikes randomly.
        - delayed_on: 5s
        # delayed_off prevents false negatives when people fall asleep on my couch.
        - delayed_off: 10s
3 Likes

Perhaps your BLE setup is much better than mine. My RF environment is stressed. I tried several Proxy’s near the sensor’s but still got too many unavailables. For me, it dosen’t seem to make sense to use an ESP32 to try to make a LE environement work when the sensor is anything but LE. Seems simpler to use an 8266 and the more reliable WiFi net. Anyway what ever works in your environment is great.

When looking at my Moving Distance and Still Distance entities, I get this “default” value that sometimes show up under “display percision”. It is not there for all my sensors. The value shows up in the History Graph. Does anyone else see such a thing?

Mine shows last detected value. Sometimes if it falsely detects something at 30-40cm, it stays that way the entire time without triggering presence on the binary sensors.

It then updates when there’s actual detection after to the correct value.

Trying to understand how to use these values. Still working on it. The “default” designation is confusing to me.

Just curious, anyone finding that their LD2410 boards are failing? I have lost one already and thought I just lost another but after unplugging and replugging it came back to life. Just wondering if anyone else is seeing anything similar? Generally I am quite happy with these and have deployed 8 around the house already with the idea of adding a few more but wouldn’t be happy if they start to randomly fail.