Skip to content

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 ​

FieldTypeDescription
idstringLight ID.
device_idstringDevice ID.
valueobjectFields changed by this event.

Fields in value

FieldTypeDescription
value.onintegerOn/off state: 1: on; 0: off.
value.brightnessintegerBrightness. Range: 0-100.
value.color_modeintegerColor mode: 1: XY; 2: color temperature (CW); 3: XY array.
value.color_xintegerX coordinate in XY mode. Range: 1-65535.
value.color_yintegerY coordinate in XY mode. Range: 1-65535.
value.color_cwintegerColor temperature in CW mode. Range: 2000-6500.
value.color_arrobject[]Array of XY coordinates in XY array mode.
value.color_arr[].xintegerX coordinate
value.color_arr[].yintegerY coordinate
value.sync_statusinteger1 while the light is synchronizing; otherwise 0.
value.position_xintegerBweeApp only: X coordinate in the color picker.
value.position_yintegerBweeApp only: Y coordinate in the color picker.
value.positionsstringBweeApp only: multiple coordinates for segmented color.
value.packstring[]BweeApp only: grouping multiple lights together.

Event details ​

  • Sent when the light's properties change. The value object contains only the changed fields.
  • Apply the fields in value to your local state. Fields absent from the message have not changed.