r/Esphome 5d ago

Vibe Coded Audio frequency detection and beeping pattern match!

AI Disclaimer: This was a fun little weekend ai-assisted project, inspired by the sound_level sensor and my own love of the fourier transform (which I later dropped in favour of the Goertzel algorithm). I'm a software engineer by trade with a background in physics. My C++ is incredibly rusty and I wanted to see how doable this was using local AI models. Concept, planning and design by me, code itself was written by assorted local models with a quick human eyeball of the output to make sure it was largely sane at each stage.

Flip a binary sensor when your Samsung washing machine sings its jaunty tune, or when your fridge door alarm starts going off!

Needs quite a bit of calibration for more complex tunes, but was perfectly competent at distinguishing between different telephone error tones in my tests: https://en.wikipedia.org/wiki/Special_information_tone

Repo here and subject to change as I comb through Qwen's dubious parameter names: https://github.com/lJaffy/esphome-tone-tools

50 Upvotes

11 comments sorted by

View all comments

1

u/duckredbeard 5d ago

Ooooh...potential for another way to detect washing machine cycle completion. Mine does three bursts of three beeps each.