Random ssml Google Cloud Say

I like to use SSML with Google Cloud Say in a automation but with random text. I tried this but is not working? Anyone know’s how to do that?

service: tts.google_cloud_say
data:
    message: >-
         {{ [ 
         <speak> <emphasis level="strong">Test1</emphasis></speak>, 
         <speak> Test2</speak>, 
         <speak> Test3</speak>, 
         ] | random }}
entity_id: media_player.beneden

The list you created isn’t valid. Delimit each item with single quotes so they can be interpreted as separate strings.

service: tts.google_cloud_say
data:
  message: >-
    {{ [ 
       '<speak> <emphasis level="strong">Test1</emphasis></speak>', 
       '<speak> Test2</speak>', 
       '<speak> Test3</speak>', 
       ] | random }}
1 Like

Thank you, it works! :partying_face:

1 Like

You’re welcome!

You should know that the custom of this community forum is to assign the Solution tag to the first, or best, post that supplies the solution.

In this case, you simply quoted what I posted then marked your own post as the Solution. For more information, refer to guideline 21 of the FAQ.