esphome / esphome/feature-requests
Add high pass filter to sensor component
- 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**
There isn’t a high pass filter available for the esphome sensor component. Propose that one be added. Could be as simple as the example below.
Parameters:
- time_constant
- update_period
- `alpha = time_constant/(time_constant+update_period)`
Difference Equation
`output = alpha * ( previous_output + input - previous_input)`
**Please describe your use case for this integration and alternatives you've tried:**
Attempting to use an accelerometer to detect vibration and would like to be able to filter out DC accelerations (gravity, sensor bias) without having to calibrate or calculate the orientation of the sensor. I've tried adding this filter to a custom component based on the accelerometer component (MPU6050).
**Additional context**
I'm using the MPU6050 component to detect whether a machine is running. I think creating a custom component will work, but suspect that this functionality would be broadly useful.
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names the sensor component and MPU6050 integration but no files or tests. Start by locating those entry points and comparing the proposed time_constant, update_period, alpha, and difference equation with existing sensor filters. Done means the high-pass filter can be configured for sensor data and addresses the stated vibration-detection use case.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100