WLEDwiki/Sync-WLED-devices-(UDP-Notifier).md

3.3 KiB

Usage

The UDP notifier function of WLED makes it easy to sync multiple lights to the same color/effect, enabled by default. You can set the specific behavior of it in Sync settings, also you can choose if all aspects or only brightness/color/effects are applied.

Additionally, there is a quick toggle for it in both UIs:

Classic UI: The button with the two circular arrows control the sync feature. If the top arrow is lit, the software will accept sync packets from other WLED devices, if the bottom arrow is lit, it will send own changes to other devices.

Mobile UI: There is a "Sync Lights" toggle. It will only change whether changes of the current device will be sent to other devices. Sync packets from other ESPs will be received unless disabled in the settings.

You can easily group WLED devices (for example all in one room) by changing the UDP port of all devices you want in that group.

Protocol description

When enabled, the module where a value was changed will send an UDP broadcast to a port (default 21324). Other modules that listen on this port will set themselves to the same color.

For interoperability, the protocol was designed so that even modules with different WLED versions can sync. Therefore, if a WLED 0.4 system receives a WLED 0.3 UDP notification it will apply the primary color but keep its current secondary color.

The UDP packet is currently 24 bytes long. It is laid out in the following:

Byte Index Var Name Description Notifier Version
0 - Packet Purpose Byte* 0
1 callMode Packet Reason** 0
2 bri Master Brightness 0
3 col[0] Primary Red Value 0
4 col[1] Primary Green Value 0
5 col[2] Primary Blue Value 0
6 nightlightActive Nightlight running? 0
7 nightlightDelayMins Nightlight Time 0
8 effectCurrent Effect Index 0
9 effectSpeed Effect Speed 0
10 white Primary White Value 1
11 - Version Byte*** 1
12 colSec[0] Secondary Red Value 2
13 colSec[1] Secondary Green Value 2
14 colSec[2] Secondary Blue Value 2
15 whiteSec Secondary White Value 2
16 effectIntensity Effect Intensity 3
17 transitionDelay Transition Duration Upper 4
18 transitionDelay Transition Duration Lower 4
19 effectPalette FastLED palette 5
20-23 - Zeros -

*The notifier protocol is only used if this byte is 0. Otherwise, one of the UDP Realtime protocols will be used.

**The callMode variable specifies the reason for the notification. Every color update has the potential to trigger a notification.

callMode Description Behavior
0 Initial Boot Do not notify
1 Direct Change via UI or API notifyDirect?
2 Button was pressed notifyButton?
3 Update by other notification Do not notify
4 Nightlight activated notifyDirect?
5 Other (Req. with &NN) Do not notify
6 Effect changed notifyDirect?
7 Hue light changed notifyHue?
8 Preset Cycle active notifyDirect?
9 Updated via Blynk notifyDirect?

***This is the version of the UDP protocol.

UDP Version Description WLED Version
0 Basic Support 0.3
1 White Value supported 0.4p
2 Secondary Color supported 0.4
3 Effect Intensity supported 0.5.0
4 Transition Time supported 0.6.0
5 Palettes supported 0.8.0