I use home assistant to manage the power on my dumb TV, my dumb air conditioner, and my smart light bulbs. I want to be able to control them with a voice UI, but have been trying to get rid of Alexa and Google devices and replace them with something local.
I had Mycroft AI running for a while but since the company has gone defunct I've been trying to migrate over to OpenVoiceOS. There are definitely growing pains and unfortunately I haven't been able to contribute much to the project. I'm writing this to remind myself what I do to get a Raspberry Pi 4 working.
First I grab the raspberry pi image from https://www.openvoiceos.org/downloads. Then I use Raspberry Pi Imager (brew install --cask raspberry-pi-imager) to write the unzipped image to an SD card. Then I plug the SD card and my USB speakerphone into the raspberry pi and boot it up.
Raspberry Pi Imager lets me enter my SSH key, username, hostname, and wifi password which is very helpful. After standing up the machine I also install a few useful programs (sudo apt install vim tmux mosh silversearcher-ag).
The first step is to make sure I have the audio sinks and sources set correctly. For some reason it always defaults to my headphone jack rather than the USB speakerphone. There's a fancy way to do this with /etc/asound.conf but I forgot it, so for now I've been doing the following commands:
pactl list short sources # read the output of this command to determine the argument for the next command
pactl set-default-source alsa_output.usb-0b0e_Jabra_SPEAK_410_USB_50C2ED12E97Ax011200-00.analog-stereo.monitor
pactl list short sinks # again read the output to figure out the next argument
pactl set-default-sink alsa_output.usb-0b0e_Jabra_SPEAK_410_USB_50C2ED12E97Ax011200-00.analog-stereo
For whatever reason, audio, text to speech, and speech to text NEVER work for me on a clean install. So I've been iterating on the contents of my config file. The config file lives at ~/.config/mycroft/mycroft.conf and here's what mine looks like by default:
{
"log_level": "INFO"
}
I add the following two stanzas which I say again are a work in progress, I'm not sure if these are right
"stt": {
"module": "ovos-stt-plugin-server",
"ovos-stt-plugin-server": {
"url": [
"https://fasterwhisper.ziggyai.online/stt",
"https://stt.smartgic.io/fasterwhisper",
"https://stt.smartgic.io/chromium",
"https://stt.smartgic.io/nemo",
"https://nemo.neonaialpha.com"
]
},
"verify_ssl": true
},
"tts": {
"module": "ovos-tts-plugin-server",
"ovos-tts-plugin-server": {
"host": [
"https://tts.smartgic.io/mimic3",
"https://mimic3.ziggyai.online",
"https://coqui.neonaiservices.com",
"https://coqui.neonaialpha.com",
"https://coqui.neonaibeta.com",
"https://tts.smartgic.io/piper",
"https://pipertts.ziggyai.online",
"https://tts.smartgic.io/sam",
"https://tts.smartgic.io/mimic"
],
"v2": false,
"verify_ssl": true,
"tts_timeout": 5
}
}
I got this by messing around with the documentation for TTS and STT. The docs are CONFUSING because the server URLs are links to the status page, so if you "Copy link address" it will copy the wrong URL.
There's a way to customize the accent and gender of the voice, or at least there was, but I can't figure it out. I think the docs have gone 404, assuming https://openvoiceos.github.io/community-docs is the correct URL. However, the technical manual still has lots of info like the above two links.
The github repos for TTS and STT are also useful.
As you can see above, I am 90% sure that the "v2" param just doesn't work so I am setting it to false.
I plan eventually to run local servers but for now I'm using the public ones to get started.
For viewing the logs, there used to be a great CLI client but for now I'm using
tail -f /ramdisk/mycroft/*.log
Sometimes the listener process crashes, so I've been running
systemctl --user restart ovos-dinkum-listener
There are more services that could crash and need a restart but I haven't needed to recently. Here's the list if you're curious:
(.venv) ovos@DevmyB:~ $ ls /etc/systemd/user
ovos-admin-phal.service ovos-dinkum-listener.service ovos-messagebus.service ovos-pulseaudio.service ovos-skills.service
ovos-audio.service ovos-ggwave-listener.service ovos-phal.service ovos.service sockets.target.wants
Finally, home assistant. You need to add an abstraction layer to connect to home assistant, and the skill to interact with the actual voice UI. Install the two packages like so:
pip install git+https://github.com/OpenVoiceOS/ovos-PHAL-plugin-homeassistant
pip install git+https://github.com/mikejgray/neon-homeassistant-skill
And then add the stanza to .config/mycroft/mycroft.conf:
"PHAL": {
"ovos-PHAL-plugin-homeassistant": {
"host": "https://my-homeassistant-url.devinhoward.ca",
"api_key": "eyJhbGciO...Yc8xZqrZJYDzmsQFX1eSNFoFNFkU"
}
},
I got the api key by going to the home assistant dashboard, clicking on my username (I know, very confusing), and scrolling down to "Long lived tokens". There I can generate one token per raspberry pi.
I will continue reviewing "ovos-config show" output to see different config flags to play with.