Just want to add that a timer’s duration can be templated with the start event. This isn’t clear from the official docs (I’ve come across this a number of times, I really must submit a PR for the docs). You can find more info and examples here: Data template in timer duration.
So:
- Script taking a parameter, passing the duration to the timer start event. You can add the script e.g. to an entity card. I’m not sure whether a modal will pop up asking for the parameters.
- An input datetime helper and a button your UI. A script can automatically use the helper’s value. This makes it configurable and gives you a default.
- An automation using a helper when turning on. Allows for a single, but configurable duration.
- An automation using
for:
with the trigger to turn off. (Can for be templated? I can never remember.) - An automation/script with preconfigured durations and conditions to make the appropriate selection.