Scheduler


The Scheduler node is the default starting routing rule node for rules with Trigger Type as Scheduled, where users can specify assets, set output msgs, and select a pre-set schedule generated by a third-party app through API or set a schedule for the rule to be effective for subsequent routing. This node cannot be deleted.

Node Type

This node is the default starting node for all routing rules with Trigger Type as Scheduled. For more information, see Creating Rules.

Input and Output Ability

This node has 0 entry points and 1 exit point.

Node Properties

../../_images/scheduler.png


Name

The name for this node.


Asset

The asset(s) this rule applies to. Specify the assets either By asset ID or By product. If a pre-set schedule is selected in Timer, this area will be pre-filled.

  • By asset ID: Enter the asset ID, separating multiple asset IDs using commas.
  • By product: Select one or multiple products, after which the devices under the products will be listed in the drop-down below. Select the device(s) as per required.


Set Date Range

The date range that this rule is effective. Select a start and end date by clicking + Add Date Range. If a pre-set schedule is selected in Timer, this area will be pre-filled. If left blank, this rule is perpetually in effect.


Add multiple date ranges by clicking + Add Date Range.


Default Output Msg

The default message of String data type that will be output to the output msg.


Set Specific Date

You can also set specific dates to trigger the rule, as well as an accompanying message which will overwrite the Default Output Msg above. If a pre-set schedule is selected in Timer, this area will be pre-filled.


You can set a specific Date/Time or Day/Time.

  • Date/Time: Select a specific date and time and enter the accompanying message if required. Add multiple dates by clicking + Add Date/Time.
  • Day/Time: Select a specific day (Mon-Sun) and time and enter the accompanying message if required. Add multiple days by clicking + Add Day/Time.


If a date range is set for Set Date Range above, the dates/days specified here must be within the date range to be valid.


Description

The description for this node.

Samples

Input Sample

{
  "validPeriods": [
    {
      "startTime": "2022-06-01",
      "endTime": "2022-06-30"
    }
  ],
  "specialSchedules": [
    {
      "time": "2022-06-11 05:00:00",
      "output": "lighton"
    },
    {
      "time": "2022-06-18 05:00:00",
      "output": "lighton"
    }
  ],
  "defaultValue": "lightoff",
  "scheduleName": "demo_scheduler",
  "assetIds": [
      "M2DnLsrU",
      "YtywtbYR"
  ]
}

Output Sample

{
  "MetaData": {
    "cron": "38 1 7 6 6 ? 2022",
    "jobName": "specialSchedule-2a9145c80e800000-38 1 7 6 6 ? 2022",
    "commandValue": "lighton",
    "validPeriods": "[2022-06-01 2022-06-30]",
    "isWeekly": "false",
    "assetIds": "M2DnLsrU,YtywtbYR",
    "ruleId": "2a9145c80e800000",
    "scheduleId": "2a91490ed4002000"
  },
  "Body": "M2DnLsrU,YtywtbYR"
}