And command

You can use an And command to create additional conditionals to an If conditional. Both the If conditional and the other conditional(s) must be true or programming won't continue.

Example: The example in this section shows how to use conditionals and an And command in programming. If a light is off when the doorbell is pressed and it's night time, the light is programmed to turn on.

To program a conditional with an And command:

  1. Follow the example in "Programming with conditionals". These next steps start after that example.

<continued from the steps in "Programming with conditionals">

  1. To add an And command, in Programming Controls, click And and drag it on top of the conditional in the Script window. The Expression Builder opens to help you build your complex conditional statement.
  1. In the Device Actions pane project tree, select the Scheduler.
  2. Click Time and Night time.
  3. Drag the conditional 'If time is night time' to the Script pane below the AND symbol.
  1. Click Finish to close the Expression Builder. The complex condition now reads 'If <room>->Front Door Light is off AND If time is night time'.

    When the doorbell is pressed, the Front Door Light will turn on if the light is off AND if it is night time.