Best way to have a switch stay "on" for a limited period using UI?

I have a Z-Wave switch and Z-Wave wall plug. I’d like the wall plug to be turned on for 2 minutes after key press on the switch, and have it switched off again after that amount of period.
What is the best approach to realize this using OH3 (3.0.1), preferably using nothing but the UI ?
I thought I’d create a rule, that switches on the wall plug, when the item state of the switch changes, then insert a script that waits 2 minutes and then send the off command, but I’m not sure that is a good approach ?
And if it is: how can I create a script that pauses for 2 minutes ?
Yes I know, these are newbie questions, but many thanks for the support !

Kind regards,

David.

Use the add metadata then expiration timer in the item settings.

2 Likes

Works like a charm ! I added meta to the wallswitch (which was also connected to a led indicator). After 2 minutes both the led indicator and the wall switch go off… Perfect !
Thanks for the hint !