Light events
Field paths are relative to one object in the message array. [] means an array item: for example, services[].rid is the rid of each service. Fields under value are shown as value.name, value.color_arr[].x, and so on.
Light updated
Topic
res/light/update
Example message
json
[
{
"device_id": "10E48D35-0ABD-47EB-BA4B-C150D68C4B23",
"id": "8BAD2C8A-38BE-41CB-A4D3-563B5C7E9C03",
"value": {
"brightness": 74,
"color_arr": [
{
"x": 26839,
"y": 28098
},
{
"x": 22993,
"y": 29119
},
{
"x": 21025,
"y": 24022
},
{
"x": 18600,
"y": 24633
},
{
"x": 10591,
"y": 23416
}
],
"color_len": 5
}
}
]Fields
| Field | Type | Description |
|---|---|---|
id | string | Light ID. |
device_id | string | Device ID. |
value | object | Fields changed by this event. |
Fields in value
| Field | Type | Description |
|---|---|---|
value.on | integer | On/off state: 1: on; 0: off. |
value.brightness | integer | Brightness. Range: 0-100. |
value.color_mode | integer | Color mode: 1: XY; 2: color temperature (CW); 3: XY array. |
value.color_x | integer | X coordinate in XY mode. Range: 1-65535. |
value.color_y | integer | Y coordinate in XY mode. Range: 1-65535. |
value.color_cw | integer | Color temperature in CW mode. Range: 2000-6500. |
value.color_arr | object[] | Array of XY coordinates in XY array mode. |
value.color_arr[].x | integer | X coordinate |
value.color_arr[].y | integer | Y coordinate |
value.sync_status | integer | 1 while the light is synchronizing; otherwise 0. |
value.position_x | integer | BweeApp only: X coordinate in the color picker. |
value.position_y | integer | BweeApp only: Y coordinate in the color picker. |
value.positions | string | BweeApp only: multiple coordinates for segmented color. |
value.pack | string[] | BweeApp only: grouping multiple lights together. |
Event details
- Sent when the light's properties change. The
valueobject contains only the changed fields. - Apply the fields in
valueto your local state. Fields absent from the message have not changed.