Voice notification to an android smartphone

i want to send a vocal notification to my samsung Se 20 with the ‘tts_text’

here is my code:

service: notify.mobile_app_sm_g780g
data:
     message: TTS
     data:
           tts_text: "bonjour"

everything is OK

but when i change to :

service: notify.mobile_app_sm_g780g
data:
  message: TTS
  data:
    tts_text: "{{ state_attr("sensor.gerbier_voltage","friendly_name") }}"

i get the prior example: Bonjour

???

have you an explanation…

installed version : the last one 2022.9.1

what is the syntax of tts_text ???

Thanks

you have to use single quotes inside the double quotes (or the other way round):

    tts_text: "{{ state_attr('sensor.gerbier_voltage','friendly_name') }}"

should work.

OK thanks…