IotIntervals

This configuration sets up intervals of the iot device.

Required Attribute:

iotConfigurableIntervals

{
  "name": "iotConfigurableIntervals",
  "value": true
}

Device Model Example

{
  "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},
      {"name": "availableDimmingTypes",    "value": ["0-10V", "1-10V"] }
    ]
  },
  "Light": {
    "type": "LIGHT",
    "traits": ["OnOff", "Brightness"],
    "disabled": false,
    "attrs": [
      {
        "name": "queryOnlyOnOff",
        "value": false
      },
      {
        "name": "commandOnlyBrightness",
        "value": false
      },
      {
        "name": "colorProfile",
        "value": {"enabled": true, "brightnessStart": 0, "brightnessEnd": 50}
      },
      {
        "name": "fade",
        "value": {
          "enabled": true,
          "duration": 2,
          "durationRange": {"min": 1, "max": 10}
        }
      }
    ]
  }
}

Config Item Attributes

Field NameTypeNote
reportStatesIntegerInterval of reporting iot states.
bleTopologyIntegerInterval of updating BLE topology.
retryObjectRetry intervals.
mqttConfigObjectInterval of mqtt related events.
sensorObjectInterval of reporting sensor data.

Object fields of retry

Field NameTypeNote
activateObject(Backoff)Retry interval of IoT activation.
mqttConnectObject(Backoff)Retry interval of mqtt connecting.
asyncApiObject(Backoff)Retry interval of Device Async API.

Object fields of Backoff

Field NameTypeNote
valueIntegerRetry interval of IoT activation.
maxIntegerRetry interval of mqtt connecting.
backoffStringOptional. Back-off algorithm.

Object fields of mqttConfig

Field NameTypeNote
keepAliveIntegerMQTT Keep-alive
connTimeoutIntegerMQTT connect timeout
connectAuthFailIntegerMQTT connect auth fail

Object format of sensor: map[string]map[attrs.SensorType]SensorIntervals Object fields of SensorIntervals

Field NameTypeNote
toleranceNumberTolerance of reading change(delta)
reportIntegerReporting interval
samplingIntegerSampling interval

Example

{
  "config": "IotIntervals",
  "items": {
    "reportStates": 3600,
    "bleTopology": 600,
    "retry": {
      "activate"   : {"value": 10, "max": 120, "backoff": null},
      "mqttConnect": {"value": 60, "max": 120, "backoff": null},
      "asyncApi"   : {"value":  5, "max":  60, "backoff": null}
    },
    "mqttConfig": {"keepAlive": 290, "connTimeout": 30, "connectAuthFail": 40},
    "sensor": {
      "Ultron Sensor": {
        "rh"  : {"tolerance": 3  , "report": 290, "sampling": 60},
        "temp": {"tolerance": 0.5, "report": 290, "sampling": 60}
      }
    }
  }
}

API Example: /usr/v5/SetDeviceConfigs

{
  "sn": "UT2Z02-4KXXXXX",
  "configs": [
    {
      "config": "IotIntervals",
      "items": {
        "reportStates": 3600,
        "bleTopology": 600,
        "retry": {
          "activate"   : {"value": 10, "max": 120},
          "mqttConnect": {"value": 60, "max": 120},
          "asyncApi"   : {"value":  5, "max":  60}
        },
        "mqttConfig": {"keepAlive": 290, "connTimeout": 30, "connectAuthFail": 40},
        "sensor": {
          "Ultron Sensor": {
            "rh"  : {"tolerance": 3  , "report": 290, "sampling": 60},
            "temp": {"tolerance": 0.5, "report": 290, "sampling": 60}
          }
        }
      }
    }
  ]
}