If-Then-Else Statements

If, Then, Else actions are used to implement conditional logic in a Routine. This action creates two branches in the Routine logic, as shown in the screenshot below:

All the actions in the left branch are executed if the condition stored in the action passes, and all those in the right branch are executed if the condition fails. There are five different types of conditions that a user can input:

EL expressions are covered in detail on the EL Tutorial page, but some example expressions that can be used inside statements 1-3 are:

  1. ${n:time_formatted(message.time, 'EEE', 'US/Pacific') == 'Sat'}
  2. ${message.sensor_value < source.our_value and source.flag}