esphome / esphome/feature-requests

Add variable configuration to LD2410

Open
#2,231 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**
I love LD2410 but currently implementation of ESPHome not allows change the configuration dynamically. LD2410 component has some configuration methods (set_max_move_distance, set_max_still_distance, set_timeout and set_range_config) but changes not working when I call them.

**Please describe your use case for this integration and alternatives you've tried:**
My current workaround is to call sensor setup method after call any of configuration methods. This is an avoidance way to reconfigure the sensor due we should never call the setup method.

**Additional context**
My working bad example to update ld2410 configuration:
```
number:
- platform: template
name: "LD2410 Max Move Distance"
id: ld2410_max_move_distance
min_value: 0.75
max_value: 6.0
initial_value: 4.5
restore_value: true
step: 0.75
unit_of_measurement: "m"
icon: "mdi:motion-sensor"
set_action:
- lambda: |-
id(ld2410_max_move_distance).publish_state(x);
id(ld2410_sensor).set_max_move_distance(x);
id(ld2410_sensor).setup();
ESP_LOGI("configuration", "Update ld2410 max move distance %.1f meters", x);
- platform: template
name: "LD2410 Timeout"
id: ld2410_timeout
min_value: 1
max_value: 120
initial_value: 30
restore_value: true
step: 1
unit_of_measurement: "s"
icon: "mdi:timer"
set_action:
- lambda: |-
id(ld2410_timeout).publish_state(x);
int timeout = int(x);
id(ld2410_sensor).set_timeout(timeout);
id(ld2410_sensor).setup();
ESP_LOGI("configuration", "Update ld2410 timeout %d seconds", timeout);
- platform: template
name: "LD2410 Max Still Distance"
id: ld2410_max_still_distance
min_value: 0.75
max_value: 6.0
initial_value: 1.5
restore_value: true
step: 0.75
unit_of_measurement: "m"
icon: "mdi:motion-sensor-off"
set_action:
- lambda: |-
id(ld2410_max_still_distance).publish_state(x);
id(ld2410_sensor).set_max_still_distance(x);
id(ld2410_sensor).setup();
ESP_LOGI("configuration", "Update ld2410 max still distance %.1f meters", x);```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the LD2410 component methods set_max_move_distance, set_max_still_distance, set_timeout, set_range_config, and setup described in the issue. Trace how these methods apply configuration and how setup currently makes the changes take effect. Done means configuration changes work dynamically without calling setup from the YAML actions.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.