Variables in TTS Notifications?

Is there any way to refer to variables when it comes to TTS notifications? For example, i’m using the following content for my TTS Notification:

alias: Send TTS Notification
action: notify.mobile_app_s23
metadata: {}
data:
  message: TTS
  data:
    ttl: 0
    priority: high
    media_stream: alarm_stream_max
    tts_text: ALARM! Person detected!

Now in the tts_text, i’d like to know if it’s possible to include a friendly name of 1 of my camera entities? I have a Text notification for my smoke detectors for example, and that works fine with this:

  message: |
    {% set detector_name = {
      'binary_sensor.rookmelder_zolder_rookmelder_zolder_smoke': 'ZOLDER',
      'binary_sensor.rookmelder_kantoor_rookmelder_kantoor_smoke': 'KANTOOR',
      'binary_sensor.rookmelder_bijkeuken_rookmelder_bijkeuken_smoke': 'BIJKEUKEN'
    } %} Rook gedetecteerd door: {{ detector_name[trigger.entity_id] }}!

But i have no idea how i could build something like this for a TTS message.

Yes, you can use templating to retrieve a friendly_name and use it in the tts_text field.

Generally speaking the friendly_name can be retrieved using the state_attr() function:

{{ state_attr('sensor.example', 'friendly_name') }}