Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

HLK Radar Fusion — LD2412 + LD2450 for Home Assistant

A Home Assistant package that fuses two Hi-Link radars into one occupancy system, each covering the other's weakness — the same pairing Apollo Automation uses in the R_PRO-1, but over Bluetooth LE and fused at the HA layer instead of in firmware.

Radar Strength Weakness the other covers
HLK-LD2450 Multi-target x/y tracking → position, zones Loses a motionless target (person sitting still / sleeping)
HLK-LD2412 Presence + still-target detection No position / zones

The LD2450's 3 zones are the primary logic (target inside a rectangle). The LD2412 is the stillness backup: when a zone was occupied and the LD2450 drops the motionless target, the zone stays occupied as long as the LD2412 still reports presence. Plus one global "somebody is in the room" sensor (either radar sees anyone, anywhere).

Requirements

This package consumes entity IDs; it contains no integration code. You need both integrations installed and a target reporting:

Install

Copy hlk_fusion.yaml into your HA packages directory and enable packages (if not already):

# /config/configuration.yaml
homeassistant:
  packages: !include_dir_named packages

Then place the file at /config/packages/hlk_fusion.yaml and reload packages (restart, or Developer Tools → YAML → reload).

⚠️ Prerequisites (the package is inert without these)

  1. Device names. Every entity ID in the package is hardcoded assuming the two devices are named exactly LD2412 and LD2450 in HA (so the slugs become binary_sensor.ld2412_presence, sensor.ld2450_target_one_x, …). With _attr_has_entity_name = True the slug is derived from the device name, so an advertised name like HLK-LD2412_A1B2 will not match. Rename both devices to the bare model name, or substitute your real entity IDs throughout (Settings → Devices → each radar).

  2. Enable the LD2450 target coordinate sensors. The LD2450 integration ships its Target {One,Two,Three} {X,Y} sensors disabled by default. The zone logic needs those coordinates, so on each LD2450 enable the six sensors: sensor.ld2450_target_{one,two,three}_{x,y}. Until you do, every zone sensor reports unavailable (via the availability templates) rather than silently reading off.

  3. Cold-start latch. The per-zone "occupied" sensors are classic (non-trigger) template binary sensors, so they reset to unknown on a HA restart. The LD2412 stillness backup therefore cannot hold a zone across a restart until the LD2450 re-acquires a target. Acceptable for now; if you need restart-persistence, back the latch with an input_boolean written on each transition.

Zone rectangles are configured with the input_number helpers the package creates (LD2450 coordinates in millimetres: x lateral with the sensor at 0, y depth away from the sensor). A target reported at exactly (0, 0) is the LD2450 "no target" sentinel and is ignored.

Entities created

Entity Logic
binary_sensor.hlk_zone_{1,2,3}_target LD2450 target inside the zone rectangle
binary_sensor.hlk_zone_{1,2,3}_occupied zone target OR (zone was occupied AND LD2412 presence) — latched stillness backup
binary_sensor.hlk_fusion_room_occupied LD2450 any-presence OR LD2412 presence
input_number.hlk_zone{1,2,3}_{x1,x2,y1,y2} zone rectangle corners (mm)
input_number.hlk_fusion_clear_delay zone clear delay (seconds)

Status

Beta — the underlying integrations are pre-hardware; this package has not been validated against physical devices. Zone geometry and the stillness latch are the parts most likely to need tuning once the radars are connected.

About

Home Assistant package fusing HLK-LD2412 (presence/stillness) + HLK-LD2450 (x/y tracking) radars — LD2450 zones with LD2412 stillness backup. Companion to paulin011/ld2412_ble and MassiPi/ld2450_ble.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors