Cancel delayed actions not working

I have the following rule, which has a delayed action to switch off my heater, and triggers "Cancel Delayed Actions" when the heater is switched off before the delay time.


But the delayed actions still happen even if the heater is switched off before the delay time. I can see the cancel happening, so any ideas why it's not cancelling?

app:8942020-03-11 10:11:58.920 am infoAction:     Cancel Delayed Actions (skipped)
app:8942020-03-11 10:11:58.918 am infoAction: ELSE (skipping)
app:8942020-03-11 10:11:58.898 am infoAction:     Speak on Echo - Office: 'Office heater switched off after 2 hours'
app:8942020-03-11 10:11:58.857 am infoAction:     Off: Office heater
app:8942020-03-11 10:11:58.826 am infoDelay Over:     Delay 0:01:00
app:8942020-03-11 10:11:17.543 am infoAction:     Cancel Delayed Actions
app:8942020-03-11 10:11:17.540 am infoAction: ELSE (do actions)
app:8942020-03-11 10:11:17.535 am infoAction:     Speak on Echo - Office: 'Office heater switched off after 2 hours' (skipped)
app:8942020-03-11 10:11:17.529 am infoAction:     Off: Office heater (skipped)
app:8942020-03-11 10:11:17.523 am infoAction:     Delay 0:01:00 (skipped)
app:8942020-03-11 10:11:17.518 am infoAction: IF (Office heater(off) is on(F) [FALSE]) THEN (skipping)
app:8942020-03-11 10:11:17.470 am infoOffice heater auto off after 2 hours Triggered
app:8942020-03-11 10:11:17.457 am infoOffice heater auto off after 2 hours: Office heater switch off
dev:5522020-03-11 10:11:17.365 am infoOffice heater was turned off [digital]
app:8942020-03-11 10:10:58.773 am infoAction:     Delay 0:01:00
app:8942020-03-11 10:10:58.769 am infoAction: IF (Office heater(on) is on(T) [TRUE]) THEN
app:8942020-03-11 10:10:58.697 am infoOffice heater auto off after 2 hours Triggered
app:8942020-03-11 10:10:58.682 am infoOffice heater auto off after 2 hours: Office heater switch on
dev:5522020-03-11 10:10:58.519 am infoOffice heater was turned on [digital]

Change your actions to be like the following:

IF (Office Heater in on) THEN
    Off: Office Heater -> delayed 0:01:00 (cancelable)
    Speak on Echo - OFfice: "Whatever ....."
ELSE
    Cancel Delayed Actions
END-IF

You can modify the Speak command to be delayed and cancelable just like the Off command.

1 Like

Edit you Delay action and turn on the Cancel switch. This will make the Delay cancelable and will stop the Off and Speak on Echo actions from running

2 Likes

Thanks, forgot all about the cancel switch.

Will go and get some more coffee!

Possibly OT, but still concerning delayed actions....the rule below isn't working as I hoped it would. Is it because I too have the cancel delay action wrong, or have I completely misunderstood how this works?

What I want to have happen is;

    1. If the freezer door opens, make the announcement after 45 seconds.
    1. Repeat that announcement every 30 seconds until freezer door closes.
    1. Don't play the message at all if it is open for less than 45 seconds.

Any ideas here? Sorry if this is completely off topic. I used to have this working in an earlier version of RM, and was bringing everything over and obviously stuffed something up??

Structure it like this:

Trigger: Freezer Door *changed*

Action:
IF (Freezer Door Open) THEN
    Delay 0:45:00 (cancelable)
    Repeat every 0:30:00 (stopable)
        Speak on ...
    End Repeat
ELSE-IF (Freezer Door Closed) THEN
    Cancel Delay Actions
    Stop Repeating Actions
END-IF

I just want to make it clear what happens when the door is closed but you could use an ELSE instead of ELSE-IF (Freezer Door Closed) THEN if you prefer. The rule will run the same either way.