IF Else

The IF Else block runs one of two program branches based on a Boolean condition. Use it when a program should continue differently for true and false.

Loading preview …

Typical use cases

  • Trigger a notification only when a condition is met.
  • Start different actions depending on a sensor value.
  • Split a flow into two paths based on a device state.
  • Run a separate action for both the true and false cases.

Inputs

InputTypeDescription
StartTriggerEvaluates the condition and forwards the trigger to one of the two outputs.
ConditionBooleanDetermines whether the True or False output is triggered.

Condition can be connected to the Boolean output of another block. When it is not connected, a fixed value can be selected directly in the block. The default is false. Connecting an input disables the local selector and uses the connected value instead.

Outputs

OutputTypeBehaviour
TrueTriggerTriggered when Condition is true at the time the block starts.
FalseTriggerTriggered when Condition is false at the time the block starts.

Exactly one output is triggered for every incoming Start trigger. The block does not return a Boolean value; it controls the program flow through trigger connections.

Configuration

  1. Connect a trigger, for example from a time, watch or device block, to Start.
  2. Connect a Boolean value to Condition, or select true or false directly.
  3. Connect True to the actions for a condition that is met.
  4. Connect False to the actions for a condition that is not met.
  5. Validate and start the program.

An output may remain disconnected when no action is required for that case.

Example: temperature warning

A temperature comparison should decide whether to send a warning whenever a trigger arrives:

  1. Configure Compare Values with temperature > 28.
  2. Connect its Boolean result to Condition.
  3. Connect a suitable trigger to Start.
  4. Connect True to a notification block.
  5. Leave False disconnected or connect an action that clears the warning.

If the temperature is above 28 °C when the block starts, the True branch runs. Otherwise, the False branch runs.

Notes and troubleshooting

  • Start only accepts trigger connections; Condition only accepts Boolean values.
  • Changing Condition does not trigger the block by itself. Branching occurs on the next Start trigger.
  • If the wrong branch runs, check the current value supplied to Condition.
  • Do not connect both case-specific actions to the same output.

Related blocks

  • Logic — combines multiple Boolean conditions.
  • Compare Values — creates a Boolean condition from a numeric comparison.