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).
This package consumes entity IDs; it contains no integration code. You need both integrations installed and a target reporting:
- LD2412 →
paulin011/ld2412_ble - LD2450 →
MassiPi/ld2450_ble
Copy hlk_fusion.yaml into your HA packages directory and enable packages
(if not already):
# /config/configuration.yaml
homeassistant:
packages: !include_dir_named packagesThen place the file at /config/packages/hlk_fusion.yaml and reload packages
(restart, or Developer Tools → YAML → reload).
-
Device names. Every entity ID in the package is hardcoded assuming the two devices are named exactly
LD2412andLD2450in HA (so the slugs becomebinary_sensor.ld2412_presence,sensor.ld2450_target_one_x, …). With_attr_has_entity_name = Truethe slug is derived from the device name, so an advertised name likeHLK-LD2412_A1B2will not match. Rename both devices to the bare model name, or substitute your real entity IDs throughout (Settings → Devices → each radar). -
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 reportsunavailable(via the availability templates) rather than silently readingoff. -
Cold-start latch. The per-zone "occupied" sensors are classic (non-trigger) template binary sensors, so they reset to
unknownon 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 aninput_booleanwritten 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.
| 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) |
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.