TimeStep

The behavior of this config is to auto turn off the target device after value seconds

Required Attribute

timeStepRange

{
  "name": "timeStepRange",
  "value": {
    "max": 84600,
    "min": 1,
    "step": 1
  }
}

Example Device Model

{
  "1": {
    "type": "SWITCH",
    "traits": ["Sensor", "OnOff", "CustomModes"],
    "disabled": false,
    "attrs": [
      {
        "name": "sensorProfile",
        "value": {
          "real_power": {"Min": 0, "Max":  3300, "Unit": "Watt"},
          "current"   : {"Min": 0, "Max": 15000, "Unit": "mA"  },
          "voltage"   : {"Min": 0, "Max":   240, "Unit": "V"   },
          "watt_hour" : {"Min": 0, "Max": 50000, "Unit": "kWh" }
        }
      },
      {"name": "intermittent", "value": true},
      { "name": "timeStepRange", "value": {"max": 86400, "min": 0.1, "step": 0.1} },
      {
        "name": "availableCustomModes",
        "value": [
          { "name": "1"     , "settings": ["Pulse", "Edge", "Following"], "ordered": true },
          { "name": "reset1", "settings": ["0"                         ], "ordered": true }
        ]
      }
    ]
  },
  "2": {
    "type": "SWITCH",
    "traits": ["Sensor", "OnOff", "CustomModes"],
    "disabled": false,
    "attrs": [
      {
        "name": "sensorProfile",
        "value": {
          "voltage"   : {"Min": 0, "Max":   240, "Unit": "V"   },
          "watt_hour" : {"Min": 0, "Max": 50000, "Unit": "kWh" },
          "real_power": {"Min": 0, "Max":  3300, "Unit": "Watt"},
          "current"   : {"Min": 0, "Max": 15000, "Unit": "mA"  }
        }
      },
      {"name": "intermittent", "value": true},
      { "name": "timeStepRange", "value": {"max": 86400, "min": 0.1, "step": 0.1} },
      {
        "name": "availableCustomModes",
        "value": [
          { "name": "2"     , "settings": ["Pulse", "Edge", "Following"], "ordered": true },
          { "name": "reset2", "settings": ["0"                         ], "ordered": true }
        ]
      }
    ]
  },
  "Ultron Device": {
    "type": "ULTRON",
    "traits": ["UltronCommand", "BluetoothGateway", "ReportState", "UltronConfig", "RadioGroups"],
    "disabled": false,
    "attrs": [
      {"name": "rebootTime", "value": 20},
      {"name": "fwUpgradeTime", "value": 60},
      {"name": "iotConfigurableIntervals", "value": true},
      {
        "value": { "1": ["OnOff"], "2": ["OnOff"] },
        "name": "schedulable"
      },
      {"name": "schedulableVersion", "value": 1},
      {"name": "periodicity", "value": true},
      {"name": "aperiodicity", "value": true},
      { "name": "arbitraryRadioGroupDevices", "value": ["1", "2"] },
      {
        "name": "supportDefaultActions",
        "value": {
          "1": { "cmdNames": ["OnOff"], "situations": ["power", "network"] },
          "2": { "cmdNames": ["OnOff"], "situations": ["power", "network"] }
        }
      }
    ]
  }
}

Config Item Attributes

Field NameTypeNote
valuefloat64The specific time step value. Must be within the range and a multiple of the step defined by the timeStepRange device attribute. Corresponds to the value of the JSON field. Unit is second
enabledboolIndicates whether this time step configuration is active. Corresponds to the enabled JSON field.

Example

Config

[
  { "config": "TimeStep", "iotName": "1", "items": {"value": 1, "enabled": true } },
  { "config": "TimeStep", "iotName": "2", "items": {"value": 1, "enabled": true } },
  { "config": "TimeStep", "iotName": "3", "items": {"value": 1, "enabled": true } },
  { "config": "TimeStep", "iotName": "4", "items": {"value": 2, "enabled": false} }
]

API Example: /usr/v5/SetDeviceConfigs

{
  "sn": "UT3702-ESXXXXX",
  "configs": [
    { "config": "TimeStep", "iotName": "1", "items": {"value": 1, "enabled": true } },
    { "config": "TimeStep", "iotName": "2", "items": {"value": 1, "enabled": true } },
    { "config": "TimeStep", "iotName": "3", "items": {"value": 1, "enabled": true } },
    { "config": "TimeStep", "iotName": "4", "items": {"value": 2, "enabled": false} }
  ]
}