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 WebFront or activate and deactivate the lighting.
There are two types of variables within IP-Symcon:
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]
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.
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.
Integrating a previously unknown device, e.g., an AV amplifier, into IP-Symcon can be done with user defined variables.
A user defined variable can be used to convert data, e.g., the temperature in Celsius(°C) into Fahrenheit(°F).
|Boolean||True / False||On or Off|
|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 Profile 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
Variables are shown by default in the WebFront. This can be changed with the visual settings.
To record the values of a variable and present a graph in the WebFront, Logging needs to be activated.
When a variable is visible and logged, a diagram button is shown next to it. Clicking that button opens a popup that shows the logged data.
An automatically scaled graph can be shown within the popup via "DYN (dynamic)".
A Variable Profile can be used to provide specific properties or a specific appearance of the variable.
Settings within the popups are stored within the used browser and are loaded again during the next call.
A media object Chart can be used to show multiple variables within one graph or permanently on one page.
The same aggregated presented average values for standard/high density as for Charts are used. In addition, a min/max graph is presented.
A variable can have a profile that prepares the variable for visualization, e.g., attaching a °C to temperatures. The profile can be changed later on. A precise description of the possibilities is shown here: Variable Profiles
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.
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 .