LD2450 zones in ESPHome: what the three rectangles actually count

The LD2450 exposes three rectangular zones with target counts, not a zone-filtered presence flag. Here is how to wire them without misreading the entities.

Coordinates are millimetres, not metres

The LD2450 reports target positions in millimetres. X runs from -3000 to 3000 mm, negative to the left of the sensor and positive to the right. Y runs from 0 to 6000 mm, from near to far. A zone is a rectangle from x1, y1 at the near-left corner to x2, y2 at the far-right corner, using the same axes.

Up to three zones can be defined: zone_1, zone_2 and zone_3. A zone that covers a 3 m wide by 3 m deep area directly in front of the sensor would use x1 -1500, y1 0, x2 1500 and y2 3000. Writing 1.5 and 3 instead of 1500 and 3000 places a tiny rectangle near the sensor, which is a common first mistake.

Three modes behind one select

The zone_type select accepts Disabled, Detection and Filter. Disabled turns zone area detection off. Detection mode considers only targets inside the specified area. Filter mode excludes an area from detection.

Because zone_type is a select entity, it can be changed at runtime from the Home Assistant interface or an automation. That is useful for a room that changes use, but it also means a mode can be left Disabled while the zone coordinates still look correct. Check the select state before debugging the rectangle.

What the entities report

The zone entities are counts, not a boolean. Each zone exposes target_count, still_target_count and moving_target_count. The component also exposes has_target, has_moving_target and has_still_target, which the documentation describes as presence states for the targets rather than as zone-filtered states.

The presence_timeout number controls how long the presence binary sensors stay on after detection clears. Its default is 5 seconds, and it applies only to those binary sensors, not to target counts or target details.

Entity What it reports What it does not report
zone_N target_count All targets inside that rectangle Whether the room is occupied outside it
zone_N still_target_count Stationary targets inside the rectangle A filtered presence flag
zone_N moving_target_count Moving targets inside the rectangle A tracked identity
has_target Any target seen by the module A specific zone
presence_timeout Hold time for presence binary sensors Target count hold time

If the automation needs "occupied inside this rectangle only", use the zone counts and make the decision explicitly. Do not assume that a Filter zone rewrites has_target on every firmware revision; verify the entity behaviour first.

A minimal configuration

The following snippet follows the documented component structure. The coordinates are examples, not a tested room layout.

uart:
  id: uart_ld2450
  tx_pin: GPIOXX
  rx_pin: GPIOXX
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2450:
  id: ld2450_radar
  uart_id: uart_ld2450

number:
  - platform: ld2450
    ld2450_id: ld2450_radar
    zone_1:
      x1: -1500
      y1: 0
      x2: 1500
      y2: 3000

select:
  - platform: ld2450
    ld2450_id: ld2450_radar
    zone_type:
      name: "Zone Type"

sensor:
  - platform: ld2450
    ld2450_id: ld2450_radar
    zone_1:
      target_count:
        name: "Zone 1 Targets"
      still_target_count:
        name: "Zone 1 Still Targets"
      moving_target_count:
        name: "Zone 1 Moving Targets"

The documented default UART rate is 256000. Changing the baud_rate select at runtime stops the sensors until a fresh install with an updated UART configuration, so fix the rate in YAML rather than experimenting through the UI.

Filters can hide the default settle

Each presence binary sensor carries a default settle filter of 1000 ms to prevent flooding Home Assistant. Defining any filter of your own replaces that default. If you add a filter, either include the settle behaviour or confirm that the extra update rate is acceptable; otherwise a busy room can produce a stream of state changes.

Verify each rectangle

Put one person in zone 1, then zone 2, then zone 3, and watch the three count entities. Step outside all zones and confirm the counts return to zero while the presence flag may still be on. Switch between Detection and Filter and repeat, so the mode behaviour is observed rather than assumed.

Record the coordinate origin, mounting height, zone rectangles, zone_type state and firmware version with the readings. A changed orientation invalidates the rectangle even if the numbers in YAML stay the same.

No hardware was bench tested for this chapter. All fields and defaults above come from the component documentation and must be confirmed on the target firmware.