Skip to main content

Operator - Values Match

note

This page has been automatically translated and has not been reviewed in detail yet. Therefore, the translation might not be completely accurate.

This operation allows several values to be compared with a comparison value at the same time.

Screenshot Operator "Values Match"

Scenario/Example

There are 10 lamps, each of which is switched via a Bool variable. The same bool variable is also bound to a toggle button in the dashboard.

This means the dashboard can switch the light simply by changing the variable, but at the same time the status of the associated toggle button in the dashboard is also updated. This variable is also used to monitor whether the light comes from somewhere else, e.g. B. via KNX buttons. This makes it very easy to visualize the states.

If the dashboard also has an "All_Lights" toggle button to switch all 10 lights on or off at the same time, this "All_Lights_Button" only has to set all the bool variables accordingly.

If you now switch individual lights on and off using the dashboard buttons or KNX buttons, you have to check with every switching process whether all the lights are on or off in order to set the status of the "All_Lights_Button" correctly. This could be solved using IF conditions or using the operation "Values Match" 2 presented below.

Field "Compare Value" 3:
The value with which all other values should be compared is specified here. This can be a constant, as in the example here, or another variable.

Fields "Value" 4:
The variables with which the “Compare Value” is compared can be entered here or added via drag/drop.

Target variable 1:
If all values (4) correspond to the "Compare Value" (3), the target variable is set to "true". Otherwise set to “false”

If you confirm the dialog via "Select", the map in the script blocks looks like this:

Screenshot script block with operator "Values Match"

Note: "Values Match" can of course also be carried out with other variable types such as Number, Float or Text.

Based on our example, this would mean that the toggle button is only set to "On" when all lights are on. As long as one of the lights is off or all of them are off, "All_Lights_Button" will be set to "Off".