-
Notifications
You must be signed in to change notification settings - Fork 30
HTTP REST API (V3)
This returns a JSON containing the current mode, delay, brightness and color.
{
"segment": 1,
"start": 72,
"stop": 143,
"mode": 1,
"fx_mode": 24,
"speed": 253,
"brightness": 46,
"color": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"ws_fxopt": 176,
"hostname": "McLightingRGBW",
"mqtt_host": "192.168.xxx.xxx",
"mqtt_port": 1883,
"mqtt_user": "mqtt_user",
"mqtt_pass": "mqtt-passw0rd",
"ws_seg": 2,
"ws_cnt": 144,
"ws_rgbo": "GRBW",
"ws_pin": 3,
"ws_trans": true
}
This returns a JSON containing the current status of the ESP8266 with following stats:
{
"HOSTNAME":"McLightingRGBW",
"version": "3.1.0.BETA6",
"heap": 19696,
"sketch_size": 619840,
"free_sketch_space": 1474560,
"flash_chip_size": 4194304,
"flash_chip_real_size": 4194304,
"flash_chip_speed": 40000000,
"sdk_version": "2.2.2-dev(38a443e)",
"core_version": "2_6_2",
"cpu_freq": 160,
"chip_id": 1458280,
"animation_lib": "WS2812FX_DMA",
"ws2812_pin": 3,
"led_count": 144,
"rgb_order": "GRBW",
"rgbw_mode": "ON",
"button_mode": "OFF",
"button_gy33": "OFF",
"ir_remote": "ON",
"tsop_ir_pin": 13,
"mqtt": "AMQTT",
"home_assistant": "ON",
"ota": "HTTP",
"state_save": "SPIFFS"
}
Through this API endpoint you can resart your ESP.
Warning! This request returns a simple plain text answer!
restarting...
Resets WLAN settings and restarts the ESP8266.
Warning! This request returns a simple plain text answer!
Restarting into captive portal...
Start the config AP.
Warning! This request returns a simple plain text answer!
Starting config AP ...
Returns the brightness value.
Warning! This request returns a simple plain text answer!
A value from 0 to 100.
Gets the effect speed as value.
Warning! This request returns a simple plain text answer!
A value from 0 to 255
Gets the light status (switch on/off) as boolean value.
Warning! This request returns a simple plain text boolean answer!
0 or 1
Gets the current strip main-color as RGB HEX value.
Warning! This request returns a simple plain text answer!
Value as hex WITHOUT the leading '#' for RGB values only, e.g. 00FFFF.
This is for compatiblity issues with other projects, which do not suppport WRGB.
Gets the current strip main-color as WRGB HEX value.
Warning! This request returns a simple plain text answer!
Value as hex WITHOUT the leading '#' , e.g. 0000FFFF.
Gets the current strip background-color as WRGB HEX value.
Warning! This request returns a simple plain text answer!
Value as hex WITHOUT the leading '#' , e.g. 0000FFFF.
Gets the current strip xtra-color as WRGB HEX value.
Warning! This request returns a simple plain text answer!
Value as hex WITHOUT the leading '#' , e.g. 0000FFFF.
Toggles all leds immedately off/on.
Warning! This request returns a simple plain text answer!
Value as TEXT 'OK' or 'NOK'
Turns all leds immedately on with last state.
Warning! This request returns a simple plain text answer!
Value as TEXT 'OK' or 'NOK'
Change LED settings on the fly
hostname: McLightingRGBW (max. 64 chars)
mqtt_host: 192.168.0.10 (max. 64 chars)
mqtt_port: 1883 (0-65535)
mqtt_user: mqtt_user (max. 32 chars)
mqtt_pass: mqtt-passw0rd (max. 32 chars)
ws_cnt: 194 (1-9999 Number of pixels.
ws_rgbo: GRBW (RGB Pixel Order: Any combination of the chars r, g, b and w.
Every char is only allowed once, <ws_rgbo>
must contain r, g, b, and can contain w.)
ws_pin: 3 (0-99. GPIO PIN for data line. Valid are 16/5/4/0/2/14/12/13/15/3/1)
ws_trans: 0 (0: switches transition effects off 1: on)
See WS2812FX documentation for more infos. regarding how to use <ws_fxopt>
.
{
"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_trans":"false"
}
Returns the list of available animation modes as JSON.
[
{
"mode":"off",
"name":"OFF"
},
{
"mode": 0,
"name": "Static"
},
{
"mode": 1,
"name": "Blink"
},
{
"mode": 2,
"name": "Breath"
},
{
"mode": "...",
"name": "..."
}
]
Activates the given animation mode and other parameters
m: Animation ID (see /get_modes for a list of all IDs)
r: Value for red (0-255)
g: Value for green (0-255)
b: Value for blue (0-255)
w: Value for blue (0-255)
r2: Value for red (0-255)
g2: Value for green (0-255)
b2: Value for blue (0-255)
w2: Value for blue (0-255)
r3: Value for red (0-255)
g3: Value for green (0-255)
b3: Value for blue (0-255)
w3: Value for blue (0-255)
rgb: Value for color as HEX WRGB value, e.g. 0004d2ff
rgb2: Value for color as HEX WRGB value, e.g. 0004d2ff
rgb3: Value for color as HEX WRGB value, e.g. 0004d2ff
c: Value for brightness (0-100)
OR
p: Value for brightness (0-255)
s: Value for speed (0-255)
This returns the full [GET] /status JSON
Activates the given animation mode
m: Animation ID (see /get_modes for a list of all IDs)
This returns the full [GET] /status JSON
Lists all files in a directory in a SPIFFS filesystem.
dir: Directory (e.g. /)
[application/json]
[
{
"type": "file",
"name": "edit.htm.gz"
},
{
"type": "file",
"name": "graphs.js.gz"
},
{
"type": "file",
"name": "favicon.ico"
},
{
"type": "file",
"name": "index.htm"
}
]
Error:
[500] BAD ARGS (text/plain): No parameter given.
Formats the SPIFFS filesystem and erases all data.
Warning! This request returns a simple plain text answer!
Formatting SPIFFS...
Create new file
First parameter: Filename as full path, e.g. /test.htm
(empty)
Error:
[500] BAD ARGS (text/plain): No parameter given.
[500] BAD PATH (text/plain): Path not valid.
[500] FILE EXISTS (text/plain): File already exists.
[500] CREATE FAILED (text/plain): File creation error.
Delete file.
First parameter: Filename as full path, e.g. /test.htm
[text/plain]
(empty)
Error:
[500] BAD ARGS (text/plain): No parameter given.
[500] BAD PATH (text/plain): Path not valid.
[404] FileNotFound (text/plain): File not found.
Upload file.
Multipart upload.
[text/plain]
(empty)