Fully Local TTS with a Raspberry PI (Voice Control coming...)

This custom driver can be used to control a RPI (or other Linux device) on your network.
It has been developed in a completely generalized way, so that any Linux command may be executed on this device.
Please see the description for how this driver (and the accompanying Linux code) was actually used to implement a local TTS device, at a very reasonable cost.

This was developed by @erktrek and all the kudos should go to him.
This was tested extensively by @aaiyar who assisted in the development.

It will be added at a subsequent date to HPM, but nonetheless it may be used directly via the following:

https://raw.githubusercontent.com/adsavia/notifyExec/main/HubitatDriver/notifyExec.groovy

and the github repo:

GitHub

GITHUB - ADSAVIA/NOTIFYEXEC: SIMPLE VIRTUAL NOTIFICATION DRIVER IN HE THAT...

Simple virtual notification driver in HE that communicates with a backend NodeJS app that executes a configured utility. - GitHub - adsavia/notifyExec: Simple virtual notification driver in HE that...

The first application of this approach was used to create a email/sms text sending device, via the linux command for sendfile.
Recently, I have used this approach to attach a simple usb speaker to turn this into a local TTS speaker. I have used a speakerphone/microphone (similar to what has been used in conference rooms). This will enable the hardware that will eventually ensure that this can be used for local voice control, as well as voice notification. Furthermore, we have tested this local TTS approach with a Raspberry Pi Zero 2W (approx. $15), and wifi, which should ensure a low cost. It should be noted that the speaker quality will vary dramatically depending on the hardware that is chosen.

Of course, the speaker quality of an Alexa Dot or a Google Home Mini is far superior (and offers voice access to the Internet), but the key here is that the speaker quality can be more than adequate, and is a very acceptable local TTS speaker.

Please let us know of any suggestions and/or comments.

Please stay tuned, for a future integration which will enable Hubitat voice control from this hardware/software setup.

6 Likes

What do you plan to use for voice control software wise? Almond?

We are investigating Mycroft and Rhappsy

1 Like

Very cool!

I thought I heard you guys sneaking around... :wink:

Excellent progress on the path to local voice control...you guys deserve a cookie (or two) and maybe even (gasp!) a Root Beer float. Yes, it's that cool. :smiley:

3 Likes

Do you guys have code examples for the TTS/push applications? I'm still a bit unclear as to how this works.

The NodeJS application runs as a service on the RPi (or equivalent).
The Hubitat driver is for a notification device that can talk to the NodeJS application.

When the notification device is used, text is sent to the NodeJS app, which then execs eSpeak to convert the text to a wav file that is played on an attached speaker, or can be sent to another speaker.

Thanks. So if we want to implement multiple services on the same pi how would we differentiate between them? I have not installed the driver to play around yet.

1 Like

This is a great question - and I actually use two instances of very similar NodeJs apps.

You can bind each NodeJs app to a distinct port and configure the driver for each device accordingly.

1 Like

Got it, so we just install/run the same node app with different names like app1.js etc

I agree this would be great for cheap remote local TTS notifications although finding a pi zero 2W at RRP will prove challenging. An older pi zero should work just as well. And if you have a non W zero you can still use this by soldering the guts of a cheap USB wifi adapter to the usb port traces.

BTW espeak sounds like 90s TTS (if you like robot voices that is). How about Festival or Pico or even the TTS built into Rhappsy?

One last thing - if you use node red this functionality is already there, right? I would love to hear of other applications like TTS tho.

No, it isn’t. But I guess you could use a shell command …

1 Like