Solved - Error using TTS with SONOS integration locally

Dear all,

i am using ha since a couple of months now and integrate more and more devices in my home. Now after adding SONOS Play:1 (pre 2020) i found TTS option in the device’s features. unfortunately it does not “speak” my text but throws an error:
Logger: homeassistant.components.tts
Quelle: components/tts/init.py:1099
Integration: Text-to-speech (TTS) (Dokumentation, Probleme)

Error on load tts: 47ea6846da09828d2328cd607339e8257880832f_de-de_dd5f24498e_cloud not in cache!
Error on load tts: 47ea6846da09828d2328cd607339e8257880832f_en-us_5c97d21c48_cloud not in cache!
Error on load tts: 47ea6846da09828d2328cd607339e8257880832f_nl-be_7280e96d39_cloud not in cache!

as you can see i tried different languages and therefore different voices. none seems to work. After reading the HA-TTS docs it seems this “building block integration” does not work without another TTS integration.

my question is now: can i make this run WITHOUT need to connect to the internet and blast my text through any cloud service all the time? What am i missing to make this run?

thanks for helping.

btw:

  • Core 2025.2.2
  • Supervisor 2025.02.0
  • Operating System 14.2
  • Frontend 20250210.0

Without automation code it is impossible for anyone to say what the exact problem is.

Hi Mayhem, i did not write any automation for this. SONOS integration offers in the Entity for each device a button to “search for media”. in this selection you can select streaming radios, local music files and TTS. within TTS you can select either HA or Google Cloud.
Well it seems i need to sign in for either cloud. My question is, if there is any local usable integration to make TTS work.

ok, it seems i found something. There is NO TTS support built into HA. I have to install something on a separate machine or use a cloud service instead. is that right ?
I found picoTTS and probably maryTTS to fit my needs.

The easy mode would probably be to simply install Piper and/or Whisper, available from Settings > Add-ons > Add-on Store.

great! you made my day…

It depends what you want to do with TTS.

If you just want to send TTS announcements to your Sonos speaker you can use media_player.play_media and send them as mp3 files. (This should work with any integrated speaker, but all mine are Sonos.)

  - target:
      entity_id: media_player.living_room
    data:
      announce: true
      media_content_id: >
        media-source://tts/picotts?message="This is a test of picotts................................"
      media_content_type: music
      extra:
        volume: 50
    action: media_player.play_media

The PicoTTS integration is entirely local, so no cloud involved. Be warned, though: there is a bug in it such that any sentence between 16 and 32 characters long comes out as garbage. The workaround is to pad it out with punctuation, as in the example.

If you want to use another TTS engine, substitute it for picotts in the media_source line.

Sadly, if you are using a voice client such as Voice PE it doesn’t seem to be possible to send TTS responses to other speakers as you can with intents. It looks as if voice has been developed as connected to the rest of HA, but not quite integrated with it right from the beginning of Assist, so there are events and APIs available but it’s hard to see how to leverage them. (I hope someone can tell me I’m wrong - I’ve been trying to get this working for some time.)