Passing variables to a button to pass to a script that accepts a variable

Hi, trying to pass text + variable from a button to a script - getting no-where. Button example…

  service_data:
    myvar: The time is {{ now().strftime('%H %M') }}

The script is looking for a variable called myvar. If I just pass text from the button - it all works - if I include a time variable in the button I get “now” out instead of the time… Ideas?

Most core dashboard cards do not support templates. https://www.home-assistant.io/dashboards/actions/#limitations

There are third party resources that add this functionality. See 📝 100% Templatable Lovelace Configurations