LD2410 esphome tips

Are you sure timeout: 150s is there in factory settings?
When I use this option on my sensor it only turns off the presence binary sensor 150 sec after the last detection event. Which, if used to trigger lights, is a very long time to wait for the light to turn off after you have left the room.

Other than that, I agree on these settings being quite good.
In any case, do not use the ones from the yaml sample on esphome page! These are really bad.

@Wayne_Perryman If you’re using Android like me, I linked to the Android APK I sideloaded on my phone, to configure each of these ld2410c via Bluetooth.

This has worked great, especially since I can name each sensor in the app. If you’re using iOS, the documentation says the app can be found in the store with the name “HLKRadarTools”. This app isn’t in the Google Play Store, hence the sideloading.

Here are some screenshots from the app after I picked one of my sensors from the list. Toggling on Engineering mode allows you to see the graphs with real-time data. The purple line for moving and static are the settings at each “gate”; with each gate being distance from the sensor from 0 to 6 meters. The blue line is detected motion. You can tap on each line graph to get exact numerical values; which would help if you’re trying to fine tune this.

When you click More in the top right corner, you get this configuration page. From here, you can set the “unattended” value, which is how long the “out” pin will stay high after it detects presence. So far, I like 150 seconds so it has enough time to continue to detect motion without my room lights overly cycling on and off.

“Photosensitive set” value sets the threshold of the photosensor on the first image, at the bottom of the page. You set that as your cutoff for the “under” or “overtop” options. The “close” option seems to disable this feature. I could have this reversed from when I tested this, but I think overtop meant the photosensor value/reading has to be over the threshold value, otherwise presence will not set the out pin to high. The under option meant the photosensor value/reading has to be under the threshold value, otherwise presence will not set the out pin to high. Example: if you have the out pin control a relay that turns a light on, then you can have it only turn the relay/light on if the room is dark enough.

The “energy” settings are for how sensitive you want the sensor to be at each gate, or distance from 0 to 6 meters from the sensor. 0 is the most sensitive and 100 is the least sensitive. The sensor will always require a trigger from “energy of motion” to detect presence, then “energy at rest” will keep it active (or keep the pin high). This helps to keep false positives from “energy at rest” from triggering presence.

Hopefully I explained that well enough, but this is what I’ve figured out from playing with this sensor for a bit. I’ve now replaced 3 of my PIR sensors with this ld2410c sensor and I’m only using 3 wires (power, ground, out) to detect presence in Home Assistance using ESPHome.

14 Likes

@Rafaille Correct, those are only the gate thresholds it reset to. The default timeout was 5 seconds on my sensor. I am using 150 seconds to give the sensor enough time to detect me walking around a room and account for any blind spots, so my lights don’t turn off inadvertently. Glad you like these setting as well and I agree, the default settings suggested on the sample yaml were not good for my use either. :slight_smile:

@Protoncek Thanks for pointing out that ESPHome change. UART id change I had tested other names initially in my config and tested your recommendation also, but still get the same error in the ESPHome editor. I provided a full copy of the esphome config, if anyone would like to try and copy/paste the full config details into your editor, if anyone would like to try and get around the error? It seems to not like uart_id as a valid option under sensor and binary_sensor for the ld2410 platform. This is what makes me wonder if the ld2410 code has to support this multiple uart feature?

Did anyone succeeded to connect the LD2410 (Non B variant) via the LD2410 Tool on Windows? When I use an USB FTDI Adapter (genuine one) it fails to open the port… Set the baud rate to 9600 in the tool but that also fails. Any hints? I want to change the gate settings.

@muffin44 - I was able to connect to my LD2410C with the LD2410 Tool on Windows using an USB FTDI Adapter. RX on the adapter goes to TX on the sensor and TX to RX. Note: make sure you set the jumper on the FTDI Adapter to 5v since 3.3v is too low and it won’t work; just confirmed this. :wink: The baud rate should be 256000. See what COM ports are listed in the dropdown before you connect the USB adapter to Windows, then connect the adapter and hit refresh. The new COM port will be your adapter.

1 Like

A Few Questions
I have a ld2410 (not b or c) just plain.
It is working in conjuction with a d1 mini. At least it shows me data.

I have looked for an explaination of the data it shows in esp home, can some one show me where I might find it to understand what all the things do.

Also are there any automations using it. This is a lot different than my pir sensors and am having trouble wrapping my head around what data I need to take into account to create an automation.

Lastly is there an HLK app for a non bluetooth version. The link shown in many posts above is only for a bluetooth version.

Thanks to the community for any help or links.

I did exactly the same. Funny that it worked today maybe after I shut down and freshly booted my pc…

Look at my post and smoke.007 post. You have to connect the sensor via an USB FTDI adapter to your pc and use the LD2410 Tool. on Windows.

