Tone Recognition Sensor

I am wondering if anyone has simple tone recognition sensor working. I’m imagining a sensor that listens to my coffee maker (5 beeps) and coffee is ready and an alert is sent. Likewise 2 beeps and the coffee maker is turning off.

My guess is that using a piezo element could be used to detect the sound. As far as I remember were there plenty of guides to use that with Arduino board, thus it would work with ESP8266 as well.

Thanks for the suggestion. I’ve seen the various Arduino knock tutorials (https://www.arduino.cc/en/Tutorial/KnockSensor) around… I’ll give this a try and see if it will work with tone/beeps.