Rule machine cancel when conditions not met

I want to cancel all pending actions of a rule when the conditions are no longer met. It doesn't look like there is a straightforward way to do this?

Use case:

On mode "Day", turn on bedroom light and dim progressively for 30 min.
If bedroom light turned off manually, cancel rule.
If mode changed, cancel rule.

This seems extremely basic, but has taken hours of trobuleshooting with RM and doesn't work. Using basic rules worked pretty much as expected. RM has me contemplating returning the hub.

The only way I have gotten this to work is to set the rule condition to evaluate a mode change, then add an IF condition for the specific mode.

I also tried a separate condition: IF Bedroom = OFF then cancel pending actions. That didn't work.

I'm curious what the best practices are for this type of setup.

So far my impression of rule machine is that it doesn't feel l like it belongs in a commercial product.

Stop changing dimmer also did not work.

You want "Cancel Rule Timers."

"Cancel Delayed Actions" affects only a "Delay" action or the "delay" option on an action and even then only those with "cancelable" enabled. "Stop changing dimmer" sends a stopLevelChange() command and only does anything if you ever sent a startLevelChange(), which the "Start raising/lowering dimmers" action does.

... just in case you're curious why those don't work. :slight_smile:

2 Likes

Is there a recommended approach to this type of rule?

I expected a learning curve but did not think that it would take 3+ hours to set up something in Hubitat that took 3 minutes in amazon.

What you have should more or less work, though I'm not sure your rule actions match your description (perhaps that was simplified; otherwise, I don't see anything about wanting to "toggle," i.e., turn something off if it's on or vice versa). However, to cancel the in-progress "Raise over time" actions, the easiest option would be to forget about doing that in the same rule and just make another rule with two triggers: mode changed (except maybe to day) or light turned off. Then, in that rule's actions, use "Cancel rule timers" on the above rule. You can then get rid of the "IF..." and "ELSE" in this rule.

I also don't see any triggers in that rule. I assume you have them (rule actions are only executed in response to a trigger--or manually running the actions). If not, it sounds like want "Mode becomes Day."

Rule Machine is a fairly advanced tool that takes some getting used to. Basic Rule is still quite a powerful app, despite the name, and such instances can be "imported" into Rule Machine with a neat feature that was introduced a while back if you ever want to (or need a starting point for a RM rule). If you haven't read the docs, they would be a good start: Rule 5.1 | Hubitat Documentation

Some users also prefer webCoRE, a community-developed (even though it is offered built-in now) rule engine capable of similar custom automations but with an interface that lives mostly outside the constraints of the regular hub UI, perhaps one reason some people prefer it. In its default configuration, however, the editor does require cloud access (though everything that can executes locally after creation).

1 Like

Thanks @bertabcd1234 - I got what I was looking for by creating a cancellation rule in parallel with each of my timed rules. This seems incredibly redundant (why don't rules have exit criteria?) but it works.

The list of actions within RM is part of where the confusion is coming from... it is confusing to say the least. I'm sure each of these actions has its place, but how this is communicated from a user standpoint is frankly pretty terrible.

Stoked on the possibilities though and hopefully over some of the learning curve. Appreciate the steer!

As you're noticing, RM is relatively free-form, and goes very deep (if you want to dive in). Basic Rules is great for most automations that don't need additional flexibility/complexity of RM, and as noted you can bring them into RM later if you want to move over. Best of both worlds.

Another tool that is a community app is Event Engine. It's very powerful, but is completely "point-and-click."

Getting it installed requires jumping through a couple hoops, as the developer of Event Engine doesn't keep his apps in HPM, but it could be a good option to explore.

1 Like

@danabw That's my point here - I would summarize Hubtiat as "there are a lot of hoops".

1 Like

Tomato/tomahto, I think. Hoops for one person are options and opportunities for others. :slight_smile: You can choose to use the simpler options (fewer hoops) if desired. And each home automation platform has its up-sides and down-sides...

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.