Read DELAY time remaining

When an App gets triggered is there a way to read a delay time remaining?

This is what I am trying to do. Physical switch turns on and a delay to turning it off is established. So far so good. I can make the delay longer by toggling the switch. First switch on is 10 minutes until off. Toggling it off and on makes the time 15 minutes until off this works for N times. 10, 15, 20, 25. Every time starts the time until off using the increasing values. Works good. But this is what I trying to do. If the switch has been running for say 8 minutes but what I want to do is add 5 minutes to the remaining making the switch turn off in 7 minutes instead of 15 more minutes, I can't because I can not load in the remaining time for which to then add 5 and use that new value of 7 into a new wait or delay. Anyone else tried to add a few minutes to a running delay or wait?

There might be a better way to do this, but you could likely store the off time in a variable when it is initially being set (variable math: now() + 5 minutes).

Then when the rule runs (again), subtract the variable time from now() and I think that would give you the remaining time (in seconds?). You may want to do a check and only use it if the result is greater than 0…

Where is it being established? Does the switch driver have an auto off preference that is creating a scheduled job in the driver to turn itself off, or is this some off delay in some other automation you have added with a rule?

It is all in the App. I use the WAIT with a variable. The delays are made by adding to the variable until the switch is turned off for a few seconds (trigger delay) then the variable is set to 0. We know that WAIT resets every time the App is run. I use WAIT as it reset automatically and seemed the way to go since I could not see a way to load a variable from the time remaining to gave up the idea of adding a few minutes to an existing wait/delay.

Which app?

It is a Rule Maker App.

I have never used the RM repeat function. But I looked it up and it seems worth learning. Thanks for the tip.

1 Like

re-wrote the rule using the repeat while function. Solved my need to add to the remaining time instead of start over with a higher value. Thanks to the user base here for the suggestion.