# Schedule

Process:

  1. The server sends a schedule command to the terminal.

  2. The terminal receives and confirms the command, then calls the Get Schedule API. The server responds with the schedule information.

  3. If the schedule includes any programs, the terminal calls the Get Program List API. The server then returns a list of programs, including all programs sent to the terminal either through scheduling or directly. The terminal automatically identifies the way each program was sent.

  4. Finally, the terminal calls the Get Material List API.

# Example

{
    "id": 1,
    "post": 1,
    "author_url": "",
    "content": {
        "raw": "{\"program\":\"schedule\"}"
    },
    "karma": 0
}

# Publish Schedule to Terminal API

Basic Information

Path: /wp-json/wp/v3/schedules

Method: GET

Description: This can be used to publish a schedule to the terminal.

No request parameters

Response Example:

{
  "contentsSchedule": [
    {
      "type_priority": 200,
      "priority": 0,
      "if_limit_time": true,
      "limit_time": {
        "start_time": "10:40:55",
        "end_time": "23:59:59"
      },
      "operation": {
        "id": 1164,
        "name": "Playlist5922",
        "vsn": "Playlist5922_4d9a41e19242f9e68a753aafe2f1c7f3_12612.vsn",
        "source": "internet"
      },
      "if_limit_date": true,
      "limit_date": {
        "start": "2024-07-26",
        "end": "2024-07-26",
        "start_time": "00:00:00",
        "end_time": "23:59:59"
      },
      "if_limit_weekday": true,
      "limit_weekday": [
        true,
        true,
        true,
        false,
        false,
        true,
        true
      ],
      "type": "rotation",
      "name": "Play_Program"
    }
  ],
  "commandSchedule": [
    {
      "operation": {
        "author_url": "api/brightness",
        "karma": 2,
        "content": "{\"brightness\":\"77\"}"
      },
      "op_time": [
        "10:41:02"
      ],
      "if_limit_date": true,
      "limit_date": {
        "start": "2024-07-26",
        "end": "2024-07-26"
      },
      "if_limit_weekday": true,
      "limit_weekday": [
        true,
        true,
        false,
        false,
        true,
        true,
        true
      ],
      "content": {
        "name": "Value",
        "value": "30"
      },
      "type": "command",
      "name": "Brightness_Control"
    }
  ]
}

Parameter detail:

Parameter name Type Description Example
commandSchedule List Command schedule []
commandSchedule.content Object The value of the command in command schedule (See below) {
"name": "Switch",
"value": "async"
}
commandSchedule.if_limit_date Boolean Whether to specify a date (days) for executing the command schedule. false: Keep executing the command schedule by default. true/false
commandSchedule.limit_date Object Start and end date of the schedule.
commandSchedule.limit_date.start String Specify the start date for executing the command schedule. 2023-12-25
commandSchedule.limit_date.end String Specify the end date for the command schedule. 2023-12-25
commandSchedule.if_limit_weekday Boolean Whether to specify a day of a week for executing the command schedule. false: Execute the schedule throughout the whole week by default. true/false
commandSchedule.limit_weekday List From Monday to Sunday. [true, true, false, false, true, true, true]
commandSchedule.name String Type of the command schedule. Volume_Control
commandSchedule.op_time String Time on the day for schedule execution. 00:00:00
commandSchedule.type String Type: Command, default value. command
commandSchedule.operation Object Commands to be executed. See below for detailed information. {}
contentsSchedule List Program schedule []
contentsSchedule.if_limit_date Boolean Start date and end date. false: Keep playing the content. true/false
contentsSchedule.limit_date Object Start date and end date. {
"start": "2023-12-25",
"start_time": "00:00:00",
"end": "2023-12-25",
"end_time": "23:59:59"
}
contentsSchedule.if_limit_time Boolean The start time and end time on the day. false: Play the content the whole day by default. true/false
contentsSchedule.limit_time Object The start time and end time on the day. {
"end_time": "14:30:00",
"start_time": "14:00:00"
}
contentsSchedule.if_limit_weekday Boolean From Monday to Sunday. false: Play the content the whole week by default.
(Actual playback time: Intersection of Time, Day of a week, and Date)
true/false
contentsSchedule.limit_weekday List From Monday to Sunday [false, false, false, true, true, true, true]
contentsSchedule.name String Default value, representing program schedule. Play_Program
contentsSchedule.priority String Program priority 0~100... (Play the content in this order in rotation playback mode). Different program must have different priority, or the terminal cannot execute the schedule. 0
contentsSchedule.type String "rotation": Play the programs one by one based on program priority.
"spot": Insert a program into the playback sequence of the original schedule.
spot
contentsSchedule.type_priority Integer 100: spot, only play the spotted program with the highest priority.
200: rotation, play the programs in the scheduled order, and only play the spotted program when there's a spotted one added.
100
contentsSchedule.operation Object "id": Program ID,
"name": Program name,
"vsn": vsn file name of the program,
"source": Program type. The source of the server program is internet; that published via LAN is lan; and that published via USB drive is usb.
{
"id": 3132,
"name": "Playlist1625",
"vsn": "Playlist1625_d04bdcf85fa82735e47687ea9265126c_1380.vsn",
"source": "internet"
}

