Program

Program logo

Program executes custom logical operations. Useful for custom automation processes.

About

Program is a universal logic task which contains a list of trigger conditions (Triggers) and list of commands (Commands) to execute when input triggers are triggered.


Help

Program task can be enabled and disabled by setting the Enabled setting. The Restart On Retrigger setting defines the behaviour of the program execution when program is executed while previous execution is still running (e.g. can happen when program is using delays). If Restart On Retrigger is true the previous task is terminated and the program is executed from the beginning. If Restart On Retrigger is false the trigger will be ignored and the previous task will execute without interruption.

Programs can be executed manually or with triggers. Each trigger contains an input value and triggering condition. Multiple triggering conditions can be entered in the Triggers list. Program is executed when any trigger condition is met.

Program

Picture 1: Program task settings

Triggers

Trigger contains an object value and triggering condition. Conditions can be value comparisons (=, <, <=, >=, >) or value changes (ValueChanged). Triggers can be edited in the trigger editor form.

Trigger form

Picture 2: Trigger form

Conditions for triggering are rechecked with each update of the object value. By default the trigger is only triggered the first time the condition is met. If the same condition is met on next value update (i.e. device sends the same value two times in succession) trigger is not triggered. Setting the Allow Retrigger option enables running the task even when the same condition is met repeatedly with each value update.

Commands

Several different commands can be used for implementing different logical operations and command sequences. Command are edited in the command tree editor.

Set Value

Sets output value to a constant value or to the value of an object.

Set value

Picture 3: Set value form

Calculation function can also be assigned to variable (e.g. +1 will give your object increased value by 1).

Run

Executes object function.

Run form

Picture 4: Run form

If, Else

If Checks the condition where input property is compared to a constant value or to a value of an object. The settings of the if command can be edited in If editor form.

If form

Picture 5: If form

Any combination of subcommands can be inserted below the If command. Subcommands are executed when conditions are met. Else is executed if conditions for If command were not met. Else can only be inserted after If command.

Delay

Delays the program execution for a constant time or a delay defined by an input value linked to an object.

Delay form

Picture 5: Delay form

Http Request

Http Request Is used to execute commands on devices that support http API calls. Devices and other programs can be controlled with this command (i.e. XBMC, boxee, IP cameras, DVRs and other automation systems). Commands can be executed using Basic Authentication, Username and Password. Optionally the Username and Password settings can be injected into the URL string. If the POST Data is empty the call is executed using the HTTP GET command. If POST Data is filled the call is executed using HTTP POST command. Custom Headers (e.g. custom SOAP headers) and Content Type can be used with the call HTP POST. Text strings for URL and POST Data can include value parameters. Parameters can be added by clicking on the "..." button.

HTTP request

Picture 5: Http request form

Exit

Exits the program execution. Exit can be used to terminate the program when certain condition is met (e.g. in an If command).

Restart

Restarts the program execution after a constant time or a delay defined by an input value linked to an object.

Abort Commands

Abort Commands are executed on program abort. Program is aborted when Running property is set to false or by calling the Abort() function. Program is also aborted on configuration restart when uploading the configuration. Commands are executed only if abort is called when program is still running. This can happen if a main program is waiting for some delay (Delay command is used).

User Interface

Enabled, Running and Blocked values can be inserted into themes via Boolean control. Run and Abort functions can be called via RunFunction control.

Examples

Example 1: Send alert to user

  1. Add trigger.
    1. Select input object (e.g. DSC zone, KNX DPT, Analog Threshold).
    2. Select object value.
    3. Set condition to Equals.
    4. Set value to True.
  2. Add Run command.
    1. Select the node of the user you want to notify (select Users node if you want to notify all users).
    2. Select the SendAlert function.
    3. Insert text.
  3. To filter the sequential sending of the alert messages, make sure Restart On Retrigger option is not set. Optionally a delay command in the end of the program (i.e. block sending of messages for a certain period).

Example 2: Mode selection

  1. Add trigger.
    1. Select input object (e.g. Integer variable for mode selection).
    2. Select object value.
    3. Set condition to OnChange.
  2. Add If commands for each mode.
  3. Add commands (e.g. Run command calling a Scene) under If commands for each mode.

Example 3: Trigger a program with a KNX push button which sends only true values

  1. Add trigger.
    1. Select input object (KNX data point for push button)
    2. Select object value (value).
    3. Set condition to Equals.
    4. Set value to True.
    5. Check Allow Retrigger option (because button sends only true values).
  2. Add commands (e.g call Run() function from a Scene task)

Example 4: Pulse output

  1. Add trigger.
    1. Select input object (KNX data point)
    2. Select object value.
    3. Set condition to Equals.
    4. Set value to True.
  2. Add Delay command.
  3. Add Set Value command, which sets the input object back to false value.
Download Examples