Is there a way to stop other instances of same rule?

Is there a way to cancel all other instances of a rule from within a rule?
Basically, I want my rule when it starts to override and stop all other instances of the same rule. I thought that Cancel Timed Actions: **This Rule** would possibly work but it does not seem to be impacting other instances.

I am aware of hacks using variables but I was hoping for something more elegant.

"Cancel Rule Timers" -- which may display as its old name in some places, "Cancel Timed Actions" -- at the beginning of a rule should do this, specifically cancel all scheduled jobs (note that this would include periodic triggers you might actually want, so "Cancel Delayed Actions" is a better choice if you do). Coupled with the fact that a re-trigger cancels all waits (whether they are scheduled jobs or event subscriptions), that should do what it sounds like you're asking.

If you're seeing something that suggests different behavior, I'd describe what that is and, of course, provide the rule itself plus logs that demonstrate the behavior.

One guess: note that the second thing above requires a "real" trigger, so a "Run Rule Actions" from another rule won't do it.

2 Likes

Thanks for confirming that is how its supposed to work.

I think I figured it out, bad logic in the rule with an else-if and that made me think the cancel was not working.

This sets the LED on a ZEN76 based on all the locks except the door exiting the laundry room to the garage (which you lock after exiting if desired). Green LED gives me all clear to go. Its very nice to not have to go check the front door before leaving.

The catch was I did not want it to turn red right away upon unlocking in case of a quick unlock-relock where the LED would going back and forth with tons of zwave commands. Had to reconfigure it correctly for that 30 second delay on the unlock to not step on top of itself when quickly relocking it.

This seems to be working better and still pretty clean.
The private Boolean is to avoid sending duplicated commands if the LED does not need to be changed, again trying to reduce z-wave traffic.
image

Hmm... may even remove the boolean check for going green so avoid it getting stuck somehow with the boolean in wrong place. Will see if I run into any issues with it like this.

2 Likes

You might find this thread informative: