### Manage WLED Presets via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example shows how to save, apply, and cycle through WLED presets. 'PS' saves the current configuration to a preset, 'PL' applies a preset, and 'P1'/'P2' define the range for preset cycling. 'TT' sets the transition time. ```http GET /win&PS=5 HTTP/1.1 Host: [ipaddress] ``` ```http GET /win&PL=5 HTTP/1.1 Host: [ipaddress] ``` ```http GET /win&P1=1&P2=10&TT=1000 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### Apply WLED Macro via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example demonstrates how to apply a macro to the WLED device. The 'M' parameter accepts a macro number from 1 to 16. Note that this parameter is deprecated but included for compatibility with older automations. ```http GET /win&M=3 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### Toggle WLED Light with CURL Example Source: https://kno.wled.ge/interfaces/json-api A CURL command example demonstrating how to toggle the WLED light on or off and retrieve the updated state using a POST request to `/json/state`. This example is applicable for WLED versions 0.13 and later. ```bash curl -X POST "http://[WLED-IP]/json/state" -d '{"on":"t","v":true}' -H "Content-Type: application/json" ``` -------------------------------- ### WLED Macro Examples (HTTP API) Source: https://kno.wled.ge/features/macros Examples of WLED macros using HTTP API calls. Macros can be chained and control various aspects of LED behavior such as brightness, color, and effects. The 'win&' prefix is optional. ```http A=255 R=255&G=160&B=0 T=2 FX=~ ``` -------------------------------- ### Set WLED Effect and Brightness via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example shows how to simultaneously set the brightness and LED effect of WLED lights. It uses the 'A' parameter for brightness and 'FX' for the effect index. This combined control is useful for dynamic lighting scenes. ```http GET /win&A=128&FX=0 HTTP/1.1 Host: led.local ``` -------------------------------- ### Install WLED Dependencies Source: https://kno.wled.ge/advanced/compiling-wled Installs all necessary project dependencies for WLED using npm. This command should be executed after cloning the repository and navigating into the WLED directory. Requires Node.js 20 or higher. ```bash npm install ``` -------------------------------- ### Flash WLED Binary to ESP8266 using esptool.py Source: https://kno.wled.ge/basics/install-binary This command flashes the WLED binary to an ESP8266 microcontroller. Ensure esptool.py is installed and the correct binary file is downloaded. Only one ESP device should be connected to avoid accidental overwrites. ```bash esptool.py write_flash 0x0 ./WLED_XXX.bin ``` -------------------------------- ### Example Sensor Object Structure (JSON) Source: https://kno.wled.ge/interfaces/json-api This example demonstrates the structure of a single sensor object within the 'info.sensor' array. It shows a temperature sensor with its type, name, and current value. ```json { "type": "T", "n": "Outside", "val": 12 } ``` -------------------------------- ### Control WLED Brightness via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example demonstrates how to set the master brightness of WLED lights using an HTTP GET request. The brightness can be set to a value between 0 and 255. This functionality is available since version 0.2. ```http GET /win&A=255 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### Backing up ESP32-C3 Firmware with esptool.py Source: https://kno.wled.ge/basics/compatible-controllers This command illustrates how to create a backup of the existing firmware on an ESP32-C3 controller using `esptool.py`. This is a critical step before attempting to flash new firmware, especially on devices with potential encryption. The output file will contain the entire flash content. ```bash esptool.py read_flash 0 0x400000 sp530e-encrypted.bin ``` -------------------------------- ### WLED Basic Status Request Source: https://kno.wled.ge/interfaces/http-api This example shows a basic HTTP GET request to the WLED API to retrieve the current status and values of the lights. The response is typically in XML format. ```http GET /win HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### Flash ESP32 Bootloader and WLED Binary using esptool.py Source: https://kno.wled.ge/basics/install-binary This process involves two steps for ESP32 devices. First, flash the version 4 bootloader, which only needs to be done once. Second, flash the actual firmware binary with a different offset. Ensure the boot button is held if prompted during connection. ```bash esptool.py write_flash 0x0 ./esp32_bootloader_v4.bin ``` ```bash esptool.py write_flash 0x10000 ./WLED_XXX.bin ``` -------------------------------- ### Control WLED Loxone RGB Values via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example shows how to set the primary and secondary colors using Loxone-compatible RGB values. The 'LX' and 'LY' parameters accept a BBBGGGRRR format where each color component is 0-100%. ```http GET /win&LX=100070030 HTTP/1.1 Host: [ipaddress] ``` ```http GET /win&LY=030070100 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### Control WLED Effect Speed and Intensity via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example demonstrates adjusting the speed and intensity of the selected LED effect. The 'SX' parameter controls the effect speed (0-255), and 'IX' controls the effect intensity (0-255). ```http GET /win&SX=100&IX=50 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### Apply FastLED Palette via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example shows how to apply a specific FastLED color palette to the WLED effect. The 'FP' parameter accepts values from 0 to 46, corresponding to different palettes. Available since version 0.8.0. ```http GET /win&FP=20 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### Control WLED Primary Color via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example demonstrates controlling the primary Red, Green, and Blue (RGB) values of the WLED lights. Each color channel can be set independently from 0 to 255. This allows for precise color customization. ```http GET /win&R=255&G=0&B=0 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### WLED Preset Chaining Macro Source: https://kno.wled.ge/features/macros An example of a macro that steps through multiple presets. This allows a single button press to cycle through a defined sequence of preset configurations. ```http P1=1&P2=3&PL=~ ``` -------------------------------- ### Randomize and Swap WLED Colors via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example shows how to set primary/secondary colors to random hues using the 'SR' parameter (0 or 1) or swap them using the 'SC' parameter. These commands are useful for dynamic and unpredictable color sequences. ```http GET /win&SR=1 HTTP/1.1 Host: [ipaddress] ``` ```http GET /win&SC HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### General and Experimental Settings API Source: https://kno.wled.ge/interfaces/http-api Configure general device settings and access experimental features. ```APIDOC ## General and Experimental Settings API ### Description Allows modification of general WLED device parameters and experimental features. ### Method GET (or POST, depending on context, typically used with query parameters) ### Endpoint `/` (Root of the WLED device, parameters are appended as query strings) ### Parameters #### Query Parameters - **&RB** (none) - Reboot WLED device. - **&ST** (32bit) - Set current UTC time in Unix epoch. - **&CT** (32bit) - Set UTC time for countdown end. - **&MD** (integer: 0 or 1) - Set slider mode to RGB/HSB. - **&AX** (integer: 0-255) - Debug feature, can be configured for general IO. - **&IN** (none) - Server will not respond to this request (internal). - **&OL** (integer: 0-255) - Experimental overlays. - **&L** (integer: 0-255) - Lock pixel. - **&L2** (integer: 0-255) - Lock pixel range L to L2. - **&UL** (none) - Unlock instead (used in conjunction with L and L2). - **&NX** (String: 1-6) - Cronixie clockface. - **&NM** (integer: 0 or 1) - Cronixie Time or Countdown mode. - **&NB** (integer: 0 or 1) - Cronixie Backlight. - **&IT** (none) - Include UI color theme in API response. - **&RD** (integer: 0 or 1) - Toggle realtime UDP. - **&LO** (integer: 0-2) - Live data override. 0 is off, 1 is override until live data ends, 2 is override until ESP reboot. - **&NP** (none) - Advance to the next preset in a playlist. ### Request Example ``` http:///?&RB=1 http:///?&ST=1678886400 http:///?&MD=1 http:///?&NP=1 ``` ### Response #### Success Response (200 OK) XML response detailing the current state of the WLED device. #### Response Example ```xml WLED0.13.0
    1
