Google Cloud SSML not working

Hello! Just trying to integrat SSML into my HA.

action: tts.speak
target:
  entity_id: tts.google_cloud
data:
  cache: false
  media_player_entity_id: media_player.dressing_room_speaker
  message: "<speak>Good morning, Home Assistant. The time is now <say-as interpret-as='time'>12:43 PM</say-as>.</speak>"
  options:
    voice: en-US-Chirp3-HD-Iapetus
    text_type: ssml

When I try to run anything with SSML, I get zero response and zero errors. Jut nothing happens. If I remove the text_type is speaks fin, but obviously without the SSML formatting.

What am I missing?
Thanks!

Hmm, anyone have experience with this? I’ve tried copying YAML from other examples but I can’t get any to run.

Something broke very recently. When I try tts.speak with tts.google_cloud, it throws the below error:

Failed to perform the action tts.speak. value must be one of ['', 'af-ZA-Standard-A', 'am-ET-Standard-A', 'am-ET-Standard-B', 'am-ET-Wavenet-A', 'am-ET-Wavenet-B', 'ar-XA-Chirp3-HD- ...CUT...'yue-HK-Standard-D'] for dictionary value @ data['voice']. Got None

Just two days ago my scripts worked, so I assume google changed something in their API?

There is already a bug reported on github: Google TTS throws error · Issue #146043 · home-assistant/core · GitHub

The suggested fix there worked for me. Just reconfigure and make sure you have a default voice selected.

Thanks. I actually found that too, and got it working. But for this problem, it’s just the SSML that I can’t get to work.

That link did help me get Google Cloud working again though. Just not the SSML part. No errors are being thrown in this case

Sorry, I misread your original question :grimacing:

Does it work if you remove the options? The below code works for me, but it doesn’t if I add the options.

action: tts.speak
data:
  cache: true
  media_player_entity_id: media_player.living_room_speaker
  message: >-
    "<speak>Good morning, Home Assistant. The time is now <say-as
    interpret-as='time'>12:43 PM</say-as>.</speak>"
target:
  entity_id: tts.google_cloud

It did used to work for me even with the options before, but now I also can only get it to work if I remove the options.

BTW: I see you use a Chirp3 voice. When I switch to a Chirp3 voice, ssml tags don’t seem to work. Ssml tags seem to only work with wavenet or standard voices for me.

Yeah, I think that may be part of the problem. If you try changing the pitch for a Chirp voice, it also fails. Those new voices must not work with anything other than the speed option. Thanks for looking into it