Rule Machine - Get peer assistance here with setting up rules

@bravenel there seems to be a bug here with rule truth evaluations (at least when evaluating if another rule is false). I just rebuilt my rules using private Boolean, and it’s working great now.

Here are the screen shots of the working rules:

I’ve created a virtual switch called “A light is on” and added it to my SmartTile dashboard so I have an easy way to see if there’s a light on somewhere in the house.

How to I turn this switch on if any light switch is on, but off only when all lights are off. Basically the “AND” of all light switches.

Rule Machine will do this.

True condition A or B or C or D on > turn ON virtual switch
True condition A and B and C and D off > turn OFF virtual switch

1 Like

This is my first try using Rule Machine and it’s not working for me.

Rule 1: a light is on
Define Triggers
[light A,light B,…light n] any physical on
Select Actions
On: virtual switch

Rule 2: no lights are on
Define Triggers
[light A,light B…light n] all physical off
Select Actions
Off: virtual switch

Does this look okay? My virtual switch is not turning on

Looks ok to me, however there is currently some system issues running smartapps, so it may be worth retrying once that is resolved.

Status link

I can’t get into the app right now to build this but you should be able to do this with one rule.
You set this up as a Rule not a Trigger correct?
Do you have the virtual switch on in the TRUE action? Then set the virtual switch to off in the FALSE action.
Can you post a screenshot of the rule?

This should really be moved to this thread:

One last post before moving to the other thread. Here are screenshots of my rules. “A light is on” is the name of my virtual switch.

Oops, I was using Triggers rather than Conditions. Moved Triggers to Conditions and works correctly. How would I do this with just one rule though?

Just use the false actions of the other one. Logic works this way:

if a OR b OR c On is True, then the opposite is False. The opposite is a AND b OR c, where this time a, b and c are to be off. So one Rule does it.

Hey, I know this forever old… But did you get it to work?

I was think use the presence arrival as a trigger with modes and sunset/sunrise as your conditions, this should work.

Is this a private list? :wink:

It is right now. I started a big experiment at the beginning of the month where I took down my entire system and rebuilt from scratch attempting to program the system to the max but maintain simplicity…

Then ST broke everything dealing with timers and now the Android app…

I’ve been reduced to barely working with an iphone 4s…

But, the list is growing and I’ll these release it soon

1 Like

I could use some help getting it installed? I looked in the App release thread but did not see any info on how to install. Could you help? If its not obvious im new to the ST community just installing the hub last night.

From that topic where you did not see any info:

How to Install or Update Rule Machine

There are two SmartApps on Github. The first is called Rule Machine. You should install this in the IDE and Publish For Me. The second app is called Rule. This you should also install in the IDE, and Publish for Me. Rule Machine is a parent-child app, where you can create as many rules or triggers as you want, each an instance of Rule.

After you install Rule Machine and Rule as described above, then you can install Rule Machine in your mobile app. It can be found in the Marketplace, under SmartApps, My Apps. When you install it, the first thing you should do is click on Done in the upper right hand corner. After that, Rule Machine will appear in the list of your installed SmartApps.

Thanks man. I found it and have it installed on the IDE. Waiting until I am home to add rules.

Is your purpose built lighting app available?



Not anymore, as it was completely replaced by Rule Machine. The main thing it had was dimmer level per mode, which RM now can do.


I have a little problem with these rules.

Here is what I have set up. The master bedroom is fully automated and all lighting is triggered by the motion sensor that detects you coming into the room. This is the rule for three of my modes. The boolean in the conditions is being set by a second rule.

This is the second rule. When this rule occurs it changes the boolean in the conditions of the first rule making it go false.

Here is the problem…

The lights come on as my wife walks into the room. They are set to go off after X minutes. The automation has started and so has the timer for the lights to go off. The is a Trigger with conditions. She sits down and turns on her pump. After about 40 seconds the power meter senses the load and the rule goes true, which then changes the boolean of the lights automation. I was thinking that the lights would stay on, but they do not. At the end of the set time for pending off, they go off. The boolean change is not stopping the countdown.

I do however have a VS switch built into the rule. At the bottom I am using the “Use this switch to disable the rule” option. When that switch is turned via her minimote, the lights stay on.

Here is what I’m thinking…

  1. The Trigger will only fire the rule when the trigger event occurs, thus starting the countdown. Even if the boolean condition changes it does not effect the rule because the Trigger event has not occured again. But, if the the Trigger event does happen again the rule will not fire because of the condition being false, thus the countdown will not be reset and the lights will still turn off.

Here is what I’m thinking will fix it???

  1. Forget about the boolean. Have the second rule turn on the Virtual Switch. But, I’m trying to get rid of the VS and utilize the full power of Rule Machine.

  2. Change the Trigger with conditions to an Actual rule, therefore when the rules conditions change the rule is reevaluated. But since the conditions are false, the rule will not continue.


  1. Removing the boolean and using the VS will work, but that defeats the purpose of using the boolean and my goal of removing the VS. Is this correct?

  2. If I change the Trigger to a Rule, will the lights still go off if the boolean condition changes to false?

  3. I can’t put in the actions for false to turn on the lights, as that would keep the lights on all of the time. Right?

  4. I thought as I typed this out that I had figured it out, but I have just confused myself again.


  1. Trigger will only fire when the trigger even occurs. Correct
  2. Changing the conditions of the Trigger after the trigger event occurs but before the Trigger countdown is finished will not stop the countdown???
  3. Am I being clear on what I am asking?


Triggers aren’t useful if you want to cancel a countdown, only Rules.

The remainder of your post is an exercise for the reader…:grinning:

Ok, yes, it was… That’s how I figure things out in my head… Try being me sometime! !

Ok, so anything with s a countdown should be a rule, not a trigger… Got it.

Only if you want to be able to cancel the timer…