We’ve all heard of them, they come in different flavours – Alexa, Google, Siri etc. They are pretty useful things most of the time, like all tech they can have issues but are generally fairly reliable and successful at voice recognition.
They all have one thing at least in common – they rely totally on on a massive server running in some remote building to process the voice commands we make. This is pretty safe but for some, one part of home automation is to do everything inside the home, this means no external servers in China etc just to turn a light on. Until fairly recently a workable offline voice assistant was pretty much impossible, it just needed too much processing etc to turn a voice command into text or action like turning a light off.
I recently started playing with a project called “Rhasspy” – its an open-source voice assistant project that can be run on a Raspberry Pi and will connect to smart home controllers like Home Assistant. Getting it up and running was a nightmare as it is fairly advance Linux/Pi stuff but I managed it in the end. The Pi has a small add-on called a “microphone hat” – this gives the Pi a sound input and also an output that will connect to a small loudspeaker – the Pi now has a voice, well there are a lot of voices to choose from.
It’s still being set up – it takes some tuning, but early results are very promising and it will respond almost as well as Alexa to home automation commands, not bad for a tiny computer like a Pi. It will probably never be able to search the internet like Alexa can as that will just take too much work and it also breaks the “offline” rule – not much point making an offline voice assistant go online.
I have slowly been working on the flows and commands in Node Red to enable it to connect to Home Assistant – this is the most fascinating part and really gives an insight into just what Alexa is really having to do in the background when you want a light turned on! A small part of my flow is shown below, it’s all experimental at present but getting to point where I can actually use it now.
In use, there is a two-way communication between the device and Node-Red, it starts with a wake-word, then an intent recognition, followed by an acknowledgement and finally a termination. It’s fast, and pretty accurate but I doubt it will give the professionals a run for their money, after all they invested millions in development and hardware whereas this project is running on a cheap Raspberry Pi and doing it all itself 🙂