Service to set attribute of input_text?

A Python script may be another solution like shown here. Contrary to the title the scripts also handles attributes.

hass.states.set() is where the magic happens, if you want to do your own script.