Updated – December 31, 2022
SmartHome programs are used to individually map scenarios that cannot be implemented with direct links. The overview of the programs can be accessed in the menu under “Programs and shortcuts” – “Programs & control panel shortcuts”.

A new program is created by clicking on the “New” button at the bottom left. An existing one can be edited by clicking on the “Edit” button on the right in the line of the respective program.

Let's look at the first program listed here "A_EI_KY_Unlocked_Presence" by clicking on the "Edit" button:

According to the nomenclature mentioned at the beginning, this is apartment A, entrance, door lock, which should switch to the “unlocked” position when someone is present.
Here, the system variable “Presence” was first selected from the list of system variables by clicking on the “System status” button. The drop-down menus allow different scenarios, such as “on / not on”, “present / not present”, “trigger on update / check / trigger on change”. Here, the condition should be formulated in the IF branch that when the status changes from “not present” to “present”, the action(s) defined in the THEN branch are carried out.
The check box “Before executing…” usually remains activated in order to reset processes that may have been delayed by other programs with regard to the same components and to ensure that the program runs smoothly.
The THEN branch defines the intended action, which involves executing a script that sends an email (e.g. that the person is now present) and unlocking the door lock.
The program, which works in contrast to this, locks the door if the person is recognized as “not present”. In this way, insurance law aspects are protected and the insurance company will settle any break-in that occurs because the door can be proven to have been properly locked (via email and the system log).
The drop-down menu offers the variants “Device selection, System variable, Script”.
Scripts can be created in the so-called script editor and tested by clicking on the “Run” button. The script editor opens automatically as soon as the “Script” option is selected.

The script content:
string stdout;
string stderr;
system.Exec("/etc/config/addons/email/email 20", &stdout, &stderr);
Except for the “20” on the third line, everything is “standard” code. Only “20” refers to the email template number 20, the content of which is the email message “Person x is present”. Mail delivery is always initiated in this way.
The drop-down menu “immediately / delayed at” determines whether the action is carried out immediately or with a time delay (s, m, h).
In the “Lock unlocked” drop-down menu, the options “lock locked / open door / automatically lock after time” are available to choose from.
The script is saved by clicking on the “OK” button at the bottom left. The program is then saved by clicking on the “OK” button at the bottom left and is then available for immediate execution when the event occurs.