Cancel wait

Ah, I think I had a breakthrough re "Cancel Rule Timers" ("CRT") versus "Stop Repeating Actions" ("SRA"). For other learners like me who are reading this thread, I believe SRA will literally stop actions in a REP loop, but will not cancel the loop. That is, even if you issue an SRA, the REP loop will check the conditions again after the timer time out and determine whether to do the actions and repeat at that time. So, for instance, I have washer rule that repeats every 15 minutes if the washer door sensor is not open. When the washer door is open, if I only use a SRA as so, the actions will stop on a door open, but when the timer times out if the door was re-shut in the interrum the notifications will continue.

While (Washing Machine CS closed(F) [FALSE]) Repeat every lnTimeToRepeatInSeconds(1:00:00)
	Speak on Announcement—Downstairs, Announcement—Upstairs : 'You have clothes in the wash.'
END-REP
IF (NOT Washing Machine CS closed(F) [TRUE]) THEN
Stop Repeating Actions
END-IF

Since I want the repeat loop to "break out" upon a door open and not check the door status again when the remaining time times-out, I need to use the CRT as so.

    While (Washing Machine CS closed(F) [FALSE]) Repeat every lnTimeToRepeatInSeconds(1:00:00)
	Speak on Announcement—Downstairs, Announcement—Upstairs : 'You have clothes in the wash.'
END-REP
IF (NOT Washing Machine CS closed(F) [TRUE]) THEN
Stop Repeating Actions
Cancel Timed Actions: **This Rule**
END-IF

No, this is not correct. Stop Repeating cancels the timer that would make it go around again. Turn on action logging to see what happens.

Shoot. Then my Stop Repeating Actions is not working. I'll grab a log file when I am at home and can play with the washer. I know it is not working, because I see the command issued in the logs but the App still shows "Repeating." The Cancel Timed Actions does work.

This was not a bug after all. You left off Stoppable from your While loop. Stoppable is like Cancelable for a Delay. Without Stoppable, Stop Repeating Actions does not stop the repetition.

The change made to 'fix' this will be reverted.

D'oh! Rookie mistake. Sorry about that.

1 Like