# Schedule

# Command Schedule

Parameters:

Field Required Type Description Example
startDate Yes String Start date "2024-12-14"
endDate Yes String End date "2025-12-14"
operationTime Yes String Execution time on the current day "23:59:59"
weeks Yes List<Boolean> Execution status (Monday to Sunday); "true" indicates that the command is executed. [true, false, true, true, true, false, true]
commandType Yes Enum Command type CommandScheduleType
Value Yes String The parameters required for creating the command See the details below.

Description:

 "commandSchedules.commandType" indicates the command type;"commandSchedules.value"  indicates the parameters required for creating the command
 1. For command type "BOARD_RELAY" (On-board relay status): "value" indicates the status of the relay (E.g.:"0"); 0: Off,1: On
 2. For command type "SWITCH_SIGNAL_SOURCE" (Switching signal source): "value" indicates the signal type (E.g.: "0"); 0: Sync signal (HDMI),1:Async signal (DVI)
 3. For command type "RELAY" (Relay status): "value" indicates the status of relay 1-3 (E.g.:"[0, 1, 0]"); 0: Off, 1: On
 4. For command type "VOLUME" (Adjusting volume): "value" indicates the volume (E.g.: "66").
 5. For command type "BRIGHTNESS" (Adjusting brightness): "value" indicates the brightness value (E.g.: "11").
 6. For command type "COLORTEMP" (Adjusting color temperature): "value" indicates the color temperature value (E.g.: "10000", range: 2000-10000)
 7. For command type "SLEEP" (Device sleep), "WAKEUP" (Waking up device), "REBOOT" (Rebooting device), and "CLEAR_CACHE" (cleaning cache), "Value" is not a required field.

Example:

List<Boolean> weeks = Arrays.asList(true, false, true, true, true, false, true);
// 1. Create command schedule
CommandSchedule commandSchedule = ScheduleGenerator.createCommandSchedule("2024-12-14", "2024-12-14",
        "18:00:00", weeks, CommandScheduleType.BOARD_RELAY, "1");
// 2. Create schedule
Schedule schedule = Schedule.builder().commandSchedule(Collections.singletonList(commandSchedule))
                            .contentsSchedule(new ArrayList<>()).build();

Response:

{
    "contentsSchedule":[]"commandSchedule":[
        {
            "operation":{
                "author_url":"api/board_relay",
                "karma":2,
                "content":"[{\"relay\":1,\"delay\":0,\"status\":1}]"
            },
            "op_time":[
                "18:00:00"
            ],
            "if_limit_date":true,
            "limit_date":{
                "start":"2024-12-14",
                "end":"2024-12-14",
                "start_time":"00:00:00",
                "end_time":"23:59:59"
            },
            "if_limit_weekday":false,
            "limit_weekday":[
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ],
            "content":{
                "name":"Board Relay",
                "value":"[1]"
            },
            "type":"command",
            "name":"Board_Relay"
        }
    ]
}

# Program Schedule

Parameters:

Field Required Type Description Example
startDate Yes String Start date "2024-12-14"
endDate Yes String End date "2025-12-14"
startTime Yes String Start time on the current day "00:00:00"
endTime Yes String End time on the current day "23:59:59"
weeks Yes List<Boolean> Playback status in a week (Monday-Sunday); "true" indicates that the program is played on the day. [true, false, true, true, true, true, true]
programPlayForm Yes Integer Playback mode 0: carousel,1: Spot 0
programId Yes Integer Program ID 111
vsnFileName Yes String vsn File name "Program name_334D90B44F26E0D7C8298B7388CD104B_1445.vsn"
programPriority Yes Integer Playback order of the programs. 0~100...(for Carousel mode). The orders of the programs must be different, otherwise the terminal cannot executive the schedule. 1

Example:

List<Boolean> weeks = Arrays.asList(true, true, true, true, true, true, true);
ProgramSchedule programSchedule = ScheduleGenerator.createProgramSchedule("2024-12-14", "2024-12-14",
        "18:00:00", "18:00:00", weeks,
        0, 111, "Program name_334D90B44F26E0D7C8298B7388CD104B_1445.vsn", 1);
Schedule schedule = Schedule.builder().contentsSchedule(Collections.singletonList(programSchedule)).commandSchedule(new ArrayList<>()).build();

Response:

{
    "contentsSchedule":[
        {
            "type_priority":200,
            "priority":1,
            "if_limit_time":true,
            "limit_time":{
                "start_time":"18:00:00",
                "end_time":"19:00:00"
            },
            "operation":{
                "id":111,
                "name":"Program's name",
                "vsn":"Program name_334D90B44F26E0D7C8298B7388CD104B_1445.vsn",
                "source":"internet"
            },
            "if_limit_date":true,
            "limit_date":{
                "start":"2024-12-14",
                "end":"2024-12-14",
                "start_time":"00:00:00",
                "end_time":"23:59:59"
            },
            "if_limit_weekday":false,
            "limit_weekday":[
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ],
            "type":"rotation",
            "name":"Play_Program"
        }
    ],
    "commandSchedule":[]
}

# Schedule Example of Multiple Commands for Multiple Programs

(2 programs in carousel mode, 3 schedule commands)

Example:

