-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HTTP request API
Aircoookie edited this page Jan 10, 2018
·
66 revisions
WLED's HTTP API allows you to set many properties of your lights, even more than the index page UI supports, via a simple GET web request.
The basic URL scheme is: "[ipadress]/win". This will return an XML file with some current values. Parameters can be added to control some of the variables.
- Example (AP): 192.168.4.1/win&A=255 sets the brightness to maximum
- Example (mdns): led.local/win&A=255&FX=0 sets the brightness to maximum and the effect to static
In conjunction with a router port forwarding this can be used to automate WLED, for example via IFTTT.
Add one or multiple of the following parameters after the base URL/IP to change values: (if the parameter is unknown or the value illegal nothing will happen)
| Parameter | Value Range | Description | Since Version |
|---|---|---|---|
| &A= | 0 to 255 | Master brightness | 0.2 |
| &T= | 0, 1, or 2 | Master On/Off/Toggle | 0.3 |
| &R= | 0 to 255 | Primary Red value | 0.2 |
| &G= | 0 to 255 | Primary Green value | 0.2 |
| &B= | 0 to 255 | Primary Blue value | 0.2 |
| &W= | 0 to 255 | Primary White value | 0.4 |
| &FX= | 0 to 57 | LED Effect Index | 0.3 |
| &SX= | 0 to 255 | Effect Speed | 0.3 |
| &NL= | 0 or 1 | Nightlight function | 0.3 |
| Parameter | Value Range | Description | Since Version |
|---|---|---|---|
| &R2= | 0 to 255 | Secondary Red value | 0.4 |
| &G2= | 0 to 255 | Secondary Green value | 0.4 |
| &B2= | 0 to 255 | Secondary Blue value | 0.4 |
| &W2= | 0 to 255 | Secondary White value | 0.4 |
| &SR= | 0 or 1 | Set Primary/Secondary color to random hue | 0.4 |
| &SW | none | Set secondary color to white | 0.4 |
| &SB | none | Set secondary color to black | 0.4 |
| &SP | none | Set secondary color to primary | 0.4 |
| &SC | none | Swap primary and secondary color | 0.4 |
| Parameter | Value Range | Description | Since Version |
|---|---|---|---|
| &RN= | 0 or 1 | Receive UDP Notifications | 0.3 |
| &SN= | 0 or 1 | Send UDP Notifications | 0.3 |
| &NN | none | No notification for this request | 0.3 |
| Parameter | Value Range | Description | Since Version |
|---|---|---|---|
| &PS= | 0 to 25 | Saves current setup to preset | 0.4 |
| &PL= | 0 to 25 | Applies entire preset | 0.4 |
| &PA= | 0 to 25 | Applies brightness from preset | 0.4 |
| &PC= | 0 to 25 | Applies colors from preset | 0.4 |
| &PX= | 0 to 25 | Applies effects from preset | 0.4 |
To see an effect you need to have one of the effects 53-57!
| Parameter | Value Range | Description | Since Version |
|---|---|---|---|
| &CP= | 0 to 255 | Number of primary color LEDs | 0.4 |
| &CS= | 0 to 255 | Number of secondary color LEDs | 0.4 |
| &CM= | 0 to 255 | Number of steps per tick | 0.4 |
| &CF= | 0 or 1 | Clockwise Effect | 0.4 |
| &CE= | 0 or 1 | Anti-Clockwise Effect | 0.4 |
| &C1= | 0 to 255 | First LED index | 0.4 |
| &C2= | 0 to 255 | Last LED index | 0.4 |
| &C0= | 0 to 255 | Starting point, not implemented | 0.4 |
| Parameter | Value Range | Description | Since Version |
|---|---|---|---|
| &ST= | 32bit | Current UTC time in Unix epoch | 0.4 |
| &MD= | 0 or 1 | Set slider mode to RGB/HSB | 0.3 |
| &AX= | 0 to 255 | Debug feature, can be configured for general IO | 0.3 |
| &IN | none | Server will not respond to this request (internal) | 0.3 |
| &OL= | 0 to 255 | Experimental overlays | 0.3 |
| &I= | 0 to 255 | Set pixel to current color | 0.3 |
| &I2= | 0 to 255 | Set pixel range I to I2 to current color | 0.3 |
| &L= | 0 to 255 | Lock pixel | 0.4 |
| &L2= | 0 to 255 | Lock pixel range L to L2 | 0.4 |
| &UL | none | Unlock instead (used in conjunction with L and L2) | 0.4 |
- List of effects and palettes
- Macros & Button
- Multi strip
- Presets
- Segments
- Webserver sitemap
- Control a relay
- Blynk
- DMX Output
- E1.31 (DMX) / Art-Net
- UDP Realtime / tpm2.net
- HTTP Request API
- Infrared
- JSON API
- MQTT
- Philips hue sync
- WebSocket
- WLED UDP sync