This configuration sets up the routine periodicity of a device.
Required Attribute:
schedulable, periodicity
schedulable, periodicityoptional attribute: aperiodicity, if true, this device support one-shot capability.
[
{
"name": "schedulable",
"value": true
},
{
"name": "periodicity",
"value": true
},
{
"name": "aperiodicity",
"value": true
}
]Device Model Example
{
"Ultron Device": {
"type": "ULTRON",
"traits": ["UltronCommand", "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} ]
}
}
Config Item Attributes
| Field Name | Type | Note |
|---|---|---|
start | Integer | Start time of the periodicity cycle (Unix timestamp). |
tick | Integer | Duration of each time unit/tick within the period (e.g., in seconds). |
period | Integer | Total number of ticks in one full periodicity cycle. |
dev | Array[String] | Array of device names/IDs this periodicity applies to. |
act | Array[Object] | Array of actions (commands) that can be triggered by events. |
events | Array[Object] | Array of event definitions, including their schedule within the period. |
Object of act (action)
| Field Name | Type | Note |
|---|---|---|
cmds | Array[Object] | Which cmds are involved in this periodicity. |
Object of cmd
| Field Name | Type | Note |
|---|---|---|
command | String | Command name. E.g.: "OnOff" |
params | Object | Command parameters. |
Object of events
| Field Name | Type | Note |
|---|---|---|
id | Integer | Unique identifier for this specific event definition within the events array. |
disabled | Boolean | Optional. If true, this event schedule is ignored. Defaults to false if not present. |
name | String | A user-defined name or label for this event (e.g., "Morning On", "Evening Off"). |
oneShot | Boolean | Optional. If true, the event runs only once based on the schedule. Requires aperiodicitysupport. |
schedule | Array[String] | Defines when actions occur. Format: "tick1,tick2,...:dev_list:act_index". See example. |
Example
{
"config": "Periodicity",
"items": {
"start": 1690905600,
"tick": 600,
"period": 1008,
"dev": ["Light"],
"act": [
{
"cmds": [
{ "command": "OnOff", "params": {"on": true} }
]
},
{
"cmds": [
{ "command": "OnOff", "params": {"on": false} }
]
}
],
"events": [
{ "id": 0, "name": "0.0", "schedule": ["45,189,333,765,909:0:0", "105,249,393,825,969:0:1"] }
]
}
}where
{
...
"schedule": ["45,189,333,765,909:0:0", "105,249,393,825,969:0:1"],
...
}- Starting from: "start": 1690905600, first executions: 1690905600+45*600 = 1690932600,
- with dev_list = [0] ("Light")
- If you want to execute on multiple devices, use comma-separated string to do that. eg: 0,45,90:0,1:0
- with act_index = 0
{"cmds": [{ "command": "OnOff", "params": {"on": true} }]}and so on.
API Example: /usr/v5/SetDeviceConfigs
{
"sn": "UT2Z07-6JXXXXX",
"configs": {
"config": "Periodicity",
"items": {
"start": 1690905600,
"tick": 600,
"period": 1008,
"dev": ["Light"],
"act": [
{
"cmds": [
{ "command": "OnOff", "params": {"on": true} }
]
},
{
"cmds": [
{ "command": "OnOff", "params": {"on": false} }
]
}
],
"events": [
{ "id": 0, "name": "0.0", "schedule": ["45,189,333,765,909:0:0", "105,249,393,825,969:0:1"] }
]
}
}
}
{
"sn": "UT2Z07-6JXXXXX",
"configs": [
{
"config": "Periodicity",
"items": {
"start": 1690905600,
"tick": 600,
"period": 1008,
"dev": ["Light"],
"act": [
{
"cmds": [
{ "command": "OnOff", "params": {"on": true} }
]
},
{
"cmds": [
{ "command": "OnOff", "params": {"on": false} }
]
}
],
"events": [
{ "id": 0, "name": "0.0", "schedule": ["45,189,333,765,909:0:0", "105,249,393,825,969:0:1"] }
]
}
}
]
}