Need a bit of help with what I think is a code issue on my "speech engine" (directing tts to certain speakers)

Hello all,

Hoping someone here can help me track down what I think is a bug/ mistake in my TTS speech engine code. I’m sure it is probably an easy mistake as I am very new to home assistant and am just learning the automation/ script language.

Thank you all for any help you can provide with this and I will lay 3 pieces of code out below (2 scripts and 1 automation). The two scripts, combined through a service call, are my “speech engine” and the third piece of code is the automation that I am triggering by changing the state of the entity in developer tools>states.

  speech_engine:
    sequence:
      - condition: state
        entity_id: input_boolean.audible_notifications
        state: "on"
      - condition: state
        entity_id: group.family
        state: "home"
      - condition: state
        entity_id: input_boolean.vacation_mode
        state: "off"
      - service: >
          script.jarvis_voice
        data:
          who: '{{ who }}'
          message: >
            {{ message }}
  jarvis_voice:
    sequence:
      - service: tts.google_translate_say
        data_template:
          entity_id: >
            {% if who == 'back porch' %}
              media_player.back_porch_speaker
            {% elif who == 'front porch' %}
              media_player.front_porch_speaker
            {% elif who == 'dining room' %}
              media_player.dining_room_wifi
            {% elif who == 'office' %}
              media_player.office_wifi
            {% elif who == 'master bedroom' %}
              media_player.master_bedroom_speaker
            {% elif who == 'master bathroom' %}
              media_player.master_bathroom_speaker
            {% elif who == 'gym' %}
              media_player.gym_speaker
            {% elif who == 'guest bedroom' %}
              media_player.guest_bedroom_speaker
            {% elif who == 'garage' %}
              media_player.garage_speaker
            {% elif who == 'guest bathroom' %}
              media_player.guest_bathroom_speaker
            {% elif who == 'everywhere inside except tvs' %}
              media_player.everywhere_inside_except_tvs
            {% elif who == 'kitchen' %}
              media_player.kitchen_display
            {% else %}
              media_player.kitchen_display
            {% endif %}
            message: >
              {{ message }}
  - id: washer_notification
    initial_state: true
    alias: Washer Notification
    trigger:
    - platform: state
      entity_id: sensor.washer_status
      from: running
      to: complete
    action:
    # - service: script.status_annc
    #   data:
    #     who: '{{ states.sensor.room_presence.state }}'
    #     call_interuption: 1
    #     speech_message: It appears the washing machine has completed its cycle.
    - service: script.speech_engine
      data: 
        who: 'kitchen'
        message: 'Just a quick heads up, It appears the washing machine has completed its cycle'

In the logbook, it seems as if the automation is triggering but I am just getting nothing out of the google home.

Here is the working code for anyone looking to do something similar in the future. My issue was that within the

  speech_engine:
    sequence:
        - service: media_player.volume_set
          data_template:
            entity_id: >
              {% if who == 'back porch' %}
                media_player.back_porch_speaker
              {% elif who == 'front porch' %}
                media_player.front_porch_speaker
              {% elif who == 'dining room' %}
                media_player.dining_room_wifi
              {% elif who == 'office' %}
                media_player.office_wifi
              {% elif who == 'master bedroom' %}
                media_player.master_bedroom_speaker
              {% elif who == 'master bathroom' %}
                media_player.master_bathroom_speaker
              {% elif who == 'gym' %}
                media_player.gym_speaker
              {% elif who == 'guest bedroom' %}
                media_player.guest_bedroom_speaker
              {% elif who == 'garage' %}
                media_player.garage_speaker
              {% elif who == 'guest bathroom' %}
                media_player.guest_bathroom_speaker
              {% elif who == 'everywhere inside except tvs' %}
                media_player.everywhere_inside_except_tvs
              {% elif who == 'kitchen' %}
                media_player.kitchen_display
              {% else %}
                media_player.kitchen_display
              {% endif %}
            volume_level: >
              {% if states.input_boolean.audible_notifications.state == 'on' %}
                {% if who == 'kitchen' %}
                  {{ states('input_number.tts_volume') | float }}
                {% else %}
                  {{ states('input_number.tts_volume') | float }}
                {% endif %} 
              {% endif %}
        - service: tts.google_translate_say
          data_template:
            entity_id: >
              {% if who == 'back porch' %}
                media_player.back_porch_speaker
              {% elif who == 'front porch' %}
                media_player.front_porch_speaker
              {% elif who == 'dining room' %}
                media_player.dining_room_wifi
              {% elif who == 'office' %}
                media_player.office_wifi
              {% elif who == 'master bedroom' %}
                media_player.master_bedroom_speaker
              {% elif who == 'master bathroom' %}
                media_player.master_bathroom_speaker
              {% elif who == 'gym' %}
                media_player.gym_speaker
              {% elif who == 'guest bedroom' %}
                media_player.guest_bedroom_speaker
              {% elif who == 'garage' %}
                media_player.garage_speaker
              {% elif who == 'guest bathroom' %}
                media_player.guest_bathroom_speaker
              {% elif who == 'everywhere inside except tvs' %}
                media_player.everywhere_inside_except_tvs
              {% elif who == 'kitchen' %}
                media_player.kitchen_display
              {% else %}
                media_player.kitchen_display
              {% endif %}
            message: >-
              {{ message }}

I ended up embedding my original “jarvis script” within the “speech_engine” script directly. I’m not really sure why my orginal doesn’t work but maybe someone more knowledgeable than I will find a bit of time to respond and help us newbies understand if my orginal post had an error or if you just can’t do what I was trying. Thank you all!!