Skip to content


Events is a simple mechanism for using Lan Controller as an automaton that performs programmed actions in the event of certain conditions. For example, turn on the OUT1 when the temperature exceeds a certain value or send an e-mail when the logic state changes, etc. It is possible to combine two conditions using a logical operator and additionally make the execution of the action conditional on the state of another event entry.

Elements of page


The page shows a table of events. It shows information about set events, current state of conditions (No / Yes) and whether the result of OUT, PWM, EVENT, AutoSwitch is currently true (e.g. checks if OUT1==1) .The last column contains checkboxes to enable the event (On) and make it permanent (Per), and buttons to delete, edit or copy the event.

Above the table there is a button to add a new entry.

Events - Form

  1. On and Per checkboxes to enable the event and make it permanent.
  2. The first condition (A, basic). The condition consists of 3 elements:

    • source - analog and digital inputs. Among the digital input options, there are also EVENT virtual variables (described below).
    • the operator >=, < (for digital inputs the = operator is always used)
    • reference value and hysteresis
  3. The operator between conditions (A i B) allows you to link two conditions with each other. If the operator is not selected (left with value -), then the second condition will be inactive.

  4. The second condition (B) is active only when an operator between the conditions is selected (point 3).
  5. Operator that activates a special condition C, which allows making an event dependent on the result of conditions A and B of another event.
  6. Condition (C) specifying the dependence on the state of the conditions of another event. This means that the action of the event is executed only when the condition C is met, i.e. the conditions A and B of another selected event.

    For example, in the image above showing event table, the action of the EV 3 event will be executed only if its basic conditions A and B are met and the C condition, which here is the A condition for the EV 1 entry . The important thing is that if condition C is not met, no action will be performed, including the moment when condition C stops to be met.

    This can be used in conjunction with the Scheduler function to define day-night activities. For this purpose, in Scheduler it is necessary to control, for example, the EVENT variable, so that its setting to 1 defines the day, and to 0 the night. In events, add an entry with a condition that checks the state of the selected EVENT variable, with any action, without having to activate this entry - it is enough that it is set. Next, add the sets of events for day and night, so that these "for day" will be with the condition C = 1, and "for night" with C = 0.

  7. Action to be performed when the condition is met.

    It is defined by the following parameters:

    • Action - setting the state of the OUT or PWM output, enabling the AutoSwitch function for the output, sending an HTTP request, sending an SMS and others.
    • Value - to be set for OUT, PWM, EVENT actions, for which it defines what value will be set on the output or variable.
    • Mode - allows you to specify when the action will be performed: when the condition begins to be met, when it stops being met, or both (default behavior, compatible with previous versions of the software). Available since SW 1.60a.
    • On delay - to be set for OUT, PWM, EVENT actions, delays the activation of the action after the condition is satisfied. Available since SW 1.57.
    • Off delay - to be set for OUT, PWM, EVENT actions, delays the deactivation of the action after the condition is no longer satisfied.

    Action when the condition is no longer met

    Once the condition is no longer met, some actions have a special effect:

    • OUT, PWM, EVENT with a value of 1 or 0, will work as if with a value opposite to the set one, e.g. OUT0=1 will work as OUT0=0 for deactivation.
    • eMail, SMS will send the second variant of the message (the first variant is sent when the condition is met).
    • AutoSwitch from HW 3.5+ SW 1.38 remembers the state of the output before starting the AutoSwitch action, so that when the event ceases, the output returns to the state it was before the AutoSwitch action.

    Action of events and the Per option

    Normally, an event action is executed when state of its condition changes (satisfied or not). For analog sources, this means that the action will be performed when going over the threshold both up and down. For digital sources where there are only two states, the action will be performed virtually every time the value of the source changes.

    However, with the Per option, ie a permanent event, the action is executed as long as the condition is met. Option to be used with OUT, PWM, EVENT actions, over which the event takes control, ie they cannot be changed then outside of events (each change will be overwritten with the change from the event).

  8. Table of logical states.

    An auxiliary operator action table, showing the operator's possible results depending on the conditions.

EVENT variables

EVENT variables can have a value of either 0 or 1. They can be used as a source in Events and as an action in Events and Scheduler. Their value can be changed not only as a result of the mentioned action, but also by HTTP request or the MQTT command (eventX=Y, details in MQTT client).

As a result, you can prepare different variants of events, depending on the EVENT variables. For example, in Scheduler, set EVENT at given times, and in Events, as one of the conditions, use the dependency EVENT, similar to the screenshots below. In the example, OUT0 is switched on at a lower DS1 temperature during the day, between 7:30 and 19:30 than during the night.

EVENT - Scheduler settings

EVENT - Events settings


Combining multiple events

Events can be related to each other using EVENT variables that can store the results of individual events. Then the EVENT variables should be used as components of the conditions of a new event in which they will be associated by the selected operator. As a result, you can define more complicated conditions, incl. connect events with the OR operator as in version SW 1.36 (details in the section below).

Events - combining multiple

Changed operation in HW 3.5+ SW 1.36

Active events with the same Action, one of OUT, PWM, EVENT, are considered together whenever their conditions change, with the priority of executing the action of the event whose conditions are met. In other words, such events will act as if they were linked by an OR operator.

For example, consider the events in the image below. Event 1 whose conditions are true and not event 2 is active, even if its condition has changed recently.

Events - example

If the conditions of events with mutually exclusive actions are met, e.g. OUT0=1 and OUT0=0, the action on the event on a further position will be executed.

In other versions, events with the same action are considered independently of each other when their conditions change. As a result, the action of the event whose condition recently changed is executed.