Documentation
Value Presentation
Require: Symcon >= 8.0
Parameter
Information about the visual properties and meanings of the parameters can be found in the Object Presentation.
| Name | Type | Parameter | Description |
|---|---|---|---|
| PRESENTATION | String | The ID of the presentation | VARIABLE_PRESENTATION_VALUE_PRESENTATION {3319437D-7CDE-699D-750A-3C6A3841FA75} |
| ICON | String | Default Icon | Icons |
| COLOR | Integer | Default Color | |
| PREFIX | String | Prefix | |
| SUFFIX | String | Suffix |
Float and Integer
| Name | Type | Parameter | Description |
|---|---|---|---|
| USAGE_TYPE | Integer | Variable Usage | 0: None of these, 1: Temperature |
| PERCENTAGE | Boolean | Display Type | true: Percentage, false: Absolute |
| MIN | Integer/Float | Minimum Value | |
| MAX | Integer/Float | Maximum Value | |
| THOUSANDS_SEPARATOR | String | Thousands Separator | Client: Default from Client, otherwise directly the value |
| DIGITS | Integer | Digits | |
| DECIMAL_SEPARATOR | String | Decimal Separator | Client: Default from Client, otherwise directly the value |
| INTERVALS_ACTIVE | Boolean | Use updated parameters for specific intervals | |
| INTERVALS | String | Intervals | JSON-encoded list of objects, the exact parameters are described under Intervals |
Intervals
| Name | Type | Parameter | Description |
|---|---|---|---|
| IntervalMinValue | Integer/Float | Interval Start | |
| IntervalMaxValue | Integer/Float | Interval End | |
| ConstantActive | Boolean | Display | false: Formatted Value, true: Constant |
| ConstantValue | String | Constant | |
| ConversionFactor | Integer/Float | Conversion Factor | |
| PrefixActive | Boolean | Overwrite Prefix | |
| PrefixValue | String | Prefix | |
| SuffixActive | Boolean | Overwrite Suffix | |
| SuffixValue | String | Suffix | |
| DigitsActive | Boolean | Overwrite Digits | |
| DigitsValue | Integer | Digits | |
| IconActive | Boolean | Overwrite Icon | |
| IconValue | String | Icon | |
| ColorActive | Boolean | Overwrite Color | |
| Color | Integer | Color |
Boolean and String
| Name | Type | Parameter | Description |
|---|---|---|---|
| MULTILINE | Boolean | Multiline | |
| OPTIONS | String | Options | JSON-encoded list of objects, the exact parameters are described under Options described |
Options
| Name | Type | Parameter | Description |
|---|---|---|---|
| Value | Boolean/String | Value | Depends on the type of the variable |
| Caption | String | Caption | |
| IconActive | Boolean | Overwrite Icon | |
| IconValue | String | Icon | Icons |
| ColorActive | Boolean | Overwrite Color | |
| ColorValue | Integer | Color |
Templates
// Registers a variable with a temperature template.
$this->RegisterVariableFloat('Temperature', 'Room temperature', [
'PRESENTATION' => VARIABLE_PRESENTATION_VALUE_PRESENTATION,
'TEMPLATE' => VARIABLE_TEMPLATE_VALUE_PRESENTATION_ROOM_TEMPERATURE,
]);
| Name | Konstante | GUID |
|---|---|---|
| Room Temperature | VARIABLE_TEMPLATE_VALUE_PRESENTATION_ROOM_TEMPERATURE | {90AF8F8F-183F-BBFD-E078-35FAB6DCFE4F} |
| Power | VARIABLE_TEMPLATE_VALUE_PRESENTATION_POWER | {2FED3D39-073D-6037-901B-2586A1AB5569} |
| Energy | VARIABLE_TEMPLATE_VALUE_PRESENTATION_ENERGY | {C899FCFA-063E-897E-9DA4-28ADD278EED5} |
| Battery | VARIABLE_TEMPLATE_VALUE_PRESENTATION_BATTERY | {7BD38CF5-07F2-5B5B-8F7F-15398B823BFC} |
| Battery (Color) | VARIABLE_TEMPLATE_VALUE_PRESENTATION_BATTERY_COLOR | {C90EF36A-165E-D0B0-032C-F468F483D42B} |
Examples
// When registering a variable for PHP modules
// An alert variable with an icon and background color
$this->RegisterVariableBoolean('Alarm', 'Alarm', [
'PRESENTATION' => VARIABLE_PRESENTATION_VALUE_PRESENTATION,
'OPTIONS' => json_encode([
['Value' => false, 'Caption' => 'OK', 'IconActive' => true, 'IconValue' => 'siren'],
['Value' => true, 'Caption' => 'Alarm', 'IconActive' => true, 'IconValue' => 'siren-on', 'ColorValue' => 16711680, 'ColorActive' => true],
])
]);
// Power in watts, with values above 1000 displayed in kilowatts
$this->RegisterVariableInteger('Power', 'Power', [
'PRESENTATION' => VARIABLE_PRESENTATION_VALUE_PRESENTATION,
'ICON' => 'bolt',
'SUFFIX' => ' W',
'INTERVALS_ACTIVE' => true,
'INTERVALS' => json_encode([
[
'IntervalMinValue' => 1000,
'IntervalMaxValue' => 999999,
'ConversionFactor' => 1000,
'SuffixActive' => true,
'SuffixValue' => ' kW',
'DigitsActive' => true,
'DigitsValue' => 2,
'ConstantActive' => false,
'PrefixActive' => false,
]
])
]);
// For existing variables via script
// Only icons are displayed. One option is highlighted in color.
IPS_SetVariableCustomPresentation(12345, [
'PRESENTATION' => VARIABLE_PRESENTATION_VALUE_PRESENTATION,
'OPTIONS' => json_encode([
['Value' => false, 'Caption' => 'OK', 'IconActive' => true, 'IconValue' => 'siren'],
['Value' => true, 'Caption' => 'Alarm', 'IconActive' => true, 'IconValue' => 'siren-on', 'ColorValue' => 16711680, 'ColorActive' => true],
])
]);
// Power in watts, with values above 1000 displayed in kilowatts
IPS_SetVariableCustomPresentation(12345, [
'PRESENTATION' => VARIABLE_PRESENTATION_VALUE_PRESENTATION,
'ICON' => 'bolt',
'SUFFIX' => ' W',
'INTERVALS_ACTIVE' => true,
'INTERVALS' => json_encode([
[
'IntervalMinValue' => 1000,
'IntervalMaxValue' => 999999,
'ConversionFactor' => 1000,
'SuffixActive' => true,
'SuffixValue' => ' kW',
'DigitsActive' => true,
'DigitsValue' => 2,
'ConstantActive' => false,
'PrefixActive' => false,
]
])
]);