The configuration sets up the color preset feature.
Required Attribute
colorProfile
colorProfileExample
{
"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 Name | Type | Note |
|---|---|---|
enabled | Boolean | Required |
brightnessStart | Integer | |
brightnessEnd | Integer | Required |
temperature * | Integer | |
spectrumRGB * | Integer | |
spectrumHSV * | Object | |
spectrumHSV.hue | Number | |
spectrumHSV.saturation | Number | |
spectrumHSV.value | Number |
*:temperature, spectrumRGB, spectrumHSV: These fields are mutually exclusive. Please use one of them according to the device model.
- If
colorTemperatureRangeis defined, then should usetemperature - If
colorModelis defined, when the value ofcolorModel- is "rgb": use
spectrumRGB - is "hsv": use
spectrumHSV
- is "rgb": use
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
}
}
]
}