Local TTS options inside Docker

Thank you! but there’s no documentation. How can I add more voices? Can you give me some more hint please?

You can check out my post on how I set it up:

https://webworxshop.com/my-road-to-docker-part-2-my-home-automation-stack

Hope this helps!

Thank you! I will try to follow your instructions!

OK I installed it and can use it with the web page.

But can’t test it with HA.

I call service “tts.marytts_say” with this service data

{“entity_id”: “media_player.corridoio”, “message”:“testing one, two, three”}

But I receive error 500

Here’s my config for Marytts.

 - platform: marytts
   host: 192.168.2.100

Any hint?

Have a look at the logs from your marytts container with docker logs <container name>. Post them here if you have trouble working it out from that.

I have a very silly question.

How to “use” marytts in Home Assistant?

I mean, by following robconnolly’s detailed instruction, I managed to spin up the marytts docker. It kind of worked because I can log onto 192.168.1.8:59125 and there is a web page which I can press test button to test things out.

when I tried to actually use it in home assistant, I am a bit stuck.

I have an Alexa speaker, but i haven’t set up my HA for the Internet yet, and the whole point of using marytts is to cut the Internet dependency, no?

I have an old Sonos speaker which no one is using, ideally that is something I can use. But apparently the default lovelace widget is not working. i.e I can input a text, but nothing came out of it. but when i look at the config/tts directory, the wav_file is there.

Yes, I integrated marytts to the tts component to the configuration.yaml file. there isn’t much to it and I don’t think I made any mistake:

tts:
  - platform: marytts
    language: en_US
    host: 192.168.1.8
    port: 59125
    voice: 'cmu-slt-hsmm'

Any pointers will be much appreciated. thanks

The MaryTTS thing appears to be broken. I was previously using it with the browser_mod extension which created media players for connected browsers, but a change a few versions back broke it.

See https://github.com/home-assistant/core/issues/32142 and https://github.com/home-assistant/core/issues/31854 as open issues.

2 Likes

@kngharv I opened the GitHub issue 32142 linked above, and had started a forum thread here. There are a couple of ideas in that thread for ways to get around the MaryTTS issue, by using PicoTTS or editing a Python file. I can’t edit the Python file because I’m using HA Supervised. I’m hoping the MaryTTS issue gets fixed sooner or later.

Thanks for the pointer to that forum thread!

Thanks.

I actually looked at PicoTTS first before I wonder to MaryTTS.

PicoTTS require native libraries. Since I am using docker and using the official docker image, the only hack I can do is to create a new docker image with built-in PicoTTS in it. It is not hard to do, just that it is not sustainable in the long run.

Thanks for your answer. I guess I just have to wait, while may be try to build a new image myself. I am new to docker thing and it will take me a bit longer to figure it out.

Harv

I was able to make marytts work with two one line changes to the tts component and the marytts component. I wonder if both of these can be copied out as custom_components and modified to override the current versions? I left some notes in that first github issue I referenced a couple of comments back.

1 Like

Dear all:

I just created a home-assistant docker image with picotts built in in a x86_64 platform.

I simply pull the latest STABLE version of home assistant image (version 0.108.1) from docker hub, and added ONE SINGLE LINE:

apk add picotts --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing

I didn’t change anything else.

I use the default sonos widget on the default UI, and the TTS worked.

If you guys happened to use stable version of home assistant image on a x86-64bit platform, you are welcome to download the image and give it a try:

docker pull kngharv/home-assistant:picotts

It is not a long term solution. I am looking for a way to file a feature enhancement request so this change can make into the trunk.

Harv

I have filed a formal feature request to bake picotts native library into the home assistant docker image itself so all we have to do is add picotts into the configuration.yaml file and do nothing else.

By having such library built-in, home assistant will have a text-to-speech feature that doesn’t require any cloud services.

Since picotts is relatively small, mature, and already being ported to various different types of computers, it is relatively easy for the developer to do this.

If you want a off-line text-to-speech feature baked into home-assistant, please go to the website and vote for such feature to get developers’ attention:

Thanks in advance

Harv

2 Likes

Hi nice work, but it seems your link has been removed, could you please add them back? thank you.

The developer is completely ignoring the request despite that it’s just matter of adding one line to the dockerfile.

At this point I am not sure what to do.

I filed an issue at github and not getting anywhere.

And apparently I can’t really simply check out the docker file and add it myself neither.

So, I am kind of stuck. If any of you knows how to get attention to the developers, let me know.

If any of you knows what are proper ways to file feature enhancement to developers, please let me know. I run out of ideas.

Filing an isue on Github is the proper way to handle this. However, if the dev doesn’t want to do it, you’re out of luck. Either make a PR and see if this gets accepted or fork it and fix and maintain it yourself.

While I filed feature enhancement request at the forum here, I also filed a “bug” or feature enhancement at github.

https://github.com/home-assistant/docker/issues/114

What is PR? I want to see if I can somehow create one and ask the developer to merge it. But in order to google how to do this, I need to know what is PR stands for :smiley:

PR = pull request
You said it’s only one line that needs to be changed in the dockerfile, so do the change and make a pull request, so that it gets merged into the master branch. Here’s some info on how to do a PR.

1 Like

I did a pull request… my first pull request ever!

It turned out to be a lot more complicated than just a single line.

The main issue is that picotts library in the alpine repo was compiled against a newer version of libc library. The maintainer said that this would break the image (even though I’ve used it without problem myself. then again, my scope of use is rather limited).

The best course of action is actually compile picotts library from source using the stable version of libc library (musl).

I don’t know how to do that… not in alpine, nor do I really know how to spell the procedures in the Dockerfile. It’s not hard per se, it is just that I need to experiment them by trial and error. It will take a lot of time, as I am not a developer myself.

Assuming picotts can easily compiled against a stable version of musl, it would take an experience guy less than 20 minutes to incorporate the change. If any of you can do this, please do that.

I will poke around with it in the mean time. Don’t hold your breath for it.

5 Likes