Basic Instructions on how to create your first rule in Rule Machine

Before we get into the creation process, we need to talk about the meanings of certain fields, & rules within program. And before I start, I would like to thank Bruce R. & Mike M. for creating this SmartApp. It takes a great deal of time to create/improve an App like this & they do so free of charge.

Ok let’s start! There are several different ways to write a rule, trigger, conditional trigger, or action & this by no means is a complete instruction booklet or am I an expert, if you are looking for that please look here. Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support

**

Action

**:

The primary function of this is to speed up the command creating process by building actions, which you can use across several different rules.

For example, I use all doors locked, & I use it for several different rules that I have built like away, sleeping, sunrise, & so on.

Note: You should try to avoid this until you become more familiar with rule building.

**

Trigger

**:

Is a simple type command used to trigger your rule to run some kind of event, I use these to change colors on my LED lights, & combining it to a routine button I created. You can also set Temps on thermostats or anything else that you wish to have a virtual button for without downloading a SmartApp.

**

Conditional-Trigger

**:

A more robust type command used to trigger your rule. It is similar to trigger however, it adds a conditional field like a check sum to verify when you want this rule to fire. This will be one of your main rule building tools.

Example: I want my doors to lock at 7AM but only when everyone leaves.

My Trigger is= at a certain time (7AM) no option to range the time.

My Condition is= everyone Leaves

My Action= all doors locked

**

Rule

**:

This adds slight variations to the trigger & conditional fields that you may not have with the conditional-trigger command-building tool. This will be your primary command-building tool.

Example: Using the conditional-trigger above, I would build the same rule like this.

My Trigger is= Between Sunrise & Sunset (Time of Day) vs 7am (Certain Time)

My Condition is= everyone is not present, All Checked. Vs everyone arrives/leaves.

My Action= All Doors Locked

Therefore, you can see the slight differences between two powerful command-building tools.

**

Rule Definitions

**:

Without going into detail other than if, you build a rule this field should have your trigger & condition commands in it.

Example: Between Sunrise & Sunset and/or any, not present.

**

Rule Actions True/False

**:

This is where you define what you want your rule to do, the object you want changed. This is also the area most people mess up because they do not look at it like a computer or machine would.

Example: using the same examples above, but adding I want my doors to be unlocked when I am home we can break the rule down like this.

My Trigger: Time I want my rule to fire (Time of Day/Certain Time)

My Condition: What I want to verify before this rule fires (I am not home).

My Action-True: Do I want my doors locked when I am away.

My Action-False: Do I want my doors locked when I am home.

Therefore, my full command would look like this:

Trigger: Sunset-Sunrise

Condition: When I am not home

Definition: Sunset-sunrise, and When I am not home.

Actions True: Doors Locked

Actions False: Doors Unlocked

Note: Since I used Sunset-Sunrise, & a presence of not present this is how that basic command would look. If I were to change the parameters of the same command, it is going to look different.

My Trigger: Time I want my rule to fire (Time of Day/Certain Time)

My Condition: What I want to verify before this rule fires (I am home).

My Action-True: Do I want my doors locked when I am home.

My Action-False: Do I want my doors locked when I am away.

Therefore, my full command would look like this:

Trigger: Sunset-Sunrise

Condition: When I am home

Definition: Sunset-sunrise, and When I am home.

Actions True: Doors Unlocked

Actions False: Doors Locked

This can & is very confusing but if you look at your rule like this, it will make sense.

The Action True/False fields are based on what you put in your trigger/condition fields, so if you read them to yourself as if you were the object in this case the door lock than you will understand.

Do I want my doors locked between a time when I am not home YES-True.

Do I want my doors locked between a time when I am home No-False.

In conclusion, I hope this helps to explain some of the basic functions & the required command structures needed to create a rule. Please keep in mind this is a very, very basic guide; Rule Machine has the potential to do some really cool stuff with just about anything you can think off.

In addition, remember we are all here to help, however please keep in mind we are not experts & sometimes the only person that might be able to help you work out your problem is Bruce or ST support.

Good luck, have fun experimenting, & if you do not understand something just ask. There is no such thing as a stupid question only a dumb answer.

4 Likes

Thank you for this! I’ve been trying to find something that breaks down these to a basic level since I started my journey into SmartThings a few weeks ago. I was having a great deal of trouble understanding the basics. Often times programmers can explain things in ways they understand, but have trouble boiling them down to someone that may not be so technically inclined. This helped me a great deal!! The only feedback I would suggest are screenshots. Visuals always help. Thanks again!!

Your welcome & I agree about the screen shots however I felt the thread would be to large. I will see if I can add a few to help.

can you explain the lighting section of rule machine what does it mean when it says toggle the switches would you break the lighting down for me I would like the light to stay on at night at a very low level maybe a red color then I would like it too come up slowly change to a purple and then evolve to a white and stay on for about 30 minutes when acceleration is detected at the door

Toggle just means if your lights are on at the time hitting toggle will turn them off. And if the are off hitting toggle will turn them on.

The rest of what you are asking will take several rules.

One rule with the times you want your light on & the color & level you want it set too.

They another rule for the color change and so on. You can use certain times, rule truths as your triggers & you also have the delay feature to use.