Cancel running rule with buttons

Question for the RuleMachine wizards in here:
I have a rule that switches on the bedroom lights to 1%, waits five minutes, and then raises the dimmer level of the bedroom to 80% over 10 minutes. The rule is started by triggering a local endpoint (NFC tag).

We have two switches in the bedroom, one by the door, and one by the bedside.
I want to stop the running "raising lights" rule when any of the buttons are presssed.

Seeing I could not find a way to do this in the rule itself, I thought about setting up a new rule that basicly stops proccessing another rule if any of the buttons are pressed.

Yet the only thing I can find is that I can pause a rule, but not cancel it.
How would I stop processing a running command in a rule?

The "wakup" rule itself:

Use "cancel rule timers," then specify the name of the rule you want to stop.

3 Likes

To do it within the rule, you use a pattern like this:

  • Start the raise
  • Wait for an event to occur
  • Cancel rule timers

If the event doesn't occur before the raise completes, there'll be nothing running when this instance attempts to cancel rule timers, so it's a no-op. If this rule re-triggers before the event occurs, the wait goes away, because only one instance runs at a time.