TillFleisch / ESPHome-HLK-LD2450

ESPHome support for the HI-Link HLK-LD2450 millimeter wave sensor (external component) with support for custom zones using convex polygons.
MIT License
105 stars 19 forks source link

Allow multiple sensor configuration #4

Closed TillFleisch closed 9 months ago

TillFleisch commented 9 months ago

This PR enables multiple component configuration.

Close #3

Aaroneisele55 commented 9 months ago

@TillFleisch thank you very much for adding this :-) 😊👍

TillFleisch commented 9 months ago

I have "quickly" (after connecting 5V to GND and wondering why it does not work) checked if there are any sideeffects/issues. Would you mind double checking if there is any unexpected behviour? You can use:

external_components:
  - source: github://TillFleisch/ESPHome-HLK-LD2450@allow_multi_conf

Keep in mind that using 2 of these sensors close to one another could introduce interference.

PeeVv commented 9 months ago

I've implemented the allow_multi_conf branch, it seems to be working without any issues. I've placed the sensors +- 15cm from each other in a 90 degree angle, so far no interference.

I do however sometimes get the "Sending command timed out! Is the sensor connected?" message, even after multiple soft restarts. Only a hard restart of the ESP32 helps. My LD2420s have the same issue, so maybe it's just an Hi-Link quirk.

TillFleisch commented 9 months ago

"Sending command timed out! Is the sensor connected?" [...] so maybe it's just an Hi-Link quirk

That's what I'm thinking as well. Sometime it returns back into a working "config" state, seemingly at random.

PeeVv commented 9 months ago

You can use:

external_components:
  - source: github://TillFleisch/ESPHome-HLK-LD2450@allow_multi_conf

If you've added the device in the last 24h you shouldn't forget the refresh: 0s (or some other low value), otherwise esphome will keep using the old cached version.

So:

external_components:
  - source: github://TillFleisch/ESPHome-HLK-LD2450@allow_multi_conf
    refresh: 0s

Remove the refresh entry afterwards to prevent esphome from requesting data too often.

"Sending command timed out! Is the sensor connected?" [...] so maybe it's just an Hi-Link quirk

That's what I'm thinking as well. Sometime it returns back into a working "config" state, seemingly at random.

As long as it's stable during usage this does not cause too much issues. I normally auto-update my esphome devices, but that can cause these sensors to stop working, so updates need to be done manually. Hopefully a future firmware update will fix this.