Pipertts install (oh 4.3.0)

Hi, im using openhab 4.3.0 via and i have seen that it should be possible to to use pipertts. i used picotts before, but with pipertts i had not yet luck. (My 4.3.0 install is via docker on a raspi arm64-plattform)

what i did install:
RUN apt install pip --no-install-recommends
RUN pip3 install piper-tts --break-system-packages

then in Openhab i installed the add-on. And also i downloaded the speechfiles.
I also changed default Voice-engine to pipertts
Now the piper folder looks like:

ls -la piper
insgesamt 59856
drwxr-xr-x  3 9001 9001     4096 18. Dez 10:11 .
drwxr-xr-x 22 9001 9001     4096 18. Dez 09:49 ..
-rw-r--r--  1 root root    55144 18. Dez 10:11 de_DE-eva_k-x_low.onnx
-rw-r--r--  1 root root   283242 18. Dez 10:11 de_DE-eva_k-x_low.onnx.json
drwxr-xr-x  3 9001 9001     4096 18. Dez 09:50 lib-1.2.0-a0f09cd
-rw-r--r--  1 9001 9001 60930507 18. Dez 09:50 piper-jni-1.2.0-a0f09cd.jar

The binaries seems to be correctly installed testing them from commandline

docker exec -it openhab-openhab-1 piper
usage: piper [-h] -m MODEL [-c CONFIG] [-f OUTPUT_FILE] [-d OUTPUT_DIR] [--output-raw] [-s SPEAKER] [--length-scale LENGTH_SCALE] [--noise-scale NOISE_SCALE]
             [--noise-w NOISE_W] [--cuda] [--sentence-silence SENTENCE_SILENCE] [--data-dir DATA_DIR] [--download-dir DOWNLOAD_DIR] [--update-voices] [--debug]
piper: error: the following arguments are required: -m/--model

and in Karaf die engine is listed:

openhab> openhab:voice ttsservices                                                                                                                                                                                  
  Google Cloud (googletts)
  MaryTTS (marytts)
  PicoTTS (picotts)
* Piper (pipertts)
  VoiceRSS (voicerss)

In javascript i tried:

actions.Voice.say('hallo ich bin der test', 'pipertts:de_DE-eva_k-x_low', 'chromecast:chromecast:7c901df920');

But the result was only:

2024-12-18 11:47:57.025 [DEBUG] [ce.pipertts.internal.PiperTTSService] - Available number of piper voices: 0
2024-12-18 11:47:57.027 [WARN ] [core.voice.internal.VoiceManagerImpl] - Error saying 'hallo ich bin der test': No TTS service can be found for voice pipertts:de_DE-eva_k-x_low

from Doc “You should place both voice files at ‘<OPENHAB_USERDATA>/piper/’. After that the UI should display your available voices at ‘Settings / System Settings / Voice’.” but this is not working. There is no Voice listed starting with piper. Also not after restarting all. On karaf console they are also not listed.

So it would be nice if someone could give me a hint what else i have to do to enable this engine.

i filed an issue for that because from all my tryings i guess there is an issue in code

Hello,

I just tested piper on my freshly upgraded 4.3 version, and it works for me.
I even tested with your Eva voice, saying “Gutten morgen”. My kids were startled, they don’t seem to like german :rofl:
So if it’s a bug, it seems related to your configuration.

Did you restart the bundle (or openHAB) after adding the voice files ? Piper scan its data directory only at start.

Can you provide openHAB log when piper is starting ?
For example, when you start the piper bundle and there is an error with the loading of a voice file (I forgot the config file), you have this kind of log:
2024-12-23 15:48:43.985 [WARN ] [ce.pipertts.internal.PiperTTSService] - IOException reading voice info: Missed config file: /var/lib/openhab/piper/de_DE-eva_k-x_low.onnx.json

Hi Gwendal,
here is logfile of a start filtered by grep -i piper
piperstart.log (17.9 KB)
But i cannot see any try of loading the file.

Maybe that it could be an impact of that im using the dockerimage?

In documentation i got information to do the files into /openhab/userdata/piper/
On your entry you told about path /var/lib/openhab/piper
But this path is not existing in container. Also not path /var/lib/openhab.
Do i have to create them?
I did now an (inside container)

mkdir -p /var/lib/openhab/piper
root@dockerpi01:/openhab# cp -a /openhab/userdata/piper/de_DE-eva_k-x_low.onnx* /var/lib/openhab/piper

Then restarted openhab container

Viewed thre log, but no change. No line which tells that onnx or onnx.json file not found.

I use the debian package, and the storage location is not the same as with the docker image.
Your piper data directory is indeed /openhab/userdata/piper/ (you can see that the piper addon installed a lib and a jar alongside you onnx and json file, so the data location is not the issue here).

I forgot to tell you that you don’t have to install piper by yourself. The piper addon is a standalone, it embedds its own library.

I suggest you follow this github issue, it seems to be quite like yours. I already pinged the add-on creator on the thread, hopefully he will be able to help both of you.

ok, then im summarizing:

  • /openhab/userdata/piper/ is correct path
  • this was my first try installing piper. in the meantime, also with the restart and the logs i sent you piper is no more separately installed
  • the from you refferred github-issue i have seen but this finds 1 voice and i never had seen that 1 voiice appeard. yeah, would be nice if someone could help

After trying (with success) to use piper inside a docker container, and reading code piper to understand what could be wrong, I think I finally had an epiphany (great christmas timing) and found that you have an issue with your files !

-rw-r--r--  1 root root    55144 18. Dez 10:11 de_DE-eva_k-x_low.onnx
-rw-r--r--  1 root root   283242 18. Dez 10:11 de_DE-eva_k-x_low.onnx.json

→ completely messed up file size.
The json is probably not a json, and the onnx not a model.

Correct sizes should be:

-rw-r--r-- 1 openhab openhab 20628813 23 déc.  15:46 de_DE-eva_k-x_low.onnx
-rw-r--r-- 1 openhab openhab     4158 23 déc.  15:47 de_DE-eva_k-x_low.onnx.json

Hi Gwendal,
thank you very much for that hint. i downloaded them by wget but did not thought about that the given link was not for the raw file
Now im really a little bit further, but i still cannot share the experience to hear the voice of eva :wink:

2024-12-25 10:51:56.740 [DEBUG] [ce.pipertts.internal.PiperTTSService] - Available number of piper voices: 1
2024-12-25 10:51:56.746 [WARN ] [core.voice.internal.VoiceManagerImpl] - Error saying 'hallo ich bin der test': No TTS service can be found for voice pipertts:de_DE-eva_k-x_low

im adding here the complete log from pipeer after start. But i see no hints why the TTS cannot be found
logfrompiperafterredownload.log (20.2 KB)

Hi Gwendal,

i have good news. I logged into karaf to list the voices and there the voice has internally another name:

openhab> openhab:voice voices|grep Piper
* Piper - Deutsch (Deutschland) - Eva_k (pipertts:eva_k-de_DE)

So im very happy that it works now with testcommand

actions.Voice.say('hallo ich bin der test', 'pipertts:eva_k-de_DE', 'webaudio');

Thanks for your help and have all a merry christmas!

1 Like