light

A lighting device that can be controlled. Examples:

  • Light bulb
  • Nightlight

Device functions available

The device may have all the following functions or just some of them. For example, if the smart lamp cannot change the color temperature, you do not need to include the light_colour_temp function in the model description.

Some functions are mandatory for all lamps.

Function Mandatory? Description
light_brightness Brightness shown by the device
light_colour Color shown by the device
light_colour_temp Color temperature shown by the device
light_mode Device mode: color or white
on_off ✔︎ Switching the device on and off remotely
online ✔︎ Device availability: offline or online

Sample description of the lamp model

The model is described in accordance with the model structure. The sample describes a lamp that can be turned on and off remotely, supports white and color modes, can change brightness, color and color temperature. The lamp has an off timer.

In addition, the model describes the dependency of the light_colour function from the light_mode function: you can only change the color of the lamp if it is switched to color mode.

{
    "id": "QWERTY123",
    "manufacturer": "Xiaqara",
    "model": "SM0123456789",
    "hw_version": "3.2",
    "sw_version": "5.7",
    "description": "Xiaqara smart lamp",
    "category": "light",
    "features": [
        "online",
        "on_off",
        "light_mode",
        "light_brightness",
        "light_colour",
        "light_colour_temp",
        "sleep_timer"
    ],
    "dependencies": {
        "light_colour": {
        "key": "light_mode",
            "values": [
                {
                    "type": "ENUM",
                    "enum_value": "colour"
                }
            ]
        }
    }
}

Sample description of a user lamp

The model is described in accordance with the device structure. In the sample there is no description of the lamp model, therefore we believe that the models are described in a separate file and it is sufficient to specify only the model ID (here - QWERTY123).

{
    "id": "ABCD_003",
    "name": "My lamp",
    "default_name": "Smart lamp",
    "nicknames": [
        "LED lamp",
        "Intelligent lamp"
    ],
    "home": "My home",
    "room": "Living room",
    "groups": [
      "Overhead light",
      "Niches",
    ],
    "model_id": "QWERTY123",
    "hw_version": "3.2",
    "sw_version": "5.7"
}