Last Updated on : 2023-12-07 03:33:55download
Add a timer task for a specified device. Based on the parameter loops, the tasks are divided into cycle timer tasks and non-cycle timer tasks. 
Cycle timing: take one week as a cycle, and set the cycle timing from Monday to Sunday. 
Non-cycle timing: Set the timer task of a specified time node. The API will limit the set time node. The time node must be later than the current time. Otherwise, the timer task cannot be created, and a message is displayed that the timer task has expired.
POST: /v1.0/devices/{devId}/timers
| Parameter name | Type | IN | Required | Description | 
|---|---|---|---|---|
| devId | String | uri | true | The device ID. | 
Description of body
| Parameter name | Type | IN | Required | Description | 
|---|---|---|---|---|
| category | String | body | true | The timer category. | 
| loops | String | body | true | The running time of a timer task. A seven-digit number consisting of 0 and 1. 0 means disabled and 1 means enabled. | 
| time_zone | String | body | true | The time zone. | 
| timezone_id | String | body | true | The ID of the time zone. | 
| instruct | object | body | true | The specific time and device instructions of the timer task. Support setting multiple timer tasks that run simultaneously. | 
| alias_name | String | body | false | The alias. | 
| Parameter name | Type | Description | 
|---|---|---|
| result | Object | Return the result of task creation. | 
| success | Boolean | Indicates whether the API is called successfully. Valid values:
  | 
| t | Long | The timestamp. | 
| tid | String | The link ID. | 
Description of result
| Parameter name | Type | Description | 
|---|---|---|
| group_id | Long | ID of a timer task. | 
POST: /v1.0/devices/vdevo15445800464****/timers
{
  "category": "timer",
  "timezone_id": "Europe/Berlin",
  "timezone": "+1:00",
  "alias_name": "Guten Morgen",
  "instruct": [
    {
      "functions": [
        {
          "code": "feed_num",
          "value": 3
        }
      ],
      "date": "",
      "time": "6:0"
    }
  ],
  "loops": "1111111"
}
{
    "tid": "c3d213a97df711eea3b2361f03176748",
    "result": {
        "group_id": "0001699421359116"
    },
    "t": 1699421359166,
    "success": true
}
For more information, see error code.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback