« Back to Product

Documentation

SelectCondition

Require: IP-Symcon >= 6.1

Creates an input for conditions.

Example

If created in the "elements" area, the property name is set to a JSON-coded list when accepted, whereby each element represents an object with the following parameters:

Parameter Description
id Condition ID
parentID Parent condition ID
operation Operation for linking the individual rules (0: AND, 1: OR, 2: NAND (not yet implemented), 3: NOR (not yet implemented))
rules Object that describes the rules of the condition

rules

Parameter Description
variable List of the variable rules
date List of date rules
time List of time rules
dayOfTheWeek List of weekday rules

Representation of a rule

Parameter Description
id Unique ID of the rule within the rule list
comparison Comparison operator with which the current value is compared with the comparison value (0: =, 1: ≠, 2: >, 3: ≥, 4: <, 5: ≤)
value The comparison value, the type depends on the type of rule
Variable: If "type" = 0, this is the absolute comparison value that matches the type of the variable; if "type" = 1, this is a variable ID whose value is used for comparison
Date: The value is saved as an object with the fields "year", "month" and "day", analogous to the representation of IPS_SetEventConditionDateRule
Time: The value is saved as an object with the fields "hour", "minute" and "second", analogous to the representation of IPS_SetEventConditionTimeRule
Weekday: The comparison day is saved as a number (1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday, 7: Sunday)
variableID (only with variable rules) The ID of the variable that contains the current value
type (only with variable rules) If 0 the variable is compared with an absolute value, if 1 it is compared with the value of another variable
Warning

Instead of evaluating a configured condition independently, the IPS_IsConditionPassing function should be used. There the value of the SelectCondition can be used directly as a parameter.

Warning

If the saved condition contains nested conditions or "multi" is set to false and the condition contains several rules, the rule is displayed as "complex" and cannot be edited.

Parameters

Parameter Description
caption (optional) (default: "") Visible caption (since IP-Symcon 7.1)
enabled (optional) (default: true) If true, the selection can be used, otherwise it is displayed as deactivated
multi (optional) (default: false) If false, an individual rule is defined by the element, if true an entire condition with any number of rules
name (optional) Name of the selection/the property to be set
type SelectCondition
value (optional) (default: no condition) The value of the selection - If there is an associated property, this parameter will be overwritten by the property in the elements area
visible (optional) (default: true) If true, the selection is visible, otherwise it is invisible
width (optional) (default: 300px, if multi = false, otherwise 100%) Fixed width of the input field in pixels or % as a string, e.g. "40%" or "250px"

Example

{ "type": "SelectCondition", "name": "PropertyCondition", "multi": true }
Any questions?