How to stop a rule or pause it where it is?

I have a rule machine rule I use for an alarm. It mostly adjusts lights brighter and different colors for about ten minutes and triggers a virtual switch for Alexa to handle the audio side of the alarm.

I usually wake early in the sequence and there is no reason for the light to get brighter or trigger Alexa to play music and wake the wife. I usually grab my phone first thing and shut off it's alarm that I use as backup. Ideally I would like to open my dashboard and turn off the virtual switch I use as my trigger. How can I make turning off that virtual switch trigger pause or stop the rule from continuing?

There's lots of different ways. For example, you could use motion sensor, a button device or a light switch in a required expression or for cancelling pending actions, from within the rule or from another rule...

What does your rule look like?

2 Likes

Sorry was updating post when you replied, here's the rule


Lots of ways. Here's one.

Change trigger to change instead of turning on.
Put a "Cancelable" at the end of all Delays in your rule. Delay your actions. Do not add delays between actions.

Put an IF WorkAM trigger is ON before the actions.
Put an ELSE at the end, with Cancel delayed actions and Off Work AM alarm
(Add Off: Master Bedroom Lamp, if desired)
END-IF

I might be overlooking some things, but this should work as desired.

You can then figure out a way to turn off Work AM Trigger to stop the sequence from going further.

1 Like

Or you could create a second rule that triggers when "Work AM Trigger" OR "Work AM Alarm" turns Off (presumably via dashboard tile or button device)...

The second rule's Action could then simply be...
Cancel Timed Actions: Work AM Alarm rule

With this option, you don't need to make any changes (e.g. make stuff cancelable) in the Work AM Alarm rule -- the second rule takes care of that.

For a warm fuzzy, you could add an add'l action...
Turn Off Work AM Trigger, Work AM Alarm (command only switches that are On)

2 Likes

I would use work AM trigger as a required expression and have it cancel all pending actions when it becomes false.

Then you would would only need to make sure something turns it back on, or you do it manually, before your next scheduled alarm to re-enable the rule.

4 Likes

Thank you all. I have never tried to cancel now I am going to be busy looking at all my rules, playing around, and breaking everything. The wife will be pleased๐Ÿ˜„

Just for clarification, I was talking about turning your switch back on (not the rule itself, the switch being on would automatically enable the rule)

This feature is very handy if you have a lot of rules you want to cancel all at once.

1 Like

10-4

I can't for the life of me figure out the cancel part

It is an option to select when you are setting up the required expression.
You can also go into the rule to edit, and click on the required expression section, and you will be able to turn it on from there

More information here(Click on "required expression" under "anatomy of a rule" on the page contents):

2 Likes