Setting push button

There is a “toggle on-off” function in the API that covers this.
Take a look at: Push button for each segment - #4 by blazoncek
Also the API section of the docs: JSON API - WLED Project