Repeating action continues after premise becomes false

You mean to change everything to:

If Badezimmerfenster Open > repeating action, Else If > Stopp repeating action

Something like that?

Well I meant put the instructions to play the sound after the entire If block, though you could try putting them into the block too! That's an idea. Also try an End-if after the test. Not sure if it's required after only one instruction but Rule Machine might prefer it

@Vincent_The_Staat This might actually be the issue. You can do a one-line conditional but it's the "simple conditional" selection. I think in this case you need the endif. That's why the repeat/endrep looks unbalanced.

I would try changing it to the following and see if it works.

.
.
.
Set Volume ........
END-REP
END-IF
IF xxxxxx Closed
THEN
Stop repeating actions
END-IF.

Clone your rule and stop the original and then changed the cloned rule to my suggestion to see if it works.

The rule will repeat your notification one more time after the window is closed because the check for it is at the end of the repeat. As others have suggested, move the IF-THEN to before the Set Volume action and it should stop the notification after the window closes.

Is it possible that you have multiple instance of this rule running? I can see Humidity < 60 triggering more than one instance of this rule and having more than one Repeat running at a time. Logs of this rule would be helpful.

1 Like

Good point!

If I try writing it that way, I get an error right in the editing section. END-REP is supposed to be the last part of a repeating action.

Yes I have. The thought process was, that if someone opens the window after having a No. 2, that the rule wouldn't start firing right away. So delaying the repeating action for 5 minutes for fresh air reasons was the logical choice for me. Also, 60% air humidity is a nice trigger but for closing the window still a little early, so giving the rule 5 more minutes should help with that, too.

Within the repeating action, I have volume up and down, so I can hear the warning but have my speaker back to normal volume after the RA. I guess I can change that, so that it isn't constantly regulating the volume up and down.

Nah, gives me an error message within the rule setup.

I managed this without provoking any errors

Oh, I thought the END-IF after END-REP... Because then I get this:

And does this even work? Because I was basically following the instructions on the documentation page, for the Repeat Until loop:

Think of the repeat and end-repeat, and the if and end-if as containers. You have a big box on the outside and a smaller box on the inside. You can't have a box half inside the other box and half outside, the small box needs to be completely closed inside the big box before you can close the big box

1 Like

"Basically," yes, but not quite. :slight_smile: The instructions use a simple conditional, not a "full" conditional (IF expression THEN). A simple conditional acts only on the action on the same line as it and doesn't need (in fact, cannot have) an END-IF, which is why you don't see one there but do see one suggested to you (in the correct place) above.

Also, those examples take advantage of the fact that a simple conditional on a Repeat action has a sort of special meaning, stopping then repeat when the condition is no longer true. In Rule 5.1, you can do this in a bit more intuitive fashion with a "Repeat while" plus your condition/expression.

Some of those examples, IIRC, do use a full conditional along with a "Stop Repeating Actions," which can work too--as long as your repeat is marked "stoppable." But they were alao written for Rule 4.x, where there were fewer options.

I don't fully understand why you are triggering off humidity but it seems as though you want to trigger this off the window opening. You're doing this by triggering off humidity then waiting for the window to be opened for 5 minutes. This could be one second after the humidity trigger or one year, who knows? My preference would be to structure this rule to trigger on the window then check humidity as a condition for the notification.

Thank you both, for the explanation. Now, I get it. I'll change the rule this weekend and give you feedback. :slight_smile:

Oh, yeah, I see the confusion. Sorry, I didn't explain it enough. This rule serves the purpose to remind me to close the window, so far so obvious. In my bathroom, there are two instances why the window is open.

  1. Someone took a shower/bath, so the air humidity is very high, and needs to be reduced to prevent mold.

  2. Someone had a No. 2, so the methane level is very high, and needs to be reduced to prevent burning in the eyes and noses of everyone else living in the house.

Using just the open window as a trigger, with all the waiting etc. would just help with instance No. 2, but not the humidity. That's why I choose humidity as the trigger and the open window as a required expression. This is giving me the advantage, that if someone just used the toilet and opened a window, the rule would fire right away, because the humidity is already low enough. On the other hand, if someone took a long hot bath and would open the window, the rule is waiting until the humidity is low enough.

Trust me on this, the rule basically works wonderful on this instance, just the over repetition was the problem.

I get what you're saying here but your rule is triggering for every change (report) of humidity < 60. Wouldn't the rule trigger less if you trigger on the window being open and waited for humidity like this?
Wait for Expression: Humidity of Humidity of Temperatur... is < 60 --> duration: 0:05:00

I get your concern, but with the change you are suggesting, it will fire up just as often. As long as the window isn't open, nothing is going to happen any way, because the required expression is false.

@Vincent_The_Staat Your approach is different than mine but I appreciate the discussion. Just shows there is more than one way to achieve the desired result. You've given me some ideas that I'm going to try out.

That's great to hear. Please let me know about your projects. I'm always looking for new ideas to tinker with, myself. :slightly_smiling_face: