Standard Instruction Set

Last Updated on : 2024-01-24 02:35:58download

This topic describes the standard instruction set of ceiling light (xdd).

Standard instruction set of ceiling light

Code Name Data type Value
switch_night_light Night light Boolean {}
do_not_disturb Do Not Disturb (DND) mode Boolean {}
scene_data Scene Json {}
work_mode Mode Enum {"range":["white","colour","scene","music"]}
control_data Control DP Json {}
music_data Musical light mode Json {}
countdown Countdown 1 Integer {"unit":"s","min":0,"max":86400,"scale":0,"step":1}
colour_data Colored light Json {}
temp_value Color temperature Integer {"min":0,"max":1000,"scale":0,"step":1}
bright_value Brightness Integer {"min":10,"max":1000,"scale":0,"step":1}
switch_led On/off Boolean {}

Examples of standard instruction

switch_night_light

Indicates whether to turn on the night light of the ceiling light.

  • Value description

    • true: Turn on the night light.
    • false: Turn off the night light.
  • Sample code

    {
        "commands":[
            {
                "code":"switch_night_light",
                "value":true
            }
        ]
    }
    

do_not_disturb

Indicates whether to enable the Do Not Disturb (DND) mode.

  • Value description

    • true: Enable the DND mode.
    • false: Disable the DND mode.
  • Sample code

    {
        "commands":[
            {
            "code":"do_not_disturb",
                "value":true
        }
        ]
    }
    

scene_data

Indicates the scene mode, which specifies the color change of the ceiling light.

  • Value description

    • scene_num: the number of scene modes. Valid values: 1 to 8.
    • unit_change_mode: the unit change mode. ["static","jump","gradient"] indicates static, jumping, and gradient respectively.
    • unit_switch_duration: the unit switching duration. Valid values: 0 to 100. Unit: seconds.
    • unit_gradient_duration: the gradient duration of a light unit. Valid values: 0 to 100. Unit: seconds.
    • bright: the brightness. Valid values: 0 to 1000.
    • temperature: the color temperature. Valid values: 0 to 1000.
    • h: hue. Valid values: 0 to 360.
    • s: saturation. Valid values: 0 to 1000.
    • v: value. Valid values: 0 to 1000.
  • Sample code

    {
        "commands":[
            {
                "code":"scene_data",
                "value":{
                    "scene_num":5,
                    "scene_units":[
                        {
                            "unit_change_mode":"static",
                            "unit_switch_duration":20,
                            "unit_gradient_duration":20,
                            "h":201,
                            "s":611,
                            "v":999,
                            "bright":500,
                            "temperature":800
                        }
            }
        ]
    }
    

work_mode

Set the predefined color mode of the ceiling light.

  • Value description

    • white: white light.
    • colour: colored light.
    • scene: predefined color.
    • music: predefined color.
  • Sample code

    {
        "commands":[
            {
                "code":"work_mode",
                "value":"white"
            }
        ]
    }
    

control_data

Indicates the DP control, which specifies the color change of the ceiling light.

  • Value description

    • change_mode: the color change mode. ["direct","gradient"] indicates direct output and gradient respectively.
    • bright: the brightness. Valid values: 0 to 1000.
    • temperature: the color temperature. Valid values: 0 to 1000.
    • h: hue. Valid values: 0 to 360.
    • s: saturation. Valid values: 0 to 1000.
    • v: value. Valid values: 0 to 1000.
  • Sample code

    {
        "commands":[
            {
                "code":"control_data",
                "value":{
                    "change_mode":"direct",
                    "bright":500,
                    "temperature":800,
                    "h":201,
                    "s":611,
                    "v":999
                }
            }
        ]
    }
    

music_data

Indicates the music light, which specifies the color change of the ceiling light.

  • Value description

    • change_mode: the color change mode. ["direct","gradient"] indicates direct output and gradient respectively.
    • bright: the brightness. Valid values: 0 to 1000.
    • temperature: the color temperature. Valid values: 0 to 1000.
    • h: hue. Valid values: 0 to 360.
    • s: saturation. Valid values: 0 to 1000.
    • v: value. Valid values: 0 to 1000.
  • Sample code

    {
        "commands":[
            {
                "code":"music_data",
                "value":{
                    "change_mode":"direct",
                    "bright":500,
                    "temperature":800,
                    "h":201,
                    "s":611,
                    "v":999
                }
            }
        ]
    }
    

countdown

Sets a countdown to turn on or off the ceiling light.

  • Value description

    • Unit: in seconds.
    • Valid values: 0 to 86400.
  • Sample code

    {
        "commands":[
            {
                "code":"countdown",
                "value":1200
            }
        ]
    }
    

colour_data

Controls the color change of the ceiling light in the form of hue, saturation, and value (HSV).

  • Value description

    • h: hue. Valid values: 0 to 360.
    • s: saturation. Valid values: 0 to 1000.
    • v: value. Valid values: 0 to 1000.
  • Sample code

    {
        "commands":[
            {
                "code":"colour_data",
                "value":{
                    "h":201,
                    "s":511,
                    "v":899
                }
            }
        ]
    }
    

temp_value

Adjusts the cool and warm color temperature of the ceiling light.

  • Value description
    Valid values: 0 to 1000.

  • Sample code

    {
        "commands":[
            {
                "code":"temp_value",
                "value":990
            }
        ]
    }
    

bright_value

Adjusts the brightness of the ceiling light.

  • Value description
    The reference value ranges from 10 to 1000. The specific value range of each product differs, and the queried device attributes shall prevail.

  • Sample code

    {
        "commands":[
            {
                "code":"bright_value",
                "value": 100
            }
        ]
    }
    

switch_led

Indicates whether to turn on the ceiling light.

  • Value description

    • true: Turn on the ceiling light.
    • false: Turn off the ceiling light.
  • Sample code

    {
        "commands":[
            {
                "code":"switch_led",
                "value":true
            }
        ]
    }