Template State Values in Lovelace

I feel like I am missing something simple here, since I am still new to using templates and creating cards on a dashboard. Basically, I have created an input_text helper, we’ll call it input_test. I want to send the value of this helper to a service. Using the Services tab of the Developer Tools, I am able to do this successfully:

service: remote.send_command
target:
  entity_id: remote.my_remote
data:
  command: "{{states('input_text.input_test')}}"

With the above, the value of the helper is sent to the service, as desired.

However, I tried to put this service call into a button on my dashboard, and am not able to get the same result:

type: button
name: Send Text
icon: mdi:send
tap_action:
  action: call-service
  service: remote.send_command
  target:
    entity_id: remote.my_remote
  service_data:
    command: "{{states('input_text.input_test')}}"

The only difference in the service call is the use of service_data instead of data, as that is what is required by tap-action.
However, when this button calls the service, instead of sending the helper value, it actually sends the template text:

{{states(‘input_text.input_test’)}}

Is what I want to do possible? It seems like it should be simple, but it isn’t working, hopefully, it is just a small error somewhere on my part. Any ideas?

Most of the basic cards do not accept templates. There are a couple work-arounds…

You can put your templated service call in a script and change your tap-action to call the script.
Or, you could try using one of the newer custom cards that do allow templating.

Oh, that was simple enough! I made a script, and it works perfectly, thanks!