Repository navigation
JSON API
piggei edited this page Oct 1, 2026
·
4 revisions
Buzzer commands can be included in normal WLED /json/state requests under the buzzer object.
{"buzzer":{"play":"victory"}}{"buzzer":{"play":"alarm","repeat":3}}{"buzzer":{"play":"alarm","loop":true}}{"buzzer":{"stop":true}}{"buzzer":{"tone":1000,"duration":200}}{"buzzer":{"beep":150,"frequency":2000}}The usermod adds a buzzer object to WLED JSON state with fields including:
readyplayingsoundlooprepeatRemainingnotenotesfrequency
The JSON API applies strict command validation and aligns repeat semantics with the HTTP API:
- omitted
repeat-> normal one-shot playback, or infinite loop whenloop:true; -
repeatfrom 1 to 255 -> finite total execution count; - explicit
repeat:0-> invalid command, ignored; -
repeatabove 255 -> invalid command, ignored; -
loop:truetogether withrepeat-> invalid command, ignored. - Numeric tone/beep/duration/frequency values must be JSON integers within the same 20-20000 Hz / 1-60000 ms limits as HTTP.
- Stringified numbers, negative values, and requests containing multiple command categories are ignored.
Examples:
{"buzzer":{"play":"alarm","repeat":3}}{"buzzer":{"play":"alarm","repeat":0}}The second command is invalid and does not start playback.
Night Mode is a configuration policy rather than a JSON playback command. While the current time is inside the configured quiet interval, JSON playback commands are ignored by the service. /json/state exposes muted, nightMode, nightFrom, and nightTo so consumers can distinguish hardware readiness from quiet-policy muting.
WLED Buzzer Usermod · Documentation v0.2.0 · https://github.com/piggei/wled-usermod-buzzer