-
Notifications
You must be signed in to change notification settings - Fork 30
WebSocket API (V3.1)
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 0000), e.g. 0004 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 0000), e.g. 0004 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 0000). 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: R0000000900ffffffR0010001900ff0000 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
Gets the list of available animation modes as JSON.
Result:
[
{
"mode":"off",
"name":"OFF"
},
{
"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.) -
on
(Turn all LEDs on to last state.) This does not work for Custom WS Mode
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 transition effect option.
Where <transitionEffect>
is a boolean 0 or 1.
Result:
Will be same as C
Get segment state info as JSON.
Result:
{
"start":72,
"stop":143,
"fx_mode":61,
"speed":0,
"color":[0,0,11,255,0,255,0,13,0,0,0,0],
"ws_fxopt":48
}
Set the active strip segment.
Where <segment>
is an integer between 0-9.
Result:
Will be same as S
Set the first LED of the active strip segment, starting with 0 for first LED.
Where <start>
is an integer between 0-.
Result:
Will be same as S
Set the last LED of the active strip segment.
Where <stop>
is an integer between -.
Result:
Will be same as S
Set the strips ws2812fx options.
Where <segment_fx_options>
is an integer between 0-255.
See WS2812FX documentation for more infos.
Result:
Will be same as S