Why TTS no longer works on Sonos

Hello everyone,

I’ve been working with TTS and Sonos for a while now. But for some reason, it suddenly stopped working. Can someone tell me where I should look to fix this? I’ve been searching for hours but can’t figure it out.

When I run the following automation,

  - data_template:
      entity_id: media_player.bureau_sonos
      message: Dag dit is een dinsdag
    enabled: true
    action: tts.voicerss_say

the music stops for a moment, but the Sonos box does not speak the text.

Thanks for all your replies.

Start by checking the Log for associated errors and review the automation/script’s trace.

1 Like

Thanks for your response.

But which logs? The automation trace doesn’t show any errors and works fine, but nothing is being played through the Sonos speakers.

Settings → System → Logs

Ensure “Home Assistant Core” is selected (it’s the default selection).

Have you tried playing something other than a TTS message?

There’s also a somewhat newer way to announce on Sonos:

1 Like

I don’t see anything related to Sonos or TTS in the logs.

Have you tried playing something other than a TTS message?
What do you mean by this?

I mean exactly what I said.

Have you tried playing something else? Something other than a TTS message. Like an MP3 file.

The goal is to determine if the problem is with the TTS command or with the Sonos device’s ability to play received data.


EDIT

I assume you have already done this but I will mention it anyways. Confirm the Sonos device’s volume is not zero or muted.

1 Like

Yes, MP3 doesn’t work either. The music stops playing, but the MP3 doesn’t play.

data:
  entity_id: media_player.bureau_sonos
  media:
    media_content_id: /local/Geluiden/Biepen/Biep 007.mp3
    media_content_type: music
    metadata: {}
enabled: true
action: media_player.play_media

If I try this I do get a message in the Sonos app.

This automation has always worked and now suddenly it doesn’t anymore. And I haven’t changed anything.

Volume is of course not off :grin:

Try pasting this into your dev tools while playing music:

action: media_player.play_media
target:
  entity_id: media_player.bureau_sonos
data:
  announce: true
  extra:
    volume: 20
  media:
    media_content_id: >
      media-source://tts/cloud?message="Dag dit is een dinsdag"&language=nl-NL&voice=MaartenNeural
    media_content_type: music
    metadata: {}

Need to reauth Sonos? But this is playing locally.

So it’s a general inability to play anything and not just TTS messages.

Looks like it’s an issue at the Sonos end.

When I try this, absolutely nothing happens. I don’t understand it at all!

I think so too, but how to solve it? Anyway, thanks a lot for everyone’s input.

Enable debug logging for the Sonos integration.

Play the “Biep” file.

Report the problem as a new Issue in Home Assistant’s Github Core repository and include the debug log. Include the screenshot of the Sonos app you posted above.

Hi, this is getting out of hand. Where can I find the debug log? I’m trying a lot, but I’m not that good at HA right now.

Settings → Devices & Services → Integrations → Sonos

In the upper righthand corner is the overflow menu (three vertical dots). Open it and select “Enable debug logging”.

Ok, thank you, but I found this but where can I find the log that I need to copy after I play the beep?

It will be displayed in Logs (same menu path as I described earlier).

“Debug” mode makes the integration report every little detail about what it’s doing (not just info/warnings/errors).

Done, but in logs there is nothing to see about Sonos, the beep file or the automation!!

Thanks for your response, but how?

While in the Logs view, click its overflow menu and select “Show full logs”.

Alternately, when you disable “debug logging” in the Sonos integration, it will offer you the ability to download the log file containing Sonos activity.