Set LAN Schedule

555

# Set LAN Schedule

Path:

/api/lanschedule

Method: PUT

API Description: This can be used to enable automatic control over the player, including controlling playback order (such as program carousel) and executing commands at specified times.

Use Cases:

  1. Daytime work, nighttime sleep (power-saving)
  2. Automatically play holiday programs during holidays and regular programs during normal days
  3. ......

Schedules are categorized into program schedules and command schedules.
Program schedule: Controls the program playback order, including spot and carousel, playing specific programs at specified time.
Command schedule: Controls the execution of specific commands at specific time.

Request

  • Program Schedule
    The program schedule allows control over the following:
    Program playback time: date, and day of the week.
    Program playback order: spot and carousel.
    Keywords:
    (1) Time: Start and end times for the day
    "if_limit_time": false, // false represents default playback throughout the day "limit_time": { // Start and end times, where the start time later than the end time implies spanning over days
    "end_time": "06:00:00",
    "start_time": "18:00:00"
    }
    (2) Date: Start and end dates "if_limit_date": false, // false represents continuous playback by default
    "limit_date": { // Start and end dates, accurate to seconds
    "end": "2018-12-14",
    "end_time": "23:59:59",
    "start": "2018-12-14",
    "start_time": "00:00:00"
    }
    (3) Days of the week: Monday to Sunday "if_limit_weekday": false, //false represents default playback throughout the week
    "limit_weekday":[true, true, true, true, true, true, true]
    (4) Actual playback time: Intersection of time, days of the week, and date
    (5) priority: Program priority order 0~100... (executed in this order during carousel). Each priority must be unique; otherwise, the terminal cannot execute the schedule.
    (6) type_priority:
    100 //Spot: Only the spot program with the highest priority will be played within the valid time range.
    200 //Carousel: Programs will be played in sequential order within the valid time range, with spot programs taking priority when available.
    300 //Spare: If there are no carousel or spot programs, the spare program that meets the conditions and has the highest priority will be played.
    (7) operation: "operation": {
    "name": "Playlist2924", //Program name
    "source": "internet", //Program type, "internet" for programs from the server, "lan" for programs published within the local network, and "usb" for programs published from a USB drive.
    "vsn": "Playlist2924_334D90B44F26E0D7C8298B7388CD104B_1445.vsn", //Program .vsn file name, obtainable by retrieving the player playlist. "id": 23164 //Program ID, optional
    }

  • Command Schedule
    Commands such as signal source switching and restart are executed at specific times. Except for these two commands, others are state commands, which need to appear in pairs; otherwise, there will be only one state throughout the day.
    Keywords:
    (1) Time: "op_time":["16:48:21"], //Execution time for the current day
    (2) Date: Start and end dates
    "if_limit_date": false, // false represents continuous execution by default
    "limit_date": { // Start and end dates
    "end": "2018-12-14",
    "start": "2018-12-14",
    }
    (3) Days of the week: Monday to Sunday
    "if_limit_weekday": false, //false represents default playback throughout the week
    "limit_weekday":[true, true, true, true, true, true, true]
    (4) Command: operation // Commands to be executed
    There are seven types of commands:
    Sleep
    "operation": {
    "author_url": "api/action",
    "karma": 1,
    "content": "{"command":"sleep"}"
    }
    Wake Up
    "operation": {
    "author_url": "api/action",
    "karma": 1,
    "content": "{"command":"wakeup"}"
    }
    Restart
    "operation": {
    "author_url": "api/action",
    "karma": 1,
    "content": "{"command":"reboot"}"
    }
    Brightness Adjustment
    "operation": {
    "author_url": "api/brightness",
    "karma": 2,
    "content": "{"brightness":"0"}" //Ranges from 0-100
    }
    Color Temperature Adjustment
    "operation": {
    "author_url": "api/colortemp",
    "karma": 2,
    "content": "{"colortemp":2000}" //Ranges from 2000-10000
    }
    Volume Control
    "operation": {
    "author_url": "api/volume",
    "karma": 2,
    "content": "{"musicvolume":0}" //Ranges from 0-15
    }
    Signal Source Switching
    Synchronous Signal:
    "operation": {
    "author_url": "api/inputmode",
    "karma": 2,
    "content": "{"inputmode":"hdmi"}"
    }
    Asynchronous Signal:
    "operation": {
    "author_url": "api/inputmode",
    "karma": 2,
    "content": "{"inputmode":"dvi"}"
    }
    Example

    "commandSchedule": [
        {
            "operation": {
                "author_url": "api/brightness",
                "karma": 2,
                "content": "{\"brightness\":\"0\"}"
            },
            "op_time": [
                "16:52:00"
            ],
            "if_limit_date": false,
            "limit_date": {
                "start": "2018-12-13",
                "end": "2018-12-13"
            },
            "if_limit_weekday": false,
            "limit_weekday": [
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ]
        }
    ],
    "contentsSchedule": [
        {
            "limit_date": {
                "end": "2018-12-14",
                "end_time": "23:59:59",
                "start": "2018-12-14",
                "start_time": "00:00:00"
            },
            "limit_time": {
                "end_time": "18:00:00",
                "start_time": "06:00:00"
            },
            "limit_weekday": [
                true,
                true,
                true,
                true,
                true,
                true,
                true
            ],
            "operation": {
                "name": "Playlist2924",
                "source": "internet",
                "vsn": "Playlist2924_B9D968E64941B7EE026D65448079583F_1341.vsn",
                "id": 22729
            },
            "if_limit_date": false,
            "priority": 0,
            "if_limit_time": false,
            "if_limit_weekday": false,
            "type_priority": 200
        }
    ]
}