Add Infrared Scheduled Task

Last Updated on : 2023-06-15 05:18:29

Add scheduled tasks to a remote control based on the entered conditions.

API address

POST: /v2.0/infrareds/{infrared_id}/remotes/{remote_id}/timers

Request parameter

Parameter nameTypeINRequiredDescription
infrared_idStringuritrueThe device ID.
remote_idStringuritrueThe ID of a specified remote control.

Description of body

Parameter nameTypeINRequiredDescription
powerInteger falseThe power supply. Valid values:
  • 0: power-off.
  • 1: power-on.
modeInteger falseThe working mode. Valid values:
  • 0: cooling mode.
  • 1: heating mode.
  • 2: automatic mode.
  • 3: air supply mode.
  • 4: dehumidification mode.
tempInteger falseThe temperature.
swingInteger falseThe swing mode (not supported currently).
windInteger falseThe wind speed. Valid values:
  • 0: automatic.
  • 1: low speed.
  • 2: medium speed.
  • 3: high speed.
keyInteger falseThe key ID.
timeString falseThe specified execution time.
dateString falseThe date. When the date is entered, the value of loops is 0000000, and the date format is 20181212.
loopsString falseThe loop configuration. A seven-digit number consisting of 0 and 1. 0 means disabled and 1 means enabled. For example, 0000010 means that the scheduled task is disabled on Sunday, Monday, Tuesday, Wednesday, Thursday, and Friday, and it is enabled on Saturday.
timezone_idString falseThe time zone ID. Example: Asia/Shanghai.

Return parameter

Parameter nameTypeDescription
resultLongThe ID of a scheduled task.

Request example

POST: /v2.0/infrareds/vdevo15345926009****/remotes/d5s65ca55/timers
{
  "key": 1,
  "loops": "0000000",
  "timezone_id": "Asia/Shanghai",
  "time_zone": "+8:00",
  "time": "19:06"
}

Return example

{
    "result": 12072546,
    "t": 1631175719525,
    "success": true
}

Error code

For more information, see error code.