-
Notifications
You must be signed in to change notification settings - Fork 30
WebSocket API (V2)
The WebSocket server runs at ws://ESP_IP_ADDRESS_OR_HOSTNAME:81/
Set main color of the strip.
Where <hexrgb>
is the color as a WRGB hex value, e.g. 0004d2ff
.
Result: OK
Set background color of the strip.
Where <hexrgb>
is the color as a WRGB hex value, e.g. 0004d2ff
.
Result: OK
Set extra color of the strip.
Where <hexrgb>
is the color as a WRGB hex value, e.g. 0004d2ff
.
Result: OK
Set main color of the strip and light all LEDs in that color. This is equal to WS2812FX mode "Static".
Where <hexrgb>
is the color as a WRGB hex value, e.g. 0004d2ff
.
Result: OK
Where <numled>
is the number of the led (start index is 00), e.g. 04 would be the 5th LED. Where <hexrgb>
is the color as a WRGB hex value, e.g. 0004d2ff
.
Light single LEDs in the given color.
Result: OK
Where <numled>
is the number of the led (start index is 00), e.g. 04 would be the 5th LED. Where <hexrgb>
is the color as a WRGB hex value, e.g. 0004d2ff
.
Light multiple LEDs in the given colors.
Result: OK
Light multiple LED ranges in the given colors.
Where <r_start> is the first index of the range (start index is 00). Where <r_end> is the last index of the range. Where is the color as a WRGB hex value, e.g. 0004d2ff
.
This command can be daisy chained!
Example: R000900ffffffR101900ff0000 lights the first 10 LEDs white and the next 10 red Result: OK
Set speed.
Where <speed>
is the speed from 0 to 255.
Result: OK
Set brightness.
Where <brightness>
is the brightness as value 0-255.
Result: OK
Set named mode. This is only available, if define ENABLE_LEGACY_ANIMATIONS
in definitions.h
is set.
Where <lightmode>
is one of the following:
-
off
(Turn all LEDs off.) -
auto
(Starts autocycling.) -
tv
(Starts TV simulator. This is only available, ifdefine ENABLE_TV
indefinitions.h
is set.) -
e131
(Starts E1.31 Mode. This is only available, ifdefine ENABLE_E131
indefinitions.h
is set.) -
all
(Turn all LEDs on in the given or previously set color.) -
wipe
(Turn all LEDs on in the given or previously set color, with wipe effect.) -
rainbow
(Starts rainbow effect.) -
rainbowCycle
(Starts rainbow cycle effect.) -
twinklerandom
(Starts twinklerandom effect in the given or previously set color.) -
theaterchase
(Starts theaterchase effect in the given or previously set color.) -
theaterchaseRainbow
(Starts theaterchase effect with changing colors.) Result: OK
Only available in version 2.0 and later
Gets the list of available animation modes as JSON.
Result:
[
{
"mode":"off",
"name":"OFF"
},
{
"mode":"tv",
"name":"TV"
},
{
"mode":"e131",
"name":"E131"
},
{
"mode":"custom",
"name":"CUSTOM WS"
},
{
"mode": 0,
"name": "Static"
},
{
"mode": 1,
"name": "Blink"
},
{
"mode": 2,
"name": "Breath"
},
...
]
Only available in version 2.0 and later
Set animation mode.
Where <animation_mode_id> is on from the list you get with "~" or
-
off
(Turn all LEDs off.) -
auto
(Starts autocycling.) -
tv
(Starts TV simulator. This is only available, ifdefine ENABLE_TV
indefinitions.h
is set.) -
e131
(Starts E1.31 Mode. This is only available, ifdefine ENABLE_E131
indefinitions.h
is set.)
Result: OK
Get status info as JSON.
Result:
{
"mode":5,
"ws2812fx_mode":0,
"ws2812fx_mode_name":"Static",
"speed":255,
"brightness":43,
"color":[0,255,57,0,0,0,0,0,0,0,0,0]
}
Get config info as JSON.
Result:
{
"hostname":"McLightingRGBW",
"mqtt_host":"192.168.0.10",
"mqtt_port":1883,
"mqtt_user":"mqtt_user",
"mqtt_pass":"mqtt-passw0rd",
"ws_cnt":194,
"ws_rgbo":"GRBW",
"ws_pin":3,
"ws_fxopt":48
}
Set Hostname.
Where <hostname>
is a hostname or IP with a length from 0-64 chars.
Result:
Will be same as C
Set MQTT Server Hostname.
Where <mqtt_hostname>
is a hostname or IP with a length from 0-64 chars.
Result:
Will be same as C
Set MQTT Server Port.
Where <mqtt_port>
is an integer from 0-65535.
Result:
Will be same as C
Set MQTT Server username.
Where <mqtt_user>
is a username length from 0-32 chars.
Result:
Will be same as C
Set MQTT Server password.
Where <mqtt_pass>
is a password length from 0-32 chars.
Result:
Will be same as C
Set the strips led count.
Where <strip_led_count>
is an integer between 1-9999.
Result:
Will be same as C
Set the strips ws2812fx options.
It is only available, if USE_WS2812FX_DMA
is not defined in definitions.h
Where <strip_gpio_pin>
is an integer between 0-99.
Allowed values for NodeMCU or Wemos are values from 0-5 and 12-16.
Result:
Will be same as C
Set the strips led order.
Where <strip_rgborder>
is any combination of the chars r
, g
, b
and w
.
Every char is only allowed once,
<strip_rgborder>
must contain r
, g
, b
,
and can contain w
.
Result:
Will be same as C
Set the strips ws2812fx options.
Where <strip_fx_options>
is an integer between 0-255.
See WS2812FX documentation for more infos.
Result:
Will be same as C