Templating in button-card?


Can someone help me with the below code?

    - type: custom:button-card
      template: dashboard_button_card
        action: call-service
        service: media_player.volume_mute
          entity_id: media_player.str_dn1080
          is_volume_muted: >-
            {{ states('sensor.sony_muted') }}
      icon: mdi:amplifier
      name: test
      show_name: true
      color: white

The part I cannot get to work is

is_volume_muted: >-
   {{ states('sensor.sony_muted') }}

I want to extract false or true out of sensor.sony_muted and use it in my button so that the button mutes or unmutes. It feels like I am very close but I dont understand how to use templating inside the button-card.


Solved it by a script!