Automation — Control Loops

"Create automated control loops without coding. Configure sensors, conditions, and actions visually — similar to PLC programming. Your control loops are automatically converted to LUA scripts visible in the Programs tab."

A control loop is an automated routine that reads input from sensors, applies rules, and drives outputs. For example: "read the temperature sensor → if it's above 25°C → turn on the air conditioning." Traditionally, this requires programming. Control Loops lets you build these rules visually.

The Control Loop Editor

Control Loops — the main list showing configured control loops with their status.
Control Loops — the main list showing configured control loops with their status.

When you create a new control loop (New +), the editor shows two main tables:

Input Devices Table

The top table lists sensors — devices the loop reads from.

ColumnMeaning
DeviceThe physical device name (e.g. RIO-1, Sonoff-3).
PortWhich specific port/channel on the device.
DescriptionA human-readable label (e.g. "Office temperature sensor").
XThe coordinate reference used in formulas — X1 for the first input, X2 for the second, etc.
ValueThe current value being read from this sensor.

Output Devices Table

The bottom table lists actuators — devices the loop controls.

ColumnMeaning
DeviceThe physical device name.
PortWhich port/channel.
DescriptionHuman-readable label.
YThe coordinate reference — Y1 for the first output, Y2 for the second, etc.
ValueThis is where you write the formula. The formula references input coordinates (X1, X2...) and produces the output. For example: IF(X1>25, 1, 0) turns the output ON when the temperature (X1) exceeds 25°C.

Click Add virtual output to add more output rows.

Table Syntax Guide

New Control Loop — the editor with input fields for loop parameters and conditions.
New Control Loop — the editor with input fields for loop parameters and conditions.
Control Loop syntax reference — formula operators and expression examples.
Control Loop syntax reference — formula operators and expression examples.

On the right side of the editor, an expandable Table Syntax Guide provides reference for writing formulas. Sections include:

Toolbar Buttons

ButtonWhat It Does
TimingSet how often the loop executes (e.g. every 1 second, every 5 seconds, every minute).
Close GuideHide/show the Syntax Guide panel.
DevicesAdd input sensors and output actuators to the tables.
SaveSave the control loop. It is automatically converted to a Lua script.
CloseExit the editor.
After saving a control loop, go to the Programs tab — your loop appears as a Lua script that you can start, stop, and even further customise if needed.

Complete Formula Reference

The following functions and operators are available in Control Loop formulas (sourced from the official Abilis tutorial):

Mathematical Operators

Standard arithmetic: + (addition), - (subtraction), * (multiplication), / (division), ( ) (brackets for grouping).

Mathematical Functions

FunctionWhat It Does
ABS(value)Returns the number with a positive sign (absolute value).
EVEN(value)Returns 1 if the number is even, 0 if odd.
ODD(value)Returns 1 if the number is odd, 0 if even.
INT(value)Returns the integer part, removing decimals.
ROUND(value, decimals)Rounds the number to the specified decimal places.
LOG10(value)Returns the base-10 logarithm.
MOD(value)Returns the decimal part, removing the integer.
RAND()Returns a random decimal between 0 and 1.
RANDBETWEEN(from, to)Returns a random integer between the two values.
POW(value, exponent)Raises the number to the exponent. Use decimals for roots (e.g. POW(X1, 0.5) = square root).
SQRT(value)Returns the square root.

Logical Functions

FunctionWhat It Does
NOT(value)Returns true if input is false, and vice versa.
AND(v1, v2 [, v3...])Returns true only if all inputs are true. Up to 10 values.
OR(v1, v2 [, v3...])Returns true if any input is true. Up to 10 values.
XOR(v1, v2)Returns true if exactly one input is true and the other is false.

Conditional

IF(condition, value_if_true, value_if_false)

Example: IF(X1>25, 1, 0) → output 1 when temperature exceeds 25°, otherwise 0.

Using Past Values

You can reference a device's previous value by adding a time offset in brackets: X1(time_to_past). The time unit is determined by the interval set in the Timing section of the loop. For example, if timing is set to 5 seconds, X1(3) means "the value of X1 from 15 seconds ago" (3 × 5s).

Nesting Functions

Functions can be chained by nesting one inside another. For example, to get the average of the square root of two sensor inputs:

AVERAGE(POW(X1, 0.5), POW(X2, 0.5))

Anteklab Technical Support Email: tem@antek.it
Tel: +39 0376 16262,27