Hi Everyone,
UPDATE new installation here: https://rhasspy.readthedocs.io/en/latest/installation/
Leaving this up for posterity:
So I had everything working in my house for a few weeks so figured I needed to break things and create mayhem again lol.
I started looking a this, a local offline voice assistant.
General objective was to replicate the Alexa ‘mesh’ in my house, but offline. I wanted a simple set up with 2 components:
- Server Element running on my NUC (I use docker) that also runs HA, MQTT etc.
- Client Element that offered wake word, voice detection and speech-to-text
- Note I do NOT use TTS as i have sonos in the rooms I need a reply for now (I may add a speaker later and update)
Rhasspy did NOT disappoint! It was easy and I was up and running in 10 minutes (YMMV based on environment, docker REALLY helped though!). Don’t be put off by the extensive docs, getting up and running was very straight forward. Once set up you can then play with the config to suit your needs.
HTH…
Hardware set up involved components laying around:
Seeed pi 4 Mic array
8Gb Micro SD Card
Raspberry Pi 3B
Server Side Steps:
- Assuming you already have docker running, create a directory for rhasspy, and sub folder called profiles.
- Pull and Run docker image:
docker run -p 12101:12101 \
--restart unless-stopped \
--name rhasspy \
-v "/<PATH_TO>/rhasspy/profiles:/profiles" \
synesthesiam/rhasspy-server:latest \
--user-profiles /profiles \
--profile en
- Goto server URL
http://<Server_IP>:12101
(you may be asked to download files) - Goto settings and check config (and save along the way):
[Rhasspy]
Listen for wake word on Startup = UNchecked
[Home Assistant]
Do not use Home Assistant (note you obviously can instead of Node-Red)
[Wake Word]
No Wake word on this device
[Voice Detection]
No voice communication on this device
[Speech Recognition]
Do Speech recognition with pocketsphinx
[Intent Recognition]
Do intent recognition with fuzzywuzzy
[Text to Speech]
No Text to speech on this device
[Audio Recording]
No recording on this device
[Audio Playing]
No Playback on this device
- Check Slots, and Sentences tabs and make sure to hit
Train
and thenRestart
Client Side Steps:
- Flash 8Gb MicroSD Card with Buster with Etcher.
- Remove and re-insert MicroSD card and add files to the root directory(for headless setup - meaning no screen needed). You only need (b) below if you plan to use WiFi.
a) a file simply called ‘ssh’
b) wpa_supplicant.conf (example here) - Insert the MicroSD card in the Pi, use a proper Power Supply and check your router for the IP address it gets.
- SSH into the Pi using that IP address (I use Putty) using pi default user/pass = pi/raspberry.
You are going to want to change that in the future! - Install git:
sudo apt install git
- Install Seeed mic array based on info here
git clone https://github.com/respeaker/seeed-voicecard
cd seeed-voicecard
sudo ./install.sh
sudo reboot
- Plug in Seeed speaker and check install was successful against expected result here:
arecord -L
- install docker:
curl -sSL https://get.docker.com | sh
- modify user permissions to access docker without using ‘sudo’ all the time
sudo usermod -a -G docker pi
- Close SSH, and relaunch SSH connection to use new permissions.
- Create directories for Rhasspy Docker image to use:
cd ~
mkdir rhasspy
cd rhasspy
mkdir profiles
- Pull and run docker image:
docker run -p 12101:12101 \
--restart unless-stopped \
--name rhasspy \
-v "/home/pi/rhasspy/profiles:/profiles" \
--device /dev/snd:/dev/snd \
synesthesiam/rhasspy-server:latest \
--user-profiles /profiles \
--profile en
- Goto Client URL
http://<Pi_IP_address>:12101
(you will be asked to download some files)
(At time of writing I put Wakeword, voice detection and recognition on the client) - Under settings ensure the following is selected, Save along the way. You will need to Train once also.
[Rhasspy]
Listen for wake word on Startup = checked
[Home Assistant]
Do not use Home Assistant (note you obviously can instead of Node-Red)
[Wake Word]
Use snowboy (this should trigger a download of more files)
[Voice Detection]
Use webrtcvad and listen for silence
[Speech Recognition]
Use Remote Rhasspy server for speech recognition:
URL = http://<SERVER_IP>:12101/api/speech-to-text
[Intent Recognition]
Use Remote Rhasspy server for speech recognition:
URL = http://<SERVER_IP>:12101/api/text-to-intent
[Text to Speech]
No Text to speech on this device
[Audio Recording]
Use PyAudio (default)
Input Device = seeed-4mic-voicecard
(you can test this if you want)
[Audio Playing]
No Playback on this device
Node-Red Config
1.Import this flow from the Rhasspy examples
2. Attach a debug node to the websocket in
and configure it to show full msg object.
3. I edited light text
node to take this:
{
"domain": "light",
"service": "turn_{{slots.state}}",
"entity_id": "{{slots.name}}"
}
- Add a call service node after the light text and leave it blank. Deploy and Enjoy offline voice assistant.
Pick a light (that is a light domain not a switch, and say “Snowboy, turn bedroom light off”