Can Rhasspy's Larynx be used as the TTS for Home Assistant?

So, I have Rhasspy running with the HASSos add-on with Larynx for TTS which sounds amazing, thank you @synesthesiam! Now, I’m wondering if I can set Home Assistant’s configuration.yaml to use Larynx for its TTS instead of google_translate. If so, what would I put in as the platform and base URL etc?

You can use the openTTS addons:

Install the addon with your language and use this as tts in Home Assitant:

tts:
  - platform: marytts
    port: 5500
    voice:larynx:harvard-glow_tts
1 Like

Awesome! Thank you @romkabouter!

It seems that HA still won’t play the TTS audio as there isn’t a media player element I can select without installing a VLC add-on and another addon for telnet to access it, apparently. It’s weird though. Rhasspy has no problem playing its TTS audio through the speakers without any of that.

I do not know what hardware you run. If you use TTS on Home Assistant, HA tries to play the speech on the audio device on the device.
I run HA on a vm in proxmox without speaker, so I have no use for TTS at all.

Yeah I’m using the Rhasspy Home Assistant add-on on an RPi 4. The challenge is that in Home Assistant, it seems to require a Media Player element for TTS to be played through. The OpenTTS add-on doesn’t seem to add one. I’m not quite sure what the simplest way is to add a media player element to just play the TTS through the Pi’s headphone jack, just as Rhasspy seems to do by itself without any further config.

Is possible to use whit HA core?

If you run the Docker image from the addon manually, yes.

Dear all,
I´m trying to setup the TTS and a media player. In my configuration.

  • Rhasspy is a in Pi 4 connected to a remote supervised HA instance on a different machine.
  • I don´t use SSL because I´m completely on local.
  • To make use of Larynx on PI4 had to setup rhasspy on a 64bit bullseye raspios (desktop version that comes with VLC, to be not confuse with TTS or media player). Larynx works well at low quality (no big delay) in this configuration.

I ´ve read a lot of staff either on this community than in home assistant. It seams to use Rhasspy as “media player Alexa or Google type entity” in HA we need to configure a custom “platform: notify” entity first. Did anyone try this?

Currently I use a rest_command, to sending as “service” from HA the text to Rhasspy API.

Would give it a try later on and eventually post the results, it is not really easy to found docs and/or guides on this.

I have 2 satellites i am playing with and 1 main node. Here is my setup

1 main satellite
2 dummy satellites
opentts running on a completely different machine

In HA I have a service created.

rest_command:
  rhasspytts:
    url: http://192.168.2.80:12101/api/text-to-speech?siteId={{ siteIds }}
    method: POST
    payload: "{{ payload }}"
    headers:
      accept: 'text/plain'
      Content-Type: 'text/plain'

Note the URL. That is the text to speech endpoint. So you send a payload to it, it sends it to the opentts container, and back. BUT if you look at the end of the url, you will see {{ siteIds }}

When I call the rhasspytts service from automations or whatever it looks like this.

      service: rest_command.rhasspytts
      data:
        siteIds: sat1
        payload: 'The washer is done , but not moved to the dryer. , , , Do you want mildew smelling clothes? , , ,  Because thats how you get mildew smelling clothes. '
        data:
          type: tts

By passing the name of the satellite I want i can tell the master rhasspy which satellite to playback on.

A strange note, I have seen in some stuff for alexa and what not that you can get the tts systems to do a pause by adding a hyphen - in the text. Seems Rhasspy didn’t really do anything with that, but it DOES add pauses via commas. So I just played around with this passive agressive washer notification until it sounded good.

Not sure if that’s what you were looking for or not.

Hello CrankyCoder,
Thanks a lot for the useful hint, TTS wise I did set up as per your advice and we are fine :slight_smile: it works like a charm, thanks again :slight_smile:

With this I guess will be possible to write a python script to use wikipedia and give Rhasspy the functionality to replay to some “curiosity request” or tell a joke… I mean some “personal assistant” skill… that honestly, once I figure out how to run slot programs or scripts I can easily adapt from something I developed in the past… (will post when getting some results a guide and the code used).

I did setup the main Rhasspy server on PI4 with 64bit Raspian and Larynx TTS works much better "low resolution mode) and PI4, got to say it sounds quite good :wink:

I would be interested to know how to get “Rhasspy” to play a songs (not create a playlist or something like this, as per it is well documented) or play the news from a url… like as a “media player”. I did understood that Rhasspy has no build in functionality for this, and I´m wonder what is the best known method to accomplish this task. I guesses it would be interesting to use HA media for “local stored” medias, and some script to grab medias from the internet, for instance this is the goal I would like to set here.

Thanks once again :slight_smile:

I am looking into the same thing. Not sure rhasspy can play the song, but I have a few pages and tutorials open for MPD + Rhasspy on the same box. I am also looking to see if there is a way to have rhasspy on something like picoreplayer (light weight logitech media server client)

But I have a feeling I will end up doing 2 pi’s in some rooms. 1 for rhasspy, 1 for music playback and whole home audio.

You can send wav file with HA Container and Rhasspy like this Play audio file from Home Assistant Container - #4 by DamienKoala - Configuration - Home Assistant Community