Documentation
Slider
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_SLIDER {6B9CAEEC-5958-C223-30F7-BD36569FC57A} |
| MIN | Integer/Float | Minimum Value | |
| MAX | Integer/Float | Maximum Value | |
| STEP_SIZE | Integer/Float | Step Size | |
| GRADIENT_TYPE | Integer | Gradient | 0: Default, 1: Temperature, 2: Tuneable White, 3: Custom |
| CUSTOM_GRADIENT | String | Custom Gradient | JSON-encoded list of objects with the parameters 'Value' and 'Color', where Color is encoded analogously to SelectColor |
| USAGE_TYPE | Integer | Variable Usage | 0: Temperature, 1: Tuneable White, 2: Intensity, 3: Volume, 4: Progress, 5: None of these |
| PREFIX | String | Prefix | |
| SUFFIX | String | Suffix | |
| PERCENTAGE | Boolean | Display Type | false: Absolute, true: Percentage |
| 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 |
| ICON | String | Icon | |
| 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 |
Templates
// Registers a variable with a room temperature template.
$this->RegisterVariableFloat('TargetValue', 'Temperature', [
'PRESENTATION' => VARIABLE_PRESENTATION_SLIDER,
'TEMPLATE' => VARIABLE_TEMPLATE_SLIDER_ROOM_TEMPERATURE,
]);
| Name | Konstante | GUID |
|---|---|---|
| Room Temperature | VARIABLE_TEMPLATE_SLIDER_ROOM_TEMPERATURE | {868B087E-A38D-2155-EBE0-157AFBBF9E8C} |
| Color Temperature | VARIABLE_TEMPLATE_SLIDER_COLOR_TEMPERATURE | {66062309-21A9-26C0-213F-775C52E1473B} |
| Energy | VARIABLE_TEMPLATE_SLIDER_ENERGY | {BC799412-0C66-551F-CAEC-7566F5D52BD9} |
| Power | VARIABLE_TEMPLATE_VALUE_PRESENTATION_BATTERY | {8EC19DF0-89FB-A77E-ED7D-047A949CF292} |
Examples
// When registering a variable for PHP modules
// A slider with a range of 0–2000 W. Values of 1000 W or higher are displayed in kW.
$this->RegisterVariableInteger('Power', 'Power', [
'PRESENTATION' => VARIABLE_PRESENTATION_SLIDER,
'ICON' => 'bolt',
'SUFFIX' => ' W',
'MIN' => 0,
'MAX' => 2000,
'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
// A slider with a range of 0–2000 W. Values of 1000 W or higher are displayed in kW.
IPS_SetVariableCustomPresentation(12345, [
'PRESENTATION' => VARIABLE_PRESENTATION_SLIDER,
'ICON' => 'bolt',
'SUFFIX' => ' W',
'MIN' => 0,
'MAX' => 2000,
'INTERVALS_ACTIVE' => true,
'INTERVALS' => json_encode([
[
'IntervalMinValue' => 1000,
'IntervalMaxValue' => 999999,
'ConversionFactor' => 1000,
'SuffixActive' => true,
'SuffixValue' => ' kW',
'DigitsActive' => true,
'DigitsValue' => 2,
'ConstantActive' => false,
'PrefixActive' => false,
]
])
]);