Pushbutton to turn SYNC on and off

I am about to set up a master and slave ESP32 wled system.
Is it possible to setup a pushbutton to the slave ESP32 to turn SYNC on and off?

You can get at that through the JSON API.

I see some details in the KB on UDP send and recv which will allow you to turn the Sync send and recv functions on and off via the API. You can embed those in a preset which can be triggered by a button.

Checkout KB for “State object”: JSON API

Note:
After a little playing about with this feature via the API, I discovered the KB is not exactly clear on the correct udpn syntax within a preset. To turn on the UDP send feature add:

“udpn”:{“send”:true}
or
“udpn”:{“send”:false}

to your preset to get Sync on and off respectively.

Do I have to set up 2 presets?
one to turn SYNC on and send preset/effect changes from master to slave ( “udpn”:{“send”:true} )
and another one to turn SYNC off ( “udpn”:{“send”:false} )
Is it possible to have one that toggles on and off?

I’m not 100% sure but JSON API allows for toggle switch.
Try: {"udpn":{"send":"t"}}

That doesn’t seem to have the same effect as separate true and false presets.
At least it doesn’t trigger the UI Sync button, nor does it show a change on the /json/state page.
It doesn’t seem to have any effect at all.

Running on v0.14.0

You are correct. Parsing toggle is not enabled for udpn:send.

Implemented and will be available in 0.15.

1 Like

Above and beyond as always :+1: