ColorPreset

The configuration sets up the color preset feature.


Required Attribute

colorProfile

Example

{
  "name": "colorProfile",
  "value": {"enabled": true, "brightnessStart": 0, "brightnessEnd": 50, "temperature": 4600}
}

Example Device Model

{
  "Ultron Device": {
    "type": "ULTRON",
    "traits": ["UltronCommand", "ReportState", "LocalControl", "UltronConfig"],
    "disabled": false,
    "attrs": [
      {"name": "rebootTime", "value": 20},
      {"name": "fwUpgradeTime", "value": 60},
      {"name": "iotConfigurableIntervals", "value": true},
      {"name": "schedulable", "value": { "Light": ["OnOff"] }},
      {"name": "periodicity", "value": true}
    ]
  },
  "Light": {
    "type": "LIGHT",
    "traits": ["OnOff", "Brightness", "ColorSetting"],
    "disabled": false,
    "attrs": [
      { 
        "name": "colorTemperatureRange", 
        "value": {"temperatureMinK": 2700, "temperatureMaxK": 6500}
      },
      { 
        "name": "colorProfile", 
        "value": {"enabled": true, "brightnessStart": 0, "brightnessEnd": 50, "temperature": 4600}
      },
      {
        "name": "fade",
        "value": { "enabled": true, "duration": 1, "durationRange": {"min": 1, "max": 10} }
      },
      {
        "name": "brightnessRangeConfigurable",
        "value": true
      }
    ]
  }
}

Config Item Attributes

Field NameTypeNote
enabledBooleanRequired
brightnessStartInteger
brightnessEndIntegerRequired
temperature *Integer
spectrumRGB *Integer
spectrumHSV *Object
spectrumHSV.hueNumber
spectrumHSV.saturationNumber
spectrumHSV.valueNumber

*:temperature, spectrumRGB, spectrumHSV: These fields are mutually exclusive. Please use one of them according to the device model.

  • If colorTemperatureRange is defined, then should use temperature
  • If colorModel is defined, when the value of colorModel
    • is "rgb": use spectrumRGB
    • is "hsv": use spectrumHSV

Example

Config

 [
  {
    "config": "ColorPreset",
    "iotName": "Light",
    "items": {
      "enabled": true,
      "brightnessStart": 0,
      "brightnessEnd": 60,
      "temperature": 3000
    }
  }
]

API Example: /usr/v5/SetDeviceConfigs

Turn on Color Preset feature:
{
  "sn": "UT2Z07-ESXXXXX",
  "configs": [
    {
      "config": "ColorPreset",
      "iotName": "Light",
      "items": {
        "enabled": true,
        "brightnessStart": 0,
        "brightnessEnd": 60,
        "temperature": 3000
      }
    }
  ]
}
Turn off Color Preset feature:
{
  "sn": "UT2Z07-ESXXXXX",
  "configs": [
    {
      "config": "ColorPreset",
      "iotName": "Light",
      "items": {
        "enabled": false,
        "brightnessStart": 0,
        "brightnessEnd": 60,
        "temperature": 3000
      }
    }
  ]
}