Hi,
I want to add a button to an esp32 that when pressed selects a random preset within a given range
According to JSON API - WLED Project ) the JSON key “ps” can be used to cycle through presets as such:
{“ps”:“5~10~”}
This behaves as expected, cycling through presets 5-10 in order.
The JSON API guide indicates that adding r to the end should randomize the order, I believe the syntax should look like this:
{“ps”:“5~10~r”}
But this does not choose a random preset, it still cycles through in order. Am I missing something or is this not functioning as described?
divsys
2
Someone else recently hit that same bug: Random Presets
They suggested using the HTTP API as there’s an issue with the JSON.
Ahh thanks so much, I found the thread here:
And here is what works:
PL=r&P1=4&P2=10