Fade

The configuration sets up the fade-in/fade-out feature.

Required Attribute

fade

{
  "name": "fade",
  "value": {"enabled": true, "duration": 2, "durationRange": {"min": 1, "max": 10}}
}

Example Device Model

{
  "Ultron Device": {
    "type": "ULTRON",
    "traits": ["UltronCommand", "BluetoothGateway", "ReportState", "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": "commandOnlyOnOff", "value": false},
      {"name": "commandOnlyBrightness", "value": false},
      {"name": "colorTemperatureRange", "value": {"temperatureMinK": 2700, "temperatureMaxK": 6500} },
      {"name": "fade", "value": { "durationRange": {"min": 1, "max": 10} }},
      {"name": "brightnessRangeConfigurable", "value": true}
    ]
  }
}

Config Item Attributes

Field NameTypeNote
brightnessStartIntegerRequired
brightnessEndIntegerRequired
durationIntegerRequired
temperature *Integer
spectrumRGB *Integer
spectrumHSV *Object
spectrumHSV.hueNumber
spectrumHSV.saturationNumber
spectrumHSV.valueNumber

*:temperature, spectrumRGB, spectrumHSV these there 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 value of colorModel
    • is "rgb": use spectrumRGB
    • is "hsv": use spectrumHSV

Example

Config

[
  {
    "config":"Fade",
    "iotName":"Light",
    "items":{
      "brightnessStart":0,
      "brightnessEnd":100,
      "duration":3,
      "temperature":3460
    }
  }
]

API Example: /usr/v5/SetDeviceConfigs

Turn on fade feature:
{
  "sn": "UT2Z02-3BXXXXX",
  "configs": [
    {
      "config":"Fade",
      "iotName":"Light",
      "items":{
        "brightnessStart":0,
        "brightnessEnd":100,
        "duration":3,
        "temperature":3460
      }
    }
  ]
}
Turn off fade feature:
{
  "sn": "UT2Z02-3BXXXXX",
  "configs": [
    {
      "config":"Fade",
      "iotName":"Light",
      "items": null
    }
  ]
}