Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add high pass filter to sensor component #2705

Open
alex-masetti opened this issue Apr 28, 2024 · 1 comment · May be fixed by esphome/esphome#6695
Open

Add high pass filter to sensor component #2705

alex-masetti opened this issue Apr 28, 2024 · 1 comment · May be fixed by esphome/esphome#6695

Comments

@alex-masetti
Copy link

alex-masetti commented Apr 28, 2024

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.

@latonita
Copy link

latonita commented May 7, 2024

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

@latonita latonita linked a pull request May 7, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants