Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support

Not really and difference in terms of efficiency. However, read the paragraph in the original post about Rule Machine concerning how it evaluates the rule.

At this point there is no extension of Rule Machine into integrations (Harmony, Hue, Echo, etc.). It supports core ST capabilities.

This is well beyond the original intended scope of Rule Machine. Timers can be very tricky, and I maintain that they are best implemented in an app that has some context, which Rule Machine does not. I will look at enhanced timer functionality.

If effect, it already does this. The app subscribes to the events of a switch that is a condition. When the rule evaluates, obviously it looks at the state of the switch. Due to the subscription, when the switch is turned on or off, that triggers an evaluation, which discovers the state of the switch, and if the rule truth changed, caused the actions.


I found it easier not to mix functions with rules. What I mean by that, is I keep the “virtual toggle” functions separately from the Rule. You can set up " virtual groups" of switches in Smart Lighting that would tie your bulbs to the switch. Group A …when switch turns on/off, also turn bulbs on/off. This way your bulbs will always be in sync with your switch. One less condition to remember when setting up other rules…


Perhaps it was a poor example. But here is the issue; the switch is already off, but the bulb is on. If you press the OFF command (down) on the switch the state does not change. Since the state does not change it can not trigger an event. If I setup the rule to look for switch=off and bulb=on then anytime I turn on the bulb without turning on the switch it will turn itself off.

Here’s what I mean;

  • I keep my front porch light green & 50% dim. (
  • The switch is programmed to set the light to 100% white, so when the pizza guy comes to the door he can see.
  • If I turn off the switch when the light is on, AND i never turned on the swith, the light won’t turn off.
    Now, this is not that big of a deal because I can just turn on the switch then off again and it all resets. It drives my wife a little nutty but she copes. I would like to make it more seamless than that. We have a similar issue in my daughter’s room. Her Hue turns on pink to wake her in the morning on school days. Then the switch does not turn the light off unless she turns it on and off again.

I have many other things I would like to do in this manner. There are a number of rules I would like to set for my garage door, fireplace and lights in the TV room. All of which can be worked-around.

Anyway, it was just a suggestion. I really do appreciate the app as-is and all of the effort you have put into it. It’s still pretty bad-ass!

Thanks for the suggestion. I’ll give that a try. What I need to be able to do is have the bulb turn on with the switch AND have the switch turn on with the bulb without creating a loop.

1 Like

Ironically, I have the exact same problem in my Lutron integration. It gets synched when lights are turned off, but not when turned on, if the lights are turned on with a Lutron button. So I can’t turn them off from ST without first turning them on with ST, and then off, even when they are already on. Frustrating, no easy fix in sight.

1 Like

It probably won’t help with the other possible use cases you mention, but you can use Double Duty smart app to capture redundant off-presses of your already off switch to toggle your Hue bulbs off… UPDATED 10/7/2015 -- “Double Duty” - Use redundant switch presses to control other lights. You paid a lot for those switches, make them work Double Duty!


I’ll check it out. Thanks.

I have a small request…

Can you make it so when it sends an alert text that it can go to more than one phone number?

I know getting into timers can be like going down a rabbit hole, but think the cancel timer if False option would add real capability to this App, and expand it’s ability to replace other work arounds. So I really appreciate the consideration!!!

If I change the behavior of this so that the timer is always canceled by a change in rule truth, would that work? Or does canceling from change need to be an option? If it’s the former, easy peasy, and it can be done in 5 minutes. If the latter, it’s more effort.

Is anyone else seeing strange behavior with Rule Machine and the ‘Restrict to Modes’ code?

There seem to be times (especially after mode change) where I have to ‘kick a rule in the pants’ (go into the rule definition main screen and click Done) before I starts running again?

I’ve had a quick look at the code, but I’m not sure if it’s an issue of the ‘runRule()’ function not being called properly…

Thanks, as always, @bravenel for the great work… :smile:

Agreed @bravenel - the pull request I sent you does it the ‘easy peasy’ way. I didn’t have a need to make it an option, which I agree adds more complexity.


I would think that the easy way would be fine. After all, if the rule truth changes to rule false, the entire rule processing should be stopped/scrapped, so makes sense to reset the timer, too. I guess we’d have to be able to try it and see where that way wouldn’t work well.

I’m not sure if this would help, but you could put in a condition for the mode to be in one of the modes you are not restricting. That would force an evaluation upon mode change, and presumably catch the event of coming out of the restricted mode.

1 Like

What about power allowance? To me that sends like a type of timer. Not necessarily a countdown timer, but it does partially fill the purpose.

Power allowance is not cancellable. So my question is, do we need both? The current function is like power allowance, it just starts a timer that turns things off no matter what (minus some restarting of the timer). The requested function cancels the timer upon the rule truth changing. There are uses for both functions – at least I use both in my system.

For my use case immediately at hand, the expected behavior is that the condition must not turn False during the countdown for the timer to complete. So I would be content with always having the timer deactivated (waiting for a new True) if it ever becomes False.

However, I know others are probably using this as a “trigger” and want Y to happen after X minutes of the last True regardless if it turns False before completing the countdown.

So the short term selfish answer is yes, please change the functionality, but the right long term answer is to have it be an option.

I can definitely see where both are needed.

Currently, In my foyer I have my lights come on when the front door opens. They turn off three minutes after the door is closed. Sometimes the door is left open for whatever reason. Since the lights come on when it opens and the timer doesn’t start until the door closes I use power allowance to have then turn off five minutes after the door is opened. This works really well, but uses two instances of the smart lighting app.

Also, restarting the timer would be great. Such as when I’m going in and out of the door to bring in groceries or something. If it restarted every time the door is opened, then the lights wouldn’t turn off on me. So that is useful as well.

Your app is turning into a very encompassing application. I believe the users here see the full potential of this app. I certainly hope those at ST see it as well.

Can you imagine if this app was running local? ST could truly become the most powerful hub on the market.


Yes, I agree with this. I’ve decided to put both flavors in. Testing it now.


Fantastic app @bravenel, and its also appreciated how responsive you are to the suggestions from the community for making this even better and more comprehensive.

One use case I have is to switch appliances on and off based on the amount of power I am generating from solar PV or importing from the grid, using capability “Power Meter”. I have clamp meter devices that measure both these values.

It would be great if you could add devices with this capability to the conditions list, so I can evaluate against a specific power level in Watts. I think this would be evaluated the same way as temperature, i.e. (= != < > <= >= relative to a number).

Thanks for the great work