I’m trying to set it up when button is pressed the script is called with the “media_content_id” is populated with state of input select. However it just seems to send the whole command instead of evaluating the state. The input select contains a list of sound names. The weird thing is when I call the script with same data it works perfectly.
lovelace card:
type: vertical-stack
cards:
- type: entities
entities:
- input_text.tts_fire_tv
- input_select.alexa_sound_list
- type: grid
columns: 2
square: false
cards:
- show_name: true
show_icon: true
type: button
icon_height: 20px
tap_action:
action: call-service
service: script.play_sound_fire_tv
data:
media_content_id: '{{ states("input_select.alexa_sound_list") }}'
target: {}
icon: mdi:surround-sound
- show_name: true
show_icon: true
type: button
icon_height: 20px
tap_action:
action: call-service
service: script.play_tts_fire_tv
data:
message: '{{ states("input_text.tts_fire_tv") }}'
target: {}
icon: mdi:account-voice
play_sound_fire_tv script
sequence:
- service: media_player.play_media
data:
media_content_type: sound
media_content_id: "{{ media_content_id }}"
target:
entity_id: media_player.bedroom_alexa_fire_tv
mode: single
alias: Play Sound Fire TV