List<Boolean> weeks = Arrays.asList(true, true, true, true, true, true, true);
// 1. Create program schedule
// 1.1. Program schedule 1
ProgramSchedule programSchedule1 = ScheduleGenerator.createProgramSchedule("2024-11-14", "2024-12-14",
        "18:00:00", "20:00:00", weeks, 0, 111, "programName_334D90B44F26E0D7C8298B7388CD104B_1445.vsn", 1);
// 1.2. Program schedule 2
// You should set the playback order for a schedule of multiple programs: 0\~100...(for Carousel mode). The orders of the programs must be different, otherwise the terminal cannot executive the schedule.
ProgramSchedule programSchedule2 = ScheduleGenerator.createProgramSchedule("2024-11-14", "2024-12-14",
        "18:00:00", "20:00:00", weeks, 0, 111, "demo_326F26E0D6798B76388C6D104B_1445.vsn", 2);
List<ProgramSchedule> programSchedules = Arrays.asList(programSchedule1, programSchedule2);

// 2. Create command schedule
CommandSchedule commandSchedule1 = ScheduleGenerator.createCommandSchedule("2024-12-14", "2024-12-14", 
        "12:00:00", weeks, CommandScheduleType.REBOOT, null);

CommandSchedule commandSchedule2 = ScheduleGenerator.createCommandSchedule("2024-12-14", "2024-12-14",
        "18:00:00", weeks, CommandScheduleType.BOARD_RELAY, "1");

CommandSchedule commandSchedule3 = ScheduleGenerator.createCommandSchedule("2024-12-14", "2024-12-14",
        "16:00:00", weeks, CommandScheduleType.BRIGHTNESS, "33");
List<CommandSchedule> commandSchedules = Arrays.asList(commandSchedule1, commandSchedule2, commandSchedule3);

// 3. Create schedule (2 programs in carousel mode, 3 schedule commands)
Schedule schedule = Schedule.builder().contentsSchedule(programSchedules).commandSchedule(commandSchedules).build();

Response:

{
    "contentsSchedule":[
        {
            "type_priority":200,
            "priority":1,
            "if_limit_time":true,
            "limit_time":{
                "start_time":"18:00:00",
                "end_time":"20:00:00"
            },
            "operation":{
                "id":111,
                "name":"programName",
                "vsn":"programName_334D90B44F26E0D7C8298B7388CD104B_1445.vsn",
                "source":"internet"
            },
            "if_limit_date":true,
            "limit_date":{
                "start":"2024-11-14",
                "end":"2024-12-14",
                "start_time":"00:00:00",
                "end_time":"23:59:59"
            },
            "if_limit_weekday":false,
            "limit_weekday":[
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ],
            "type":"rotation",
            "name":"Play_Program"
        },
        {
            "type_priority":200,
            "priority":2,
            "if_limit_time":true,
            "limit_time":{
                "start_time":"18:00:00",
                "end_time":"20:00:00"
            },
            "operation":{
                "id":111,
                "name":"demo",
                "vsn":"demo_326F26E0D6798B76388C6D104B_1445.vsn",
                "source":"internet"
            },
            "if_limit_date":true,
            "limit_date":{
                "start":"2024-11-14",
                "end":"2024-12-14",
                "start_time":"00:00:00",
                "end_time":"23:59:59"
            },
            "if_limit_weekday":false,
            "limit_weekday":[
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ],
            "type":"rotation",
            "name":"Play_Program"
        }
    ],
    "commandSchedule":[
        {
            "operation":{
                "author_url":"api/action",
                "karma":1,
                "content":"{\"command\":\"reboot\"}"
            },
            "op_time":[
                "12:00:00"
            ],
            "if_limit_date":true,
            "limit_date":{
                "start":"2024-12-14",
                "end":"2024-12-14",
                "start_time":"00:00:00",
                "end_time":"23:59:59"
            },
            "if_limit_weekday":false,
            "limit_weekday":[
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ],
            "type":"command",
            "name":"Reboot"
        },
        {
            "operation":{
                "author_url":"api/board_relay",
                "karma":2,
                "content":"[{\"relay\":1,\"delay\":0,\"status\":1}]"
            },
            "op_time":[
                "18:00:00"
            ],
            "if_limit_date":true,
            "limit_date":{
                "start":"2024-12-14",
                "end":"2024-12-14",
                "start_time":"00:00:00",
                "end_time":"23:59:59"
            },
            "if_limit_weekday":false,
            "limit_weekday":[
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ],
            "content":{
                "name":"Board Relay",
                "value":"[1]"
            },
            "type":"command",
            "name":"Board_Relay"
        },
        {
            "operation":{
                "author_url":"api/brightness",
                "karma":2,
                "content":"{\"brightness\":\"33\"}"
            },
            "op_time":[
                "16:00:00"
            ],
            "if_limit_date":true,
            "limit_date":{
                "start":"2024-12-14",
                "end":"2024-12-14",
                "start_time":"00:00:00",
                "end_time":"23:59:59"
            },
            "if_limit_weekday":false,
            "limit_weekday":[
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ],
            "content":{
                "name":"Value",
                "value":33
            },
            "type":"command",
            "name":"Brightness_Control"
        }
    ]
}