List lights
GET /clip/v2/resource/light
List all lights and their current states. The response also describes each light's capabilities, such as brightness control, color temperature, and segmented color.
Example response
json
{
"code": 0,
"data": {
"arr": [
{
"ability": 79,
"brightness": 100,
"color_arr": [],
"color_cw": 2740,
"color_len": 0,
"color_mode": 2,
"color_rgb": 0,
"color_rgb_arr": [],
"color_x": 0,
"color_y": 0,
"ext_attr": {
"motion": 2
},
"id": "49F6A5DD-F8FA-4617-9AE1-5F91D0E6E7EF",
"motion": {},
"motion_type": [
1
],
"name": "",
"on": 1,
"pack": [],
"position_x": 0,
"position_y": 0,
"positions": "",
"power_on": {
"brightness": 0,
"brightness_mode": 0,
"color_cw": 0,
"color_mode": 0,
"color_x": 0,
"color_y": 0,
"mode": 0,
"on": 0,
"on_mode": 0
},
"support_dynamic": 0,
"support_segment": 0,
"sync_status": 0,
"type": "light"
}
],
"len": 3,
"obj": {}
},
"msg": "success"
}Responses
| Status code | Meaning |
|---|---|
| 200 | OK |
Response fields
HTTP 200 OK
| Field | Type | Required | Description |
|---|---|---|---|
code | integer | Yes | Status code |
msg | string | Yes | Message |
data | object | Yes | Response payload. |
data.obj | object | Yes | Returned resource. |
data.arr | object[] | No | Returned resources. |
data.arr[].id | string | Yes | Light UUID |
data.arr[].type | string | Yes | Always light. |
data.arr[].name | string | Yes | Name |
data.arr[].on | integer | Yes | On/off state |
data.arr[].brightness | integer | Yes | Brightness, from 1 to 100. |
data.arr[].color_mode | integer | Yes | Color mode. 0: HSV color; 1: XY color; 2: color temperature; 3: multi-segment XY color. |
data.arr[].color_cw | integer | Yes | Color temperature, from 2000 to 6500. |
data.arr[].color_x | integer | Yes | X coordinate in the XY color space. |
data.arr[].color_y | integer | Yes | Y coordinate in the XY color space. |
data.arr[].color_len | integer | Yes | Number of individually controlled light segments. |
data.arr[].color_arr | object[] | Yes | Segment data |
data.arr[].color_arr[].x | integer | Yes | X coordinate |
data.arr[].color_arr[].y | integer | Yes | Y coordinate |
data.arr[].pack | string[] | No | For BweeApp use only. |
data.arr[].position_x | integer | No | For BweeApp use only. |
data.arr[].position_y | integer | No | For BweeApp use only. |
data.arr[].positions | string | Yes | For BweeApp use only. |
data.arr[].power_on | PowerOn | No | Power-on behavior |
data.arr[].power_on.mode | integer | Yes | Mode. 0: default; 1: restore previous state; 2: custom; 3: on; 4: off. |
data.arr[].power_on.on_mode | integer | Yes | On/off mode. 0: default; 1: restore previous state; 2: custom. |
data.arr[].power_on.on | integer | Yes | On/off state |
data.arr[].power_on.brightness_mode | integer | Yes | Brightness mode. 0: default; 1: restore previous state; 2: custom. |
data.arr[].power_on.brightness | integer | Yes | Brightness, from 0 to 100. |
data.arr[].power_on.color_mode | integer | Yes | Color mode. 0: default; 1: restore previous state; 2: custom XY; 3: custom color temperature. |
data.arr[].power_on.color_x | integer | Yes | Color X coordinate |
data.arr[].power_on.color_y | integer | Yes | Color Y coordinate |
data.arr[].power_on.color_cw | integer | Yes | Color temperature, from 2000 to 6500. |
data.arr[].support_segment | integer | Yes | 1 if the light supports segmented color; otherwise 0. |
data.arr[].support_dynamic | integer | Yes | 1 if dynamic scenes are supported; otherwise 0. |
data.arr[].ability | integer | Yes | Supported features, encoded as the bitmask described below. |
Read ability as a bitmask: a set bit (1) means the light supports that feature; a cleared bit (0) means it does not.
| Bit (n) | Binary value | Weight (2ⁿ) | Description |
|---|---|---|---|
| 0 | 1 | 1 | On/off control. |
| 1 | 1 | 2 | Brightness adjustment. |
| 2 | 1 | 4 | Color temperature control. |
| 3 | 1 | 8 | Color control. |
| 4 | 1 | 16 | Segmented lighting. |
| 5 | 1 | 32 | Light length configuration. |
| 6 | 1 | 64 | Dynamic effects. |
| 7 | 1 | 128 | Current adjustment. |
For example, ability = 15 (0000 1111 in binary) enables bits 0-3: on/off control, brightness, color temperature, and color.