Skip to main content

Event schedule (Scheduler)

An event-based scheduler

Important

The event schedule is available only on iRidi Server

Schedule in server logic is an event-based scheduler available in SCHEDULE when configuring iRidi Server logic. Event properties:

  • Events can trigger once or at a specified interval;
  • An event can start (Start) and finish (Finish); its start and finish can activate server routines;
  • An event can be running (In process) or not running (Not in process). Its state can be used as a restricting condition (BUT ONLY IF) in server routines;
  • An event's trigger time can be changed while the server is running;
  • An event's repetition interval cannot be changed while the server is running;
  • An event can be enabled and enabled while the server is running.

Studio2019_Server_Scheduler.png

Schedule types​

Schedules are divided into 2 types: Advanced and Simple .

Schedule_Advanced.png

Advanced - advanced (main) schedules. Advanced schedules let you preconfigure an event's start and end times and days, as well as its repetition interval, in Studio. Advanced schedules also work with the TimeTable item.

Note

Advanced schedule configuration is described in detail below.

Schedule_Simple.png

Simple - simplified schedules. Simplified schedules have fewer settings but let you work with editable routines from a running Panel Project.

Note
  • Simplified schedules let you configure only the event's start date and time. To associate an action with the end of an event, create a separate event (Event).
  • Editable routine configuration is described in detail here.

Schedule event settings​

  • Name - event name.
  • Description - a short description (optional).
  • Start - event start date and time.
    • Select time - date and time.
    • Sunrise, Sunset - sunrise or sunset time. To use this, configure the astronomical timer.
  • Finish - event finish date and time. Specify the date is unchecked by default, so the event finishes on the day it starts. Select the checkbox to specify a finish date.
    • Select time - date and time.
    • Sunrise, Sunset - sunrise or sunset time. To use this, configure the astronomical timer.

Sunrise and Sunset also provide a time-offset option relative to the current moment.

The time offset has two parameters:

"-" - a negative time offset relative to the event;

"+" - a positive time offset relative to the event.

Wait_time.png

  • Repeat - event repetition interval. If disabled, the event triggers 1 time, at the configured date and time. Repetition settings are described below.
  • End - when to stop repeating the event (if repetition is enabled).
    • Never - never.
    • Date - on the specified date.

Repeat: event repetition settings​

  • Repeat - event repetition interval.
    • Never - do not repeat the event. It triggers 1 time, at the configured date and time.
    • Every Day - every day at the specified time.
    • Every Week - every week on the weekday it started. For example, every Monday.
    • Every 2 Weeks - every 2 weeks on the weekday it started. For example, every second Sunday.
    • Every Monts - every month on the date it started. For example, on the 23rd of every month.
    • Every Year - every year on the date and month it started. For example, every January 1.
    • Custom - configure repetition by days, weeks, months, or years, but at a longer interval. For example, every 3 days, or every 2nd Monday of the specified month.
      • Period - repetition interval.
        • By Days - repeat every Nth day, starting from the event's start date. For example, every 2nd day.
          • Every: Days - repetition interval in days, from 1 to 365.
        • By Weeks - repeat every Nth week on the specified weekdays, starting from the event's start date. For example, Thursday of every 2nd week.
          • Every: Weeks - repetition interval in weeks, from 1 to 52.
          • On specified days of week - specify the weekdays on which to repeat the event.
        • By Months - repeat every Nth month. Select whether to repeat on specified dates or specified days of the month. For example, every 2nd month on the 23rd, or the 1st Monday of each month.
          • Every: Months - repetition interval in months, from 1 to 12.
          • On specified dates of month - repeat on the specified dates of the month. You can select several dates.
          • On specified days of month - repeat on specified days of the month: the 1st Monday, the 4th Sunday, ...
        • By Years - repeat every Nth year.
          • Every: Years - repetition interval in years.
          • On specified months - months of the year in which the event repeats. It triggers on the event's start date.
          • On specified days - to repeat on a specified weekday instead of a date of the month, select At specified Day. For example, the event can trigger on the 1st Monday of the month.
  • End - the date on which event repetition must stop.
    • Never - never.
    • Date - select a date.

Astronomical timer​

The astronomical timer creates schedules and routines linked to sunrise and sunset. For example, a schedule can turn outdoor lighting on at sunset and off at sunrise. The astronomical timer does not require an Internet connection.

  1. Open Settings for the server project:

Studio2019_ServerSettings_Open_1.png

  1. Specify the Location :
  • Latitude and Longitude - latitude and longitude of the server location as decimal values.

Studio2019_Scheduler_Location.png

On the System tokens tab of the server project, you will find the Latitude and Longitude tokens in the Project folder. These tokens store the longitude and latitude specified in the project settings. Their values can be changed or retrieved using the script methods IR.SetVariable and IR.GetVariable.

LL.png

Example:

IR.AddListener(IR.EVENT_START, 0, function () {
//записать в токен "Latitude" значение "16.155562":
IR.SetVariable("System.Project.Latitude", 16.155562);
//присвоить переменной "lat1" значение токена "Latitude":
var lat1 = IR.GetVariable("System.Project.Latitude");

//записать в токен "Longitude" значение "122.145897":
IR.SetVariable("System.Project.Longitude", 122.145897);
//присвоить переменной "long1" значение токена "Longitude":
var long1 = IR.GetVariable("System.Project.Longitude");

//вывести значения переменных в лог:
IR.Log(lat1 + " / " + long1);
});
  1. Configure the Routines for the astronomical timer. More configuration information is available here.