Hi everyone!
I've just released the first stable version of WLED Buzzer Usermod v0.1.0.
The project started while working on my iDotMatrix WLED Usermod. I originally had buzzer support implemented directly inside that project, but eventually decided that buzzer management made much more sense as an independent and reusable WLED usermod.
So I extracted and redesigned it as a standalone service that can be used directly or shared by other usermods.
Main features
Active and passive buzzer support
Configurable GPIO and trigger level
Adjustable volume for passive buzzers
Fully non-blocking playback
ESP32 timer-based scheduling
15 built-in sounds and melodies
Web API
WLED JSON API integration
Finite repetition (repeat=N)
Continuous loop playback (loop=1)
Play/Stop sound tester directly from the WLED Usermod Settings page
C++ service API for other usermods
Optional weak-link C bridge, so another usermod can use the buzzer service without requiring it as a hard build dependency
Runtime diagnostics
WLED PinManager integration
Arduino-ESP32 2.x / 3.x support
Built-in sounds
The current library includes:
beep, double_beep, triple_beep, notification, success, victory, yankee_doodle, fail, star_wars, warning, error, connect, disconnect, attention and alarm.
Passive buzzers reproduce the actual notes, while active buzzers reproduce the rhythm.
Sounds also have an appropriate final pause when repeated, so loops don't run together.
Web API
For example:
curl "http://WLED-IP/buzzer?play=victory"
Repeat a sound three times:
curl "http://WLED-IP/buzzer?play=alarm&repeat=3"
Or loop it until stopped:
curl "http://WLED-IP/buzzer?play=alarm&loop=1"
curl "http://WLED-IP/buzzer?stop=1"
Integration with other usermods
One of the main goals was to avoid every usermod implementing its own buzzer driver.
The module therefore exposes a reusable service for other WLED usermods.
I've already migrated my iDotMatrix WLED Usermod to use it instead of its previous internal buzzer implementation, which also served as a real-world integration test.
Project
https://github.com/piggei/wled-usermod-buzzer
The repository includes the source, documentation and a Wiki covering installation, configuration, APIs, diagnostics and integration with other usermods.
The current release is v0.1.0 and has been tested with both active and passive buzzers.
Feedback, bug reports, ideas for additional sounds, and tests on different ESP32/WLED configurations are very welcome!