Timers are Weird

Timers behave strangely.

I call timer.start with a duration of 15 minutes.

14 minutes elapse.

I call timer.start with a duration of 2 minutes.

The timer stays in “active” state. Seemingly forever. I gave up waiting after about 5 minutes. The Duration attribute is 2 minutes. The Remaining attribute is 2 minutes. And the state is active. Is this right?

I’d happy do a “if timer.mytimer.attribute.remaining < 2 minutes then timer.finish” but, IF logic in an automation requires, basically, duplicating the automation logic with the above “if” set as a condition, and that gets messy really quickly.

Why doesn’t the timer go into “idle” or at least “paused” state when I call timer.start the second time? Or, worst case, it should at least start a new timer with a 2 minute duration.

What am I doing wrong?

If you’re changing the time on the timer and effectively restarting it you need to cancel it, and then start it again with the new time.

1 Like

I will add that to my automations and see if it works any better. Thank you!

For reference…

link removed

1 Like