Custom url card

Hi,
I need some help with this button i am trying to create to play custom url on esphome media player. If i add the url it play’s just fine but I want to play different url’s based on a cusotm text input it fails.

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: media_player.play_media
  target:
    device_id: xxxxx
  data:
    media_content_id: '{{ states("input_text.play") }}'
    media_content_type: music
entity: media_player.esp_32_esp32_speaker
show_state: true

Does this render ok in Developer tools > Template?

Maybe try like this?

"{{ states('input_text.play') }}"

It is working fine in another button’s card for a different entity, however i tried your way and still did not work :slight_smile: