I was looking to do something like this! In my case, I was wanting to create a virtual “timed fan switch” button/switch to complement my real “fan switch”—something I could use to turn on the fan switch for a pre-set amount of time, like 15 minutes or so, then turn off. This looks like it could help with that, but it appears you’d still need a rule/app that would control the physical device based on this switch, and my wishlist for perfection also includes a “cancellation” of the timer if the underlying physical switch is manipulated (e.g., if I started the “timed switch” but then turn the fan off manually and on again before the original timer is up).
Does anyone know if there’s an app (or SmartApp I could port) that can help with this? In ST, I’ve done it a few different ways but don’t know that I ever had a good solution for the second thing I mentioned. And really, the first didn’t always work all that well either, since many times I found the original switch still on after the timed/virtual one was supposed to turn it off (cloud problems?).