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...
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.
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)
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๐
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