'Delay actions' delay within IF/THEN condition not delaying subsequent actions

Hey folks,

Per the subject, I'm trying to delay a set of actions by setting a delay based on a variable (the same variable[integer] is also used to control the RM speak/notify behavior hence the math).

Why are the 'Delay actions' in the RM rule not delaying the subsequent speak/notify actions? I even set the delay to a fixed/decimal '10' to see if the variable was throwing it but it made no difference.

Guidance much appreciated. :+1:

Thx!

Could you turn on logging and post a screenshot of the logs?

As I understand it, you are correct in that the delay should delay remaining tasks.

1 Like

Logs will reveal this if the case, and I agree that they are a good idea to enable--but one guess without seeing those: is it possible the value of sonosTTSControlFlags changed multiple times while any of the delays were still pending? If so, they'll remain scheduled -- nothing in your rule cancels them -- and may therefore appear to make subsequent actions run sooner than expected (if your reference point is the latest trigger event).

2 Likes

I think I understand what's happening but the behavior is... questionable to me at least. As the actions in instance #1 affect the state of instance #1's trigger condition, the rule is re-triggered (instance #2 trying to run). The second instance either causes the first instance to do nothing or instance #2 appears to evaluate so quickly that it nullifies the TTS 'textTospeech' variable before the first gets a chance to execute it. I can handle this with yet another control flag but that's precisely what I was trying to avoid by overloading 'sonosTTScontrolFlags' in the first place.

Any thoughts/alternative approaches/guidance much appreciated.

Logs below:

1 Like

Saw this after my slightly earlier reply: yes, I concur.

Is there a way to control this behavior?

// EDIT: gonna try changing the evaluation logic in trigger from '!=' to 'increased'.

Mark the delays as "Cancelable?" (it is an option on the delay action when you create or edit one), then use a "Cancel Delayed Actions" action somewhere else in your rule that make sense, perhaps as the very first action.

You could also consider "Wait for events: elapsed time" instead of "Delay," which is automatically canceled on re-trigger, but last I checked, that only allowed specified numeric values and not variable values.

1 Like

Thanks!

I tweaked the trigger's evaluation logic to 'increased' since I never need to lessen the value to trigger the function--that did it.

Love this forum--a wealth of near instantaneous wisdom--much appreciated to all!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.