Example Set light off after x minutes

set the light of if switch is on for 2 minutes

Simple Automation Rules

I have moved your post out of the Room Lighting category since it appears to be Simple Automation Rules, not Room Lighting.

For others wondering how to do the same, there are many options, including Basic Rule, Rule Machine, and custom apps, many demonstrated in this recent topic on the same issue:

...and now, of course, the example in the first post above. :slight_smile: