LedStrip
The LedStrip component controls addressable LED strips and matrices with an integrated effects engine. It supports a wide range of LED protocols (WS2812, WS2812B, WS2811, SK6812, WS2811_W, SK9822) and provides real-time control via RPC, MQTT, WebSocket, and JavaScript scripting. The component includes effects playback, color control, brightness adjustment, and optional audio analyzer integration for sound-reactive effects. It uses LedStrip as RPC namespace and provides the methods:
LedStrip.GetConfigto obtain the component's configurationLedStrip.SetConfigto update the component's configurationLedStrip.GetStatusto obtain the component's statusLedStrip.Setto control the output state, brightness level, colors, and effectsLedStrip.Toggleto toggle the LED strip on/offLedStrip.ResetEffectto reset effect parameters to defaultsLedStrip.ListAllEffectsto list available effectsLedStrip.ListAllPalettesto list available color palettesLedStrip.AddEffectto add an effect to the effects listLedStrip.RemoveEffectto remove an effect from the effects listLedStrip.NextEffectto switch to the next effectLedStrip.ListAllProtocolsto list available LED protocols (not available on all devices)LedStrip.TestColorsto test LED colors (not available on all devices)
LedStrip components are identified with ledstrip:<id> in objects containing multiple component payloads.
Methods
LedStrip.SetConfig
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
LedStrip.GetConfig
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
Find the LedStrip.GetConfig response properties in config section
LedStrip.GetStatus
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
Find more about the status response properties in status section
LedStrip.Set
This method sets the output state, brightness, colors, and active effect. It can be used to trigger automations via LNM and webhooks.
Request
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance. Required |
| boolean | True for LED on, false otherwise. Optional |
| number | Brightness level 0%-100%. Optional |
| array | RGB color as array [r, g, b] with values 0-255 (e.g., [255, 0, 0] for red). Optional |
| number | Red channel 0-255. Optional |
| number | Green channel 0-255. Optional |
| number | Blue channel 0-255. Optional |
| array | Background RGB color as array [r, g, b] with values 0-255. Optional |
| number | Background red channel 0-255. Optional |
| number | Background green channel 0-255. Optional |
| number | Background blue channel 0-255. Optional |
| string | Effect key (e.g., "solid", "rainbow"). Optional |
| number | Effect speed 0-100. Optional |
| number | Effect intensity 0-100. Optional |
| string | Palette name (e.g., "fire", "rainbow"). Optional |
| boolean | Reverse effect direction. Optional |
| number | Transition time in seconds for color/brightness changes. Optional |
| number | Audio analyzer gain 0-100 (for devices with audio analyzer). Optional |
| boolean | Audio analyzer auto-gain normalization (for devices with audio analyzer). Optional |
| string or null | Up to 20 characters used to identify the origin of a state change. Optional |
At least one of the parameters (on, brightness, rgb/r/g/b, effect, speed, intensity, palette, or reverse) is required.
LedStrip.Toggle
Toggle the LED strip on/off. If the strip is currently on, it will turn off; if it is off, it will turn on.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance. Required |
LedStrip.ResetEffect
Resets effect parameters (speed, intensity, palette, reverse, colors) to their default values for the current effect.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance. Required |
LedStrip.ListAllEffects
List all available effects for the LED strip. Effects can be built-in or user-defined via scripts.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
| number | Pagination offset. Optional |
Response:
| Property | Type | Description |
|---|---|---|
| array | Array of available effects with key, name, description, and controls |
LedStrip.ListAllPalettes
List all available color palettes.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
| number | Pagination offset. Optional |
| array | Preview color for generative palettes as array [r, g, b] with values 0-255 (e.g., [255, 0, 0]). Optional |
Response:
| Property | Type | Description |
|---|---|---|
| array | Array of available palettes with key, name, colors, and metadata |
LedStrip.AddEffect
Add an effect to the effects list.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
| string | Effect key to add. Must be a built-in effect or script effect (format: "script:N") |
LedStrip.RemoveEffect
Remove an effect from the effects list.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
| string | Effect key to remove |
LedStrip.NextEffect
Switch to the next effect in the effects list.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
LedStrip.ListAllProtocols
Not available on all devices. Only available when LED protocol is configurable (not fixed by hardware).
List all available LED protocols supported by the hardware.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
Response:
| Property | Type | Description |
|---|---|---|
| array | Array of available protocols with id, key, and name |
LedStrip.TestColors
Not available on all devices. Only available when color order is configurable (not fixed by hardware).
Test LED colors by cycling through red, green, blue, and white at 25% brightness.
Parameters:
| Property | Type | Description |
|---|---|---|
| number | Id of the LedStrip component instance |
Configuration
| Property | Type | Description |
|---|---|---|
| string | Display name of the LED strip |
| boolean | Enable or disable the LED strip |
| integer | Number of LEDs per module (1-1024). Fixed on some devices. |
| integer | Number of cascaded LED modules (1-256). Fixed on some devices. Total LED count: num_leds × num_modules |
| integer | LED protocol: 0=WS2812, 1=WS2812B (default), 2=WS2811, 3=SK6812, 4=WS2811_W, 5=SK9822 |
| string | Color order for LED protocol. One of: default, rgb, grb, brg, rbg, gbr, bgr. Default depends on protocol. |
| integer | State on boot: 0=Off, 1=On, 2=Restore last (default), 3=Toggle |
| string | Comma-separated list of effect keys (built-in and script effects) |
| integer | Effect update interval in milliseconds (default: 33ms = 30 FPS) |
| integer | DDP (Distributed Display Protocol) UDP listen port for external pixel control. Set to 0 to disable (default). |
Status
| Property | Type | Description |
|---|---|---|
| number | ID of the LedStrip component instance |
| boolean | Whether the LED strip is on |
| number | Current brightness 0-100% |
| array | Current RGB color as array [r, g, b] with values 0-255 |
| number | Red channel current value 0-255 |
| number | Green channel current value 0-255 |
| number | Blue channel current value 0-255 |
| array | Background RGB color as array [r, g, b] with values 0-255 |
| number | Background red channel 0-255 |
| number | Background green channel 0-255 |
| number | Background blue channel 0-255 |
| string | Currently active effect key |
| number | Effect speed 0-100 |
| number | Effect intensity 0-100 |
| string | Current palette name |
| boolean | Effect direction reversed |
| number | Active power in watts (if power monitoring is available) |
| number | Internal temperature in Celsius (if temperature sensor is available) |
Effects
The LED strip supports a variety of built-in effects and user-defined effects created via JavaScript. Built-in effects provide different visual patterns and animations. The list of available effects may vary by device and firmware version.
For devices with integrated microphones, audio-reactive effects are available that respond to sound input.
Custom effects can be created using JavaScript and registered as script effects with the @meta metadata format. See the LedStrip JavaScript API documentation for details on scripting and audio analyzer integration.
Palettes
The LED strip includes a palette system for color gradients. Palettes are used by some effects to create smooth color transitions and gradients. Both static predefined palettes and generative palettes (which create gradients based on the current RGB color) are available. The specific set of available palettes may vary by firmware version.
Errors
The LedStrip component can report the following error conditions:
| Property | Type | Description |
|---|---|---|
| error | Temperature protection detected overheat condition and triggered safety cutoff. This occurs when internal LED temperature exceeds safe limits. Power is cut to the LED strip via the power GPIO until the device cools down. |
Temperature protection with safety cutoff is only available on devices with integrated temperature sensors.
Webhook Events
The LedStrip component supports the following webhook events:
ledstrip.on- produced when the LED strip turns on (brightness > 0)ledstrip.off- produced when the LED strip turns off (brightness = 0 or on = false)
These events can be used to trigger automations and integrations through the webhook system.
Examples
- LedStrip.GetStatus HTTP GET Request
- LedStrip.GetStatus Curl Request
- LedStrip.GetStatus Mos Request
http://192.168.33.1/rpc/LedStrip.GetStatus?id=0
curl -X POST -d '{"id":1,"method":"LedStrip.GetStatus","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call LedStrip.GetStatus '{"id":0}'
Response
- LedStrip.GetStatus HTTP GET Response
- LedStrip.GetStatus Curl Response
- LedStrip.GetStatus Mos Response
{
"id": 0,
"on": true,
"brightness": 80,
"rgb": [
255,
0,
255
],
"r": 255,
"g": 0,
"b": 255,
"bg_rgb": [
0,
0,
0
],
"bg_r": 0,
"bg_g": 0,
"bg_b": 0,
"effect": "rainbow",
"speed": 50,
"intensity": 75,
"palette": "rainbow",
"reverse": false
}
{
"id": 1,
"params": {
"id": 0,
"on": true,
"brightness": 80,
"rgb": [
255,
0,
255
],
"r": 255,
"g": 0,
"b": 255,
"bg_rgb": [
0,
0,
0
],
"bg_r": 0,
"bg_g": 0,
"bg_b": 0,
"effect": "rainbow",
"speed": 50,
"intensity": 75,
"palette": "rainbow",
"reverse": false
}
}
{
"id": 0,
"on": true,
"brightness": 80,
"rgb": [
255,
0,
255
],
"r": 255,
"g": 0,
"b": 255,
"bg_rgb": [
0,
0,
0
],
"bg_r": 0,
"bg_g": 0,
"bg_b": 0,
"effect": "rainbow",
"speed": 50,
"intensity": 75,
"palette": "rainbow",
"reverse": false
}
- LedStrip.Set HTTP GET Request
- LedStrip.Set Curl Request
- LedStrip.Set Mos Request
http://192.168.33.1/rpc/LedStrip.Set?id=0&on=true&brightness=100&rgb=[0,0,255]
curl -X POST -d '{"id":1,"method":"LedStrip.Set","params":{"id":0,"on":true,"brightness":100,"rgb":[0,0,255]}}' http://${SHELLY}/rpc
mos --port ${PORT} call LedStrip.Set '{"id":0,"on":true,"brightness":100,"rgb":[0,0,255]}'
- LedStrip.Set HTTP GET Request
- LedStrip.Set Curl Request
- LedStrip.Set Mos Request
http://192.168.33.1/rpc/LedStrip.Set?id=0&effect="rainbow"&speed=60&intensity=80
curl -X POST -d '{"id":1,"method":"LedStrip.Set","params":{"id":0,"effect":"rainbow","speed":60,"intensity":80}}' http://${SHELLY}/rpc
mos --port ${PORT} call LedStrip.Set '{"id":0,"effect":"rainbow","speed":60,"intensity":80}'
- LedStrip.Toggle HTTP GET Request
- LedStrip.Toggle Curl Request
- LedStrip.Toggle Mos Request
http://192.168.33.1/rpc/LedStrip.Toggle?id=0
curl -X POST -d '{"id":1,"method":"LedStrip.Toggle","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call LedStrip.Toggle '{"id":0}'
- LedStrip.ListAllEffects HTTP GET Request
- LedStrip.ListAllEffects Curl Request
- LedStrip.ListAllEffects Mos Request
http://192.168.33.1/rpc/LedStrip.ListAllEffects?id=0
curl -X POST -d '{"id":1,"method":"LedStrip.ListAllEffects","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call LedStrip.ListAllEffects '{"id":0}'
Response
- LedStrip.ListAllEffects HTTP GET Response
- LedStrip.ListAllEffects Curl Response
- LedStrip.ListAllEffects Mos Response
{
"effects": [
{
"key": "solid",
"name": "Solid",
"description": "Static color display"
},
{
"key": "rainbow",
"name": "Rainbow",
"description": "Rainbow color gradient animation"
}
]
}
{
"id": 1,
"params": {
"effects": [
{
"key": "solid",
"name": "Solid",
"description": "Static color display"
},
{
"key": "rainbow",
"name": "Rainbow",
"description": "Rainbow color gradient animation"
}
]
}
}
{
"effects": [
{
"key": "solid",
"name": "Solid",
"description": "Static color display"
},
{
"key": "rainbow",
"name": "Rainbow",
"description": "Rainbow color gradient animation"
}
]
}