Can I get an assist with door open notification using template?

I have another similar automation working fine but Im obviously missing something in this one. I cant seem to figure this one out. The configuration validation says this is good.

- id: "Door Open Notifications"
  alias: "Door Open Notifications"
  description: "Door Open Notifications"
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.garage_tilt_sensor
    - binary_sensor.family_room_slider_contact
    - binary_sensor.garage_side_door_contact
    - binary_sensor.garage_back_door_contact
    to: 'on'
  action:
  - service: tts.google_translate_say
    data:
      entity_id: media_player.home_speakers
      data_template:
      message: '{{ trigger.to_state.attributes.friendly_name }} was {% if trigger.to_state.state
        == ''on'' %} Open {% else %} Closed {% endif %}'
  mode: queued

How are you testing it? It will not work with Run Actions button when using “trigger.to_state” type stuff. If it still doesn’t work when actually opening a door see what the log says

something looks off with the data_template: section. message: needs to be indented more.

Did you ever get this working? If so, could you paste your code? Thanks!