Bandpass or FFT filter

I need to detect the oscillations below. My thinking was to use a band pass filter or a FFT to filter out the frequency (in this case 1/(20*60) Hz, the period time is ~20 minutes). But I didn’t find any bands filter or an FFT algorithm.

Does anyone know if this is supported in ESPHOME lambda, HA template, or if there is any other and/or better solution

I think you’d need to create a custom component/lambda. There must be bandpass / fft code out there for c++.

Would detecting the turning points work for you?

You can create a delta sensor relatively easily for that with some lambdas.

And you could publish the turning point value or a increasing/decreasing type binary value to another summary sensor.

You could also probably have a count-up sensor that calculates the time between turning points (period).

True, lambda are C++ and then everything is possible. Thanks a lot.

Yes that’s also possible. It will be a bit more sensitive for noisy signals and requires more trimming but good suggestions

1 Like

Hi, how did you solve it? thanks

Sorry, I have no answer on that, I left the project. Maybe I will pick it up again when I learnt more about HA and lambda

I see the latest ESPHOME release has improved the delta filter to include %. This is super helpful and I will take a look