Also have a look at the link on the manual.

@carltonb In HA, under Devices & Services, find your esp device (d1 mini) that you brought into HA. You should see all your new sensors created for the ld2410. I recommend the threshold and other settings from my post LD2410 esphome tips - #251 by smoke.007. These should be configured within your esphome config for your d1 mini. Once you have these values working well for presence detection, I was simply using only the binary_sensor.%yourESPdevicename%_presence sensor. I think it’s value was only on or off, depending if it detected human presence. Honestly, for a simple automation that does something if there is human movement, use that sensor as a trigger when the value = on, then value = off means no human movement. This will work just like your PIR sensor.

For testing, use a small value for timeout in your esphome device code, like 5 seconds, then increase to something like 150 seconds later to keep it from cycling on/off too often.

Only app for ld2410 (non-BT) version is the Windows tool; however, you’d only use that if you want to program the ld2410 so you can use the out pin, not the uart tx/rx pins. Programing it and using the out pin allows you to use the sensor just like your PIR sensor; this is what I’m doing now for my all my ld2410c sensors since I don’t need all the other sensor values that I can get with uart. I just wanted presence detection that’s tons better than PIR sensor, can detect me breathing from 18ft away, and keep the presence sensor activated while I’m sitting at my desk.

Same here , using ESP32 , could you solve this ?

I have to buy a bluetooth proxy to connect and it’s working

All my LD’s are with BT, i won’t even buy one without it. The price difference is so minimal than it’s not worthed even to think of buying anything but with BT. IF you have it you can use it …or not. If you don’t have it, you’re stuck…
It’s super easy to configure/alter settings, and you can always use it standalone (without ESP) - just attach a relay and voila - light goes on (and off…).

Firmware 2.05.xxxx for the LD2410 was released but after updating 3 of my sensors I can no longer see them via BT. They appear to keep working via UART but are no longer visible in the Android app (1.1.15). Anyone else have this issue?

Unrelated but just plain funny: HLK-LD2411 24Ghz intelligent toilet radar sensor module gesture recognition induction automatic flipping and flushing_Radar Module_Products_ Shenzhen Hi-Link Electronic Co., Ltd.
Made to detect your toilet action… by “microwaving” your rear end… ROFL

EDIT: For anyone who installed firmware 2.05.xxxx (now pulled), BT is turned off by default. I installed the dev version of ESPHome so that I could use the pending upgrade to the ld2410 integration which support turning BT on and off via serial. Once turned back on, the sensor was back to normal… The manual does say that you can reset the sensor by powering it up and down 5 times in 2-3s but either I was unable to do it that fast or the default is off so resetting it does not turn it back on. Either way, doing it via serial works… too bad we are still waiting for the new integration to be merged in otherwise it would have been a super easy fix.

1 Like

Hi guys. Can someone please post the yaml integration of this LD2410 as a simple binary sensor for presence detection if only connected via th OUT GPIO to an ESP32 GPIO pin without the UART serial protocol?
Thank you

Thanks to @lukcz . I don’t know if it is a bug or a printing error on the boards. My hardware combination is the following,

  • ESP32 D1 Mini
  • LD2410C

RX → RX
TX → TX

All is detected now. I have an issue of presence always ON. Might be too sensitive.

binary_sensor:
  - platform: gpio
    pin: GPIO5
    name: gpio out pin presence
    device_class: presence

I guess my LD2410 is somehow broken after configuring with esphome. It won’t detect any motion more than 3inches away. If move my finger around the sensor very close, it detects.
I tried to connect to the tool and reconfigure the values but only threshold gets be changed. Sensitivity doesn’t gets reset. Since it’s not BLE version, I can’t connect with the app to update the firmware as well!
Anyone has any idea how to reset the sensitivity?

Moving target blue line never crosses the green threshold line unless I go within 6inchs.

I also have the same problem on firmware 2.05.xxxx. But I don’t know the details about dev version of ESPHome, any tips for me to find it? Thank you!

@MarcusTseng - You need to install the dev version of the ESPHome add-on and then use the example yaml from this pull request:

Once the code is finally merged (the pr has been pending for what seems like a long time and there is no eta on when it will be merged…) then you can remove the external_components part to switch back to the released version. You need to compile and upload using the dev version as I read there are other parts that this updated integration requires that are (or were at the time of writing - see PR thread on github) only in dev.

Edit: Whether dev version is needed or not depends on a few things. You may want to try without first and if you get errors then see if the dev version is actually needed.

3 Likes

@soubhik - I believe you may be able to reset the module by powering it on/off 5 times in 2-3 seconds. Worth a try… I just wish they made it a bit longer as doing so in 2 seconds (they say 2-3s ???) can be hard to do reliably.

1 Like