esphome / esphome/feature-requests
LD2420 distance update rate
- 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 would like to have an option to increase the update rate on the moving distance of the LD2420 mmWave Sensor.
**Please describe your use case for this integration and alternatives you've tried:**
I am turning off a light if the distance to the sensor increases above 4m. This is already close to the max value of the moving distance (~430cm). Since the update rate currently is only 1Hz, there is a good chance that the sensor reports a distance of eg 380cm and then I am out of range before the next update.
If I get out of range the sensor keeps the last value until the timeout is reached. So it never reaches >4m.
Since I want a snappy response waiting for the timeout is not an option.
**Additional context**
According to the sensors datasheet it should send out the distance at 10Hz, so I assume the update rate is limited in esphome.
Edit:
After having a look at the code I assume I don't even need a faster update rate. All I need is that esphome internally listens to all the sensor values even if the time for the next update isn't reached. Then, when the time is reached is should report the last received value.
Currently all values are ignored until an update is due.
Although I think I understand how the code works, I'm not a good enough programmer do change it. It would be really great if a more capable person would look into this.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the ESPHome LD2420 component and its update scheduling and value-handling code. Check how incoming sensor values are treated before the next scheduled update, then verify that the latest value is reported at the configured interval while distance changes are not discarded.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100