Documentation
Variables
A variable is a container for a value. The value can be boolean, float, integer, or string. Usually, variables contain status values of devices. In addition, new user defined variables can be created to store individual values which could be used for visualization or scripts.
System Variables are no normal variables in the usual sense as they are only available within scripts.
IP-Symcon uses variables to exchange or store data. Variables that contain status values enable the use of devices, e.g., show the temperature of a thermometer in the visualization or activate and deactivate the lighting.
Description
There are two types of variables within IP-Symcon:
Status Variables
Every instance of a device can have one or more status variables that are created automatically. These variables store the status of the device, e.g., on/off, temperature in °C, humidity, or battery.
The timing of updates and changes to a status or its value depend on the specific system. While a weather station periodically sends environmental data, the status of other systems like window contacts needs to be requested. The request interval is set in the configuration of the corresponding instance.
It is important to realize that status variables cannot be changed by the user. The variables merely reflect the status and datasets of the device.
[w]Do not delete status variables. Deleting can cause unpredictable behavior of an instance.[/w]
Example 1:
When changing the wanted room temperature for a heating control system, a command is executed that sends the wanted value to the device. The status variable "Temperature" itself is not changed as it merely shows the current temperature. The required commands can be found in the corresponding Module Reference. Alternatively, the command "RequestAction " can be executed directly on the variable. IP-Symcon will check for the dedicated command by itself and execute it.
Example 2:
A more abstract example in form of a motor vehicle: To accellerate or decellerate the vehicle, the corresponding pedals need to be pushed. It is not sufficient to set the speedometer needle to the desired speed.
Conclusion: Status variables merely provide information about the device and are explicitely marked as "Read Only".
User Defined Variables
User defined variables can be created individually and contain one of four data types (see Table Variable Types ). User defined variables can be manipulated by the user.
Example 1:
Integrating a previously unknown device, e.g., an AV amplifier, into IP-Symcon can be done with user defined variables.
Example 2:
A user defined variable can be used to convert data, e.g., the temperature in Celsius(°C) into Fahrenheit(°F).
Variable Types
Variable Type | Description | Example |
---|---|---|
Boolean | True / False | On or Off |
Float | Floating-point number | 231.956 |
Integer | Whole numbers | -10, -4, 0, 32, 472 |
String | Text | “Hello IP-Symcon. Hello World” |
Create new variables
A variable can be created in the object tree via "+" or "Right click" -> "Add object" -> "Variable". When using the second approach, the variable is created directly below the chosen object und does not need to be categorized afterwards. A variable type and a presentation are chosen in the following window. Logging can also be activated for the variable. The Aggregation decides the type of logging.
Before confirming the creation with "OK", the variable should have a meaningful name. Optionally, a description and an Icon can be chosen for the variable. The location of the variable is set with the dialog "Location" or can be changed afterwards via Drag and Drop in the object tree.
Visualization of Variables
The display of the variables in the visualization can be adjusted so that a variable is displayed as a selection or slider, for example. These options can also be changed at a later date. A more detailed description of the options can be found here: Variable visualizations
Edit Variable Values
The profile of a variable or its logging can be changed via double click on the name of the variable.
The "Surveillance Mode" can record the values of a variable or change it. It is accesed with a double click on the value of the variable. It is also possible to choose "Modify Variable" via context menu.
This function is meant primarily for testing. For example, it can be verified if the heating is activated on the simulated temperature or check the visualization of the variable in the WebFront.
The following picture shows the window for the "Surveillance Mode" that shows the ongoing changes to the variable and enables the modification. A modification can be repeated by clicking the button "Write".
The value of a status variable can be modified even though it is marked as "Read Only". When modifying the value all corresponding Events are executed. The modification can be used to test user defined scripts but does not change the actual values of the physical device.
Variable Actions
A Variable Action can be assigned to a variable via "Custom Action". It is called when the variable is clicked in the visualization, e.g., WebFront or a mobile app. In addition, the variable action is executed if the variable is switched, e.g., via the function RequestAction .