LD2450_zones - Custom ld2450 EspHome component

Hi all,
I got confused by all the different variations and implementations of components for the LD2450 radars (plotly graphs, coordinates, direction… i dont need this) , so I vibecoded a custom ESPHome component for myself. The idea is simplicity and flexibility: just add the component to your YAML with a list of the zone names, open the ESP’s web interface, draw the zones however you like with the brush overlapping them if you need, you can even draw something weird and it will be a zone, and you’re done! You also can draw polygons by snapping points to target, and fill them.
I put it through some rigorous testing - lying on the couch for several hours, and didn’t experience a single instance of tracking loss. Give it a try.
I’m not sure if I’ll maintain the project in the future. Right now, it works perfectly for my needs. Maybe it will help someone.

Github




3 Likes

Drawing them on the ESP’s own page is a nice touch. Something a few hours on the couch won’t surface though: of the 262,039 points I analysed from mine, 21,806 were mirror images of a real person rather than a second person, reflected in a surface about 0.34 m east of the sensor. The three real clusters I could separate were up to 824 mm apart, yet the mirror axis implied by each one agreed within 85 mm, and in all three that axis was simply the midpoint of the real and phantom x. Mine sat between roughly +790 and +1450 mm, so a zone drawn out there would have had them in it, which is worth a look before you trust a zone on that side.

Hi. Interesting.
The comment about the couch was a joke, of course. Are the reflections visible in the official app via Bluetooth? I live in a timber house, so conditions are practically ideal; the radar can detect people through walls. I’m going to expand the testing and move the sensor to the bathroom, where there is concrete and other more challenging surfaces. The component takes data from the radar and checks for intersections with grid cells and zones. I don’t think it’s a software bug, but I’ll check; it might require additional filtering, or it could simply be a characteristic of the sensor that requires careful placement.

Everything I analysed came from the ESPHome coordinate sensors rather than the official app, so I can’t say whether the app shows them. I’d agree it isn’t your code, since mine showed up in the raw coordinates before any zone logic: the phantoms mirror across a surface about 0.34 m east of the sensor, and I never pinned down what that surface physically is. One thing to watch if you filter them: in a separate 7-day window, 5.8% of the seconds with a target present had only the reflection and no direct return, so clipping that side would have made a real person vanish, which is why I don’t filter on the chip and only clip in a derived person count. Curious what the bathroom shows.

I caught it. The refrigerator became my archenemy. Clear reflections follow me both in the official app and in my component. It’s interesting that the algorithm built into the radar tries to keep the reflection for some time even after it has completely disappeared (I’ve closed myself off from the reflective surface). It’s hard to combat this with software, the radar doesn’t give access to the algorithm’s settings. The simplest and most reliable solution is to place a second sensor in the room, rotated relative to the first one, and in Home Assistant, check for presence using the AND logic — only if both sensors confirm presence in the zone. I’ll try to implement trajectory‑based filtering later. Additionally, I’ve ordered an LD2410; I’ll try to combine them in the firmware for filtering. I also ordered an LD2452 to see how it works and what the differences are from the 2450.


There are two apps: you can flash the EverythingSmartHome firmware onto an ESP32 and use GitHub - EverythingSmartHome/everything-presence-addons: A Home Assistant add-on to visually create zones for the Everything Presence Lite · GitHub, or build a Zigbee sensor and use GitHub - notownblues/SHS-Z2M-Presence-Zones: Home Assistant Add-on for Visual Zone Configuration of SHS01 mmWave Presence Sensors · GitHub.

Is that all it does??? I really expected better from you and would have thought that it would also be able to do my taxes or possibly act as a personal finance planner or anything in addition to tracking people around a room!! I really expected more from you and you really dissapointed us all…

Lol jk dude. ; )

Very sweet project contribution and hopefully I find time to try it out soon! Once I do though, I’ll leave some feedback if you’d like to receive it.

Thanks again!