# Detailed description of some parameters

  1. schedules.commandSchedule.name: Type of the command schedule.
"Brightness_Control": Control brightness
"Volume_Control": Control volume
"Relay": Control relay
"Sleep": Sleep
"Colortemp_Control": Control color temperature
"Wakeup": Wake up terminal
"Reboot": Reboot
"Clear_Cache": Clear cache
"Switch_Signal_Source": Switch signal source
"Board_Relay": Control onboard relay
  1. schedules.commandSchedule.content: Value of the command in command schedule.
1. When the type of the command schedule is Control color temperature, Control brightness, or Control volume, this value is:
("Value" represents a certain value in real practice.)
{
"name": "Value", 
"value": 2000
}
value: A certain value 
2. When the type of the command schedule is Sleep, Wakeup, Reboot, or Clear cache, this parameter does not exist.
3. When the type of the command schedule is Switch signal source, this value is:
{
 "name": "Switch",
 "value": "async"
}
in which, value:
"async": Switch to asynchronized signal (DVI)
"sync": Switch to synchronized signal (HDMI)
4. When the type of the command schedule is Control relay:
{
  "name": "Relay",
  "value": "[0,1,0]"
}
Value: A list of the on/off status of the relay 1/2/3 respectively.
5. When the type of the command schedule is Control onboard relay:
{
  "name": "Board Relay",
  "value": "[1]"
}
value: The on/off status of the onboard relay.
  1. schedules.commandSchedule.operation: Commands to be executed in the command schedule.

Sleep:

{
"author_url": "api/action",
"karma": 1,
"content": "{\"command\":\"sleep\"}"
}

Wake up:

{
"author_url": "api/action",
"karma": 1,
"content": "{\"command\":\"wakeup\"}"
}

Reboot:

{
"author_url": "api/action",
"karma": 1,
"content": "{\"command\":\"reboot\"}"
}

Adjust brightness:

 {
"author_url": "api/brightness",
"karma": 2,
"content": "{\"brightness\":\"0\"}" 
}

Adjust color temperature:

{
"author_url": "api/colortemp",
"karma": 2,
"content": "{\"colortemp\":2000}" 
}

Adjust volume:

{
"author_url": "api/volume",
"karma": 2,
"content": "{\"musicvolume\":0}" 
}

Clear cache:

{
  "author_url": "api/clrresunused",
  "karma": 3,
  "content": "{}"
}

Switch signal source: Sync signal: hdmi

{
"author_url": "api/inputmode",
"karma": 2,
"content": "{\"inputmode\":\"hdmi\"}"
}

Async signal: dvi

{
"author_url": "api/inputmode",
"karma": 2,
"content": "{\"inputmode\":\"dvi\"}"
}

Control relay:

{
  "author_url": "api/relay",
  "karma": 2,
  "content": "[{\"relay\":1,\"delay\":0,\"status\":0},{\"relay\":2,\"delay\":0,\"status\":0},{\"relay\":3,\"delay\":0,\"status\":0}]"
}

Control onboard relay:

{
  "author_url": "api/board_relay",
  "karma": 2,
  "content": "[{\"relay\":1,\"delay\":0,\"status\":1}]"
}