If you use a trigger-based template binary sensor you could trigger off the state of the Input select, and set an auto-off for whatever time duration makes sense for your use:
Thanks so much for this code template.
It works perfectly.
Another big step forward for me in my quest for a flexible lighting control automation system.
Thanks