[Released] Rule Machine 3.0

EDIT: Removed as Bruce's answer below answers this.

Actions are only run when rule-truth changes. When rule truth changes, anything outstanding with "cancel on truth change" gets canceled.

1 Like

Yes, this shouldn't happen like this. Will put in a fix for it. This is a bug specific to Garage Door and Door. Found and fixed,

1 Like

Yep.. you're right.. I glossed over (skipped) the part about

and the RULE gets evaluated.

and there's no change in truth, nothing happens. Change in Truth is part of evaluation, that's for sure. :slight_smile:

Okay...I thought you were saying that whenever the rule is evaluated as false the false action happens.

2 posts were split to a new topic: Keen Vents not reporting temperature

Found a bug (I believe)

Rule is setup to turn on a light in my kitchen at midnight, then it delays a fade action for two hours.

When it triggers the fade action it does this:

app:12172019-05-08 02:00:00.314 amerrorgroovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Integer#div. Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [class java.lang.Character] [class java.lang.Number] (dimFade)

Could this be the same issue I see with my sunrise rule that is in the next patch?

8 posts were split to a new topic: Rule not logging correctly, missing ENDIF not working right

How to make a simple rule :

  • If Light ( Switch, Contact … ) STAY ( triger ) : on ( or off, open, close ... ) for x minutes, second THEN do something … with Cancel on truth change.
    Thanks.

Here is a simple rule. If the garage door is left open for 5 minutes, it will send a message. If it closes within that time, it won't do anything at all.

1 Like

@bravenel a while ago i wanted a conditional action repeat but I had set up wrong as i was told the actions IFs done get evaluated so esentaly it would run forever. So stop on truth change had to be the main conditions truth change correct?

but in the documentation it says this

A Repeat Actions, like any action, can have a condition specified. If the condition is false, the Repeat Actions block of actions will not be executed. If the condition becomes false during repetition, the repetition will be stopped (not in the case of Repeat a selected number of times). This provides three features well known to computer programmers; A while-loop, a for-loop and repeat-until loop. The while-loop runs only if the condition is true, and stops if it is false. A for-loop runs for a fixed number of times, but if a condition exists, it will only start that iteration if the condition is true; the condition is not retested during iteration. A repeat-until loop runs until a condition becomes true, running at least once.

While loop - repeat while the condition is true:

IF (condition) Repeat Actions
     some actions...
End Repetition

which to me states otherwise that if the IF (condition) changes to false it stop. no mention having to tick stop on truth change eather. Is it that whatever the condition is it would have to also be a condition in the main part of the rule even if its not in the rule defined.

The confusion is around which type of conditional action to use.

For while loop, use Simple Conditional Action, not IF-THEN.

Like this:

Right! ok that would be why. It's not clear what the difference is between them (currently reading the docs so it may become clear) what is the difference, is it one is evaluated all the time one not?

16 posts were split to a new topic: How does Repeat Actions work

A Repeat Actions works by running the same action for each repetition, starting with the Repeat Actions action. For a Simple Conditional Action, the condition is part of that action, so it is tested on each repetition. If it is true, execution continues. If it is false, the actions until End Repetition are skipped.

In contrast to that, IF-THEN is it's own action, and a Repeat Actions after that is a simple Repeat Actions, with no condition attached.

Simple Conditional Actions attach the condition to an action. You can see this when you create one, in the way the UI prompts you. You can see it in the result, where the condition is on the same line as the action. You can read about it in the documentation: Rule Machine - Hubitat Documentation.

1 Like

Sorry for such a basic question, but I’m missing how to do delayed off in RM 3.0 like the 2.5 example here.

Exactly the same way. The Delay is attached to the Switch Off action.

1 Like

So if my action for True is switch on, true should also continue off with a delay?

2 Likes

thanks for the explanation i can see it now. So would this work?

if in party turn on and whilst its ON repeat.

Aw is this what a nested IF is? So no?