-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Macros
See Presets for 0.11.0+.
You are able to set custom actions ("Macros") in Time & Macro settings for the following events:
- Specific time of day
- Button short/long/double press
- HTTP API call executing a macro with "&M="
- Alexa On/Off
- Countdown over
- Timed light duration over
- Device (re)boot (up to 0.10.2, use LED settings
Boot preset
in 0.11)
Each macro has the format of a standard HTTP API call without the IP. Optionally, the "win&" may be omitted. For example, the macro "A=255" sets the brightness to maximum. "R=255&G=160&B=0" sets the color to orange. You can specify up to 16 macros. (up to 250 in WLED 0.11 since the Macro functionality has been merged into the Presets feature)
Examples of how to use API-calls and define macros can be found in this issue and in this one.
The simplest macro example is getting a button to do your bidding. The default pin to which a button can be connected is GPIO 0 (D3 on NodeMCU, D1 Mini and others). This pin is ideally pulled high to 3.3V with a 10k resistor and the configured macro executes when the pin is pulled low (grounded). The desired macro is entered on the Time/Macros configuration page and then assigned to a short, long or double press. Like this: The "T=2" macro toggles power to the LEDs (in this case long press). The "FX=~" macro steps through the effects (in this case short press).
The default (built-in) actions are short-press: toggle on/off and long-press: select random color.
Starting in WLED 0.13, analog "buttons" (e.g. a potentiometer) are supported.
Set the Double
column in Button Actions to one of these values to configure:
Property | Value |
---|---|
Global brightness | 250 |
Effect speed | 249 |
Effect intensity | 248 |
Palette | 247 |
Primary color hue | 200 |
Segment N opacity | 0-32 |
- 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