-
Notifications
You must be signed in to change notification settings - Fork 285
WebSocket API
The WebSocket server runs at
ws://ESP_IP_ADDRESS_OR_HOSTNAME:81/
Set default color of the lamp.
Where <hexrgb> is the color as a hex value, e.g. 04d2ff.
Result: OK
Set default color of the lamp and light all LEDs in that color.
Where <hexrgb> is the color as a hex value, e.g. 04d2ff.
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 hex value, e.g. 04d2ff.
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 hex value, e.g. 04d2ff.
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 <hexrgb> is the color as a hex value, e.g. 04d2ff.
This command can be daisy chained!
Example: R0009ffffffR1019ff0000 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 mode.
Where <lightmode> is one of the following:
-
off(Turn all LEDs off.) -
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.) -
theaterchase(Starts theaterchase effect in the given or previously set color.) -
theaterchaseRainbow(Starts theaterchase effect with changing colors.) -
tv(Starts TV simulator.)
Result: OK
Only available in version 2.0 and later
Gets the list of avilable animation modes as JSON.
Result:
[
{
"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 "~"
Result: OK
Get status info as JSON.
Result:
{
"mode":0,
"delay_ms":50,
"brightness":255,
"color":[255, 20, 147]
}