Changing a timer’s duration via script, code, etc

Is there a way to accomplish this? Ultimately I’d love to be able to use Google Assistant, etc to say something like, “Turn on kitchen light for 30 minutes”.

While the Automation syntax has “for” available, I prefer to use timers because I can see the current status of a timer. You can’t for automations.

If you start/restart a timer via the timer.start service, you can optionally provide a duration. And like any service call, the data can use templates to dynamically determine the value.