11100100000
  • 0

  • 102550000010100001000000000000000000000000000000000000
    000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
      0
    000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    00000WLED011000011012802550255255,0,00,0,0
    ``` ``` -------------------------------- ### Control WLED Nightlight via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example demonstrates how to control the WLED nightlight feature. The 'NL' parameter sets the duration in minutes, 'ND' toggles it on with a default duration, 'NT' sets the target brightness, and 'NF' controls fading behavior. ```http GET /win&NL=30&NT=100 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### General and Experimental WLED API Settings Source: https://kno.wled.ge/interfaces/http-api This section details general and experimental parameters for the WLED API. It includes rebooting, setting time, slider modes, debug features, internal server commands, experimental overlays, locking pixels, unlocking pixels, Cronixie clockface settings, backlight control, UI theme inclusion, real-time UDP toggle, live data override, and advancing to the next preset. ```URL Parameters &RB &ST=32bit &CT=32bit &MD=0 or 1 &AX=0 to 255 &IN &OL=0 to 255 &L=0 to 255 &L2=0 to 255 &UL &NX=String 1..6 &NM=0 or 1 &NB=0 or 1 &IT &RD=0 or 1 &LO=0-2 &NP ``` -------------------------------- ### WLED HTTP API - Loxone Commands Source: https://kno.wled.ge/interfaces/http-api Documentation for Loxone-specific commands used to control RGB values, brightness, and color temperature. ```APIDOC ## GET /win (Loxone Commands) ### Description Control WLED devices using Loxone-specific commands for RGB values, brightness, and color temperature. ### Method GET ### Endpoint `[ipaddress]/win` ### Parameters #### Query Parameters - **LX** (BBBGGGRRR or 20bbbtttt) - Required - Loxone command for primary color. - RGB: `BBBGGGRRR` (0-100% for each color component). - Brightness & Color Temp: `20bbbtttt` (brightness 0-100%, temp 2700-6500K). - **LY** (BBBGGGRRR or 20bbbtttt) - Required - Loxone command for secondary color. - RGB: `BBBGGGRRR` (0-100% for each color component). - Brightness & Color Temp: `20bbbtttt` (brightness 0-100%, temp 2700-6500K). ### Request Example `GET /win?LX=100100100` (Loxone command for full red) `GET /win?LX=201005000` (Loxone command for 100% brightness, 5000K temp) ### Response #### Success Response (200) An XML response confirming the Loxone command execution. #### Response Example ```xml success ... ``` ``` -------------------------------- ### Configure WLED Notifications via HTTP GET Source: https://kno.wled.ge/interfaces/http-api This example demonstrates how to manage UDP notifications for WLED. 'RN' enables receiving notifications, 'SN' enables sending them, and 'NN' disables notifications for the current request. 'HP' sets the Hue polling light ID. ```http GET /win&RN=1&SN=1 HTTP/1.1 Host: [ipaddress] ``` -------------------------------- ### WLED API Commands for Presets Source: https://kno.wled.ge/features/presets Examples of HTTP and JSON API commands that can be embedded within WLED presets to control various aspects of the lighting. These commands enable functionality like toggling power, setting brightness, changing colors, applying effects, and iterating through other presets. ```http T=2 ``` ```json {"on":"t"} ``` ```http T=1 ``` ```json {"on":true} ``` ```http T=0 ``` ```json {"on":false} ``` ```json {"on":true, "tt":0} ``` ```http A=128 ``` ```json {"bri": 128} ``` ```http A=~10 ``` ```json {"bri":"~10"} ``` ```http A=~-20 ``` ```json {"bri":"~-10"} ``` ```http R=255&G=0&B=0 ``` ```json {"seg":[{"col":[[255,0,0]]}]} ``` ```http R=0&G=255&B=0&A=128&FX=0 ``` ```json {"seg":[{"fx":0, "col":[[0,255,0]]}], "bri":128} ``` ```http P1=1&P2=3&PL=~ ``` ```json {"ps":"1~ 3~"} ```