esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
402 stars 26 forks source link

Add high pass filter to sensor component #2705

Open alex-masetti opened 1 month ago

alex-masetti commented 1 month ago

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:

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.

latonita commented 1 month ago

That's a good idea and is useful. Though, I think it only needs alpha as a parameter - it would be easy to use.