Command_line switch utilize template in command_on/off

I would like to be able to supply the hass state to my command_line switch. For example, I have a pause command_line switch that calls a API on a web server to pause. The pause also (optionally) has a duration that can be specified which allows it to resume after x minutes.

Being able to access the hass state and provide a template command_on, I’m would be able to have a input_number to adjust how long I would like to pause for.

Now, I’ve managed to accomplish this myself, but as a duct-tape solution, and I’m sure I don’t understand the potential damage I could be doing and was hoping for a more official way to be integrated in the future.