erapade
(Erapade)
January 12, 2023, 7:08pm
1
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
nickrout
(Nick Rout)
January 12, 2023, 8:01pm
2
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).
erapade
(Erapade)
January 13, 2023, 6:24pm
4
True, lambda are C++ and then everything is possible. Thanks a lot.
erapade
(Erapade)
January 13, 2023, 7:02pm
5
Yes that’s also possible. It will be a bit more sensitive for noisy signals and requires more trimming but good suggestions
1 Like
manten10
(Manten10)
April 23, 2023, 10:41am
6
Hi, how did you solve it? thanks
erapade
(Erapade)
April 24, 2023, 7:53pm
7
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
JulianDH
(Julian Hall)
April 24, 2023, 10:35pm
8
I see the latest ESPHOME release has improved the delta filter to include %. This is super helpful and I will take a look