One widget to start and show a timer?

I would like to have a switch in Homehabit which will kick off a script or automaton in Home Assistant which starts a timer, then 15 minutes later a light gets turned off.

I would like a widget to be the switch to turn this process on, but to also to then display the time left.

Is there a Home Habit widget that does on and off, but can take an integer as state too?

I can’t think of a good way to do this. Dimmer isn’t right, switch only has on and off… Gauges don’t have an action.

Can you give an example of automation/script for this?

Hey, afraid not, I haven’t written it yet :wink:
How I write it depends on the best way to present it in Homehabit.

Probably if I can’t display the timer, it would just be a template switch with state from a input boolean, and on action being delay for 15 minutes then service to turn off light and turn off input boolean.
But I could use a ha timer, or put time left into a sensor, etc.

Some sort of time would be great!