To add an IF...THEN, under "Select Action Type to add", choose "Conditional Actions"; then, under "Select Which Action", choose "IF (conditions) THEN".
This may not suit your needs but I have this rule that turns the light off after 20 minutes should we forget to close the door properly.
Just for information really.
Perfect, except you could replace the ELSE-IF with a simple ELSE - once you get to that point in the Rule, the "closed" is a given.
Also, it'll help if you get in the habit of putting an END-IF at the end to close your IF statement. (It's on the Conditionals menu.) Your Rule will work fine without it, but more the complex rules you'll get around to eventually (especially nested IFs) need the END-IF to avoid confusion.
And it's good practice.
You may wish to follow your IF THEN with another IF THEN.
In this case you definitely need to finish the first IF THEN with an END IF.
Say you wanted to run another action after the if, it will behave very differently with and without the end if. Take a look at this:
IF (Storage Door Sensor open) THEN
Dim: Storage Closet Light: 100
ELSE
Dim: Storage Closet Light: 0
END-IF
Dim: Hall Light: 50
Compaired to:
IF (Storage Door Sensor open) THEN
Dim: Storage Closet Light: 100
ELSE
Dim: Storage Closet Light: 0
Dim: Hall Light: 50
The first one will always dim the hall light when the door sensor changes state. The second one will only dim the hall light when the door sensor is closed.
This may not be a great example - not sure why you would set the hall light the same in both cases but it is just an example of the logic.
Your rule just falls out the bottom and ends. RM is forgiving enough that it doesn't need the implicit end-if. It doesn't hurt to get in the habit of adding the end-if so that you are used to it if you start building more complex rules.