Tutorial: How I make timers that show remaining execution time

rossko57 had a design pattern that does this as well using expire. Design Pattern : Expire Binding based Countdown timer There is a link to a Python version that can be just dropped in and used.

I didn’t do a thorough analysis of the code but everything looks good except for what I mention below.

According to github, it looks like the maintainers are working on an expire replacement that will be compatible with the 1.x binding.

Don’t use Thread:sleep. Instead use ‘receivedCommand’. Look in the rules docs implicit variable section for many other helper variables that are available.

Since the Items are Number Items, use triggeringItem.state as Number rather than converting the Number to a String only to parse it back to a Number.