You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON APIs assigned to buttons , e.g {"ps":"1~4~"} #3204
We normally used {"ps":"14"} in a preset and that will work in ui but not when assigned to buttons it does not work only win&PL=~&P1=1&P2=4 works from both ui and when assigned to buttons.
I am not sure that is limited to the above api as assigning other api to buttons like {"on":"t"} will work . I will try to look for more if that is only limited to this
To Reproduce Bug
Add {"ps":"14"} to preset and assign to button action ( clicking on preset will work but button action will not work )
Add win&PL=~&P1=1&P2=4 to preset and assign to button action ( clicking on preset will from ui and button action )
Expected Behavior
{"ps":"14"} and win&PL=~&P1=1&P2=4 is expected to behave the same
Install Method
Self-Compiled
What version of WLED?
WLED 0.14.0-b2 (build 2305090)
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
More more info on the same are here https://wled.discourse.group/t/physical-button/8289
and here https://discord.com/channels/473448917040758787/473448917543944193/1108240349115191386
The format is messed up in the post because of the use of json so when you see {"ps":"14"} it is like the picture
Please check if "Send notifications on button press or IR:" is enabled in Sync settings.
Unless this setting is checked pressing button will not update UI and WLED state with JSON API call.
If "Send notifications on button press or IR:" is enabled in Sync settings then other lights on the network will react and still pressing button will not work correctly for json but will work fine with win&PL=~&P1=1&P2=3 , I have attached a pic of the four tests I did with and without changes to Sync settings with both format . I only use the MCU on board GPIO0 button if that could make a difference . If you see otherwise then could be something from our setup
Activity
blazoncek commentedon May 21, 2023
Please check if "Send notifications on button press or IR:" is enabled in Sync settings.
Unless this setting is checked pressing button will not update UI and WLED state with JSON API call.
This is by design.
dosipod commentedon May 22, 2023
If "Send notifications on button press or IR:" is enabled in Sync settings then other lights on the network will react and still pressing button will not work correctly for json but will work fine with win&PL=~&P1=1&P2=3 , I have attached a pic of the four tests I did with and without changes to Sync settings with both format . I only use the MCU on board GPIO0 button if that could make a difference . If you see otherwise then could be something from our setup

blazoncek commentedon May 22, 2023
Then we may need to wait for @Aircoookie to look into it as notification logic is still a bit mystery to me.blazoncek commentedon May 22, 2023
I have traced the workings and it looks like the JSON preset cycling will not work with buttons due to the way how button calls preset.
From your example:
"ps":"1~3~"and is assigned to a buttonblazoncek commentedon May 31, 2023
I have an idea!
Will provide binary for testing soon (via Discord).
Fix for #3204
Fix for wled#3204
Squashed commit of the following:
Fix for wled#3204