Smartapps and routines (overlapping)

These kind of overlapping rules can happen in any home automation system. There are always several different ways to approach the issue.

In SmartThings, there are two ways that people typically use when they would have two conflicting rules being triggered at the same time.

One Example

For example, suppose I have a rule which says if The front door opens I want the entryway light to turn on 100% between sunset and sunrise every day.

Then I create a second rule which says that if I turn on the television in the living room after sunset, I want to dim the entryway light to 25%.

So now I have two conflicting rules applying to the same device, the entryway light. How should I resolve the conflict?

The first important thing to note is that different people will have different desired outcomes. Some people will want the door open rule to take priority. Others will want the television rule to take priority. So the first thing you need to do is be very clear in your own mind what you want the outcome to be when both rules are eligible at the same time.

Let’s say that for this example we want the television rule to take priority. If I am watching a movie on the television in the living room I don’t want my housemate coming in through the front door to suddenly turn that light on to 100%. :rage:

SmartThings Method 1: Use Modes

The first method which is popular in SmartThings is to use modes so that we actually separate these two rules to ensure that only one will fire at a time.

Smartthings calls the mode a “behavior filter.” That’s a fancy way of saying it’s a condition for when rules will fire.

So let’s say I started with the SmartThings default modes of home (day), away, and night.

I can add a new custom mode called “TV time.”

Now I can change my two rules. I can make my rule to turn the light on to 100% run only in “night” mode. And I can make my new rule, to set the entryway light to 25% between sunset and sunrise, run when the Mode is “TV time.”

Now all I have to do when I am ready to watch TV is change the mode to “TV time.” Note that that will do two things. It will change the entry light to 25% but it will also mean that the door open rule will not trigger. Conflict solved. :sunglasses:

Some people go really crazy and have 15 or 20 custom modes to handle all kinds of combinations of behavior filters, like “guests are home at night” etc. Some people only need one or two special ones, like the TV time example. It’s totally up to you.

To read more about modes, see the following:

SmartThings Method 2: Make a Smarter Rule with Webcore

Another approach is to remove the conflict by making the rule itself smarter through the use of “stacked conditionals” like “unless,” “only when,” “but not if.”

Webcore is a very sophisticated rules engine created by the community which can handle these type of complicated rules. Setup can be a little tricky, but there are many community members who will be glad to help either with a specific rule or with the general set up. They even have their own forum.

So to go back to our example, we could create a single rule (which web core calls a “piston”) which said:

“if the front door opens and it is between sunset and sunrise , turn the entry light on to 100% unless The TV is on except if my father is visiting, still turn the Entry light on to 100%.”

These rules can get really complex, this is just an example. But you get the idea: with webcore, you can make the rule itself handle a number of different possibilities. :sunglasses:

So those are the two basic methods in SmartThings for resolving the kind of conflict you described. You can also write your own code for specific situations, but these days most people just use webcore if modes are not enough to do what they want.

p.s. Several community members, myself included, rely on text to speech software. And others live in other parts of the world and have English as a second language. When you use weird spellings like “WAT” it can be very difficult for us to understand what you are saying, and you will get fewer responses. It’s up to you, but in general you will get the most feedback if you use standard English, as more community members will be able to easily understand you. :sunglasses:

1 Like