TTS card with device selection


I have been setting up an home assistant server for the pas few days and it’s awesome!

But I am having an issue with a TTS card I’m trying to set-up. I would like to be able select the device it will play on from a drop down list so I am calling the following script :

service: tts.speak
  cache: true
  media_player_entity_id: >
    {% if is_state('input_select.liste_pieces_annonce', "Cuisine") %}
    {% elif is_state('input_select.liste_pieces_annonce', "Salon") %}
    {% else %}, media_player.mediacenter
    {% endif %}
  message: "{{ states('input_text.text1') }} "
  language: fr
  entity_id: tts.google_en_com

I am able to verify the state of input_select.liste_pieces_annonce, but whatever I do it is always falling in the “else” statement.

What am I missing?

Thanks in advance for your help!

Got it!

When I set up the input select, I added a " " add the end of each room names… tricky to find!

Next time I won’t use my phone to set up HA!