[Released] Rule Machine 3.0


#83

How exactly does the random delay work. For instance if I put in a 20 second delay and then click the random delay will it randomly delay between 1-20 seconds?


#84

Is this what you mean because this doesn't work either.


#85

NO.

IF (Mode is Day) Repeat every 0:00:05.


#86

Well here is my last attempt.
Lights turn on and that's it.
I've tried lots of combinations to try and get this work.


#87

I would have done the exact same thing as @bobbles, why?
Simply because I was assuming that the "Select Conditions" was in fact an IF.
IF Mode is Day THEN do the following actions.

What I find strange is that you have to repeat the condition inside the action section. Why? Isn't that the purpose of the "Select Conditions" section?


#88

You missed the prelude to this. He was trying to create a while-loop.

Back up a moment to basic Rule Machine logic.

You can have a Rule or a Trigger. A Rule tests some conditions with a logic rule, and decides to either do Actions for True or Actions for False, depending on the outcome of the logic rule. A trigger just takes some event and does some actions when that event happens. Whatever one does with Actions happens within this framework.

Within actions one can introduce yet more conditional logic should that make sense for the use case. It would be easy to get confused at this point between the foregoing framework and what one does with actions. I'd say that introducing conditional actions is an advanced concept, and probably best used once one has a full grasp of how RM is working.


#89

Let's start over. What are you trying to get to work?

Consider this simple trigger:

This is going to toggle that light on and off 10 times, then stop.

Now look at this one:

This one is going to go on repeating as long at the Front Door is closed. Once the Front Door is open when it does the every 5 second look at it, it will stop repeating. See below:


#90

I did find a bug in the repeat logic that would explain why you are not repeating. This will be fixed in the next release.


#91

I do have a good try at getting things to work before I post on here and whatever i tried I could not get the repeat action to work. It's the best way of learning as far as I'm concerned.
Glad you have found a bug which could have contributed to this.


#92

Just for information this is what I'm trying to achieve.
A light to turn on and off between a certain time when we are away. In this case every hour.
Hopefully this should work after the next hot fix.
Thanks again.
image


#93

Cool. You should add some randomness to it. I'll see if I can get something with similar structure to work.


#94

Here's some randomness. :smile:
Also I have added another light so that it looks like someone has moved through the hall to the WC.
Reading the initial post I'm assuming that as soon as Random 30:00 matures the next 3 delays all start running at the same time.
If this works OK it will rationalise 5 rules into 1. Happy days. :smile:


#95

One more thing, do we really need to add "stop on truth change".
Isn't that the goal of the Private Boolean to stop the action when the "truth change" (I read that somewhere), or maybe this doesn't apply to trigger.

Sorry for all the questions but I'm trying to grab the hole concept of how the RM works and so far, it's a bit confusing.
My hubitat is on its way and I think I gonna have a lot of testing to do :slight_smile:


#96

@bobbles did not need that in the one he had first above, with the conditional action. In the later one, he does need it. Here's why:

He's starting his repetition if Mode is Away. Once it starts it's going to run forever. So he needs someway to stop it. Truth changing in this case would be time becoming 23:45.

There is a flaw in his logic however: Probably he only wants this to happen between those hours and when he is away. If he is home at Sunset, Mode will not be Away and the rest of those actions will not happen, even if he leaves (by then the action has already run). Even if he was away at Sunset, if he returns that won't stop the repetition, because the IF has already run, and won't be run again.

So, an exercise left to the reader is how should this rule be setup so that it does the light while he is away between Sunset and 23:45?? Hint: It does not entail having an IF-THEN in the actions.


#97

Was it that after the repeat time it wasn't checking the logic? Then going to false


#98

No, it had to do with ending a repetition, but not clearing a flag to skip repeated actions (cleared by End Repetition) when the rule was run again.


#99

Define the rule as: -
Time is between Sunset and 23:45
AND
Mode is away.

That would do the trick wouldn't it?


#100

@bobbles Please add WC to the acronyms page. :wink:


#101

Good point.
WC = Bog. Karzie. Thunderbox. :smile:
The list will just keep growing.


#102

Is 'spend a penny' still a thing?