A Wyoming Satellite Voice Assistant to Control my Home Assistant Smart Home and Play my favourite songs. Go Local be Secure

My journey with Home Automation started with a Sonoff smart switch for switching on and off a light remotely. One thing led to another as I started automating things in my new home after my relocation. Initially it was ESP 2866 with arduino IDE and few other readymade devices like smart bulbs, fan regulators etc. As it scaled up I realised that having many apps to control disparate devices was bound to become tedious in future. A colleague of mine had gifted me a raspberry pi 3B and it was lying idle, waiting for me to decide on a Smart Home system. I started my hunt and tried Domoticz, openHAB, Home Assistant all open source as I am a big fan of open source stuff. After a lot of deliberation and testing I decided to go with Home Assistant. I now have about 35 devices on my system including Bosch dish washer, Deebot Robotic Vacuum Cleaner, Washer notification, Blind Automation , a few Esphome devices. My user interfaces are dashboards, mobile app, apple watch and last but not least Voice Assistant. Currently I use alexa as a Voice Assistant and for tts messages.
Come 2023 and Home Assistant announces the 2023 as the Year of the Voice. The promise of a Local Voice Assistant was tempting and I decided to go local. It wasn’t going to be easy. I first experimented with the esp32 esphome VA code with a INMP441 mic and MAX98357 DAC amplifier and the results were not encouraging. It was then that I landed on the Wyoming Satellite Project by the Voice Guy at Nabu Casa Mike Hansen and enhanced by Brad@futureproofhomes and implementation on a pi zero 2 W with a 2 mic HAT by illius. So I dedicate my project to these three guys and anyone who has contributed to the Voice Assistant effort. I also thank the great guys at Nabu Casa for Home Assistant System.
Project Details:
Hardware:

  1. Raspberry Pi Zero 2 W
  2. 32 Gb SD Card
  3. SeeedStudio Respeaker 2 Mic HAT
  4. 4 ohms 2 W speaker with JST connector
  5. A DIY enclosure made of Birch Wood Plywood.

Software:

  1. Raspberry Pi OS lite ( Legacy 64-bit)
  2. Wyoming Satellite package
  3. Seeedstudio Respeaker 2 Mic HAT Drivers
  4. Pulse Audio package
  5. Snapcast server and client package
  6. Music Assistant Add-on

Installation:

  1. The first step was to solder the headers on the RPi Zero 2 W. Not an easy task for a 64 yr oldie😀. Snapped the Respeaker 2 mic hat onto the Pi Zero.
  1. Burning the Raspberry Pi OS lite (Legacy 64-bit) image on the SD Card
  1. Install the Wyoming Satellite package and drivers for the Respeaker 2mic HAT. Test the mic and speaker using aplay and arecord. Just followed the tutorial by llluis and installation was a breeze
  1. FutureProofHomes tutorial enthused me to push further and transform my PVA into a Voice Assisted Media Player also. Installed Pulseaudio, Snapcast Server add-on on HA Server and Client on RPi Zero . Also installed the wonderful extended OpenAI conversation integration and Music Assistant on HA. Did all the configuration as given in the tutorial. Works well though I need do a few tweaks.

Planning to make a Wooden enclosure. Still working out the design and thinking of adding a battery to make it portable to carry around the house.
Made some progress and prototyped an enclosure for the PVA with cardboard. A quick look at it.


In action:

TODO:

  1. Convert prototype enclosure to Wooden Enclosure



  1. Safe Shutdown Switch
    Configured the button on the Respeaker HAT Corresponding to GPIO17. Used dtoverlay=gpio-shutdown,gpio_pin=17 in config.txt
  1. Battery Backup.
  2. The Rpi Zero 2W runs hot(65 C). Wrote a script to monitor the temperature in HA. Looks like I need to add a small cooling fan inside. Phew… the list is getting long. Target 10th Mar 2024

Ive found that putting the detection and tts stop commands just under the wake URI line solved an issue I was having with the volume not staying low during the whole time the assistant is speaking.
Also, I put the sounds just under the wake word name line. This gives the audio cue at the same time as the led cue. Maybe just before. Before, the led would happen first and the first word of my commands would get cut off.

1 Like

Never thought that the sequence would matter much. Kept adding them as per the tutorial. Will try your suggestion and see how it goes. Thanks for the same.

Here is my config. Lots of experimenting…
I added the error command. The issue I was having is that when music was playing, and the wake word was detected when no wake word was said, it wouldnt resume the music at the starting volume. You can test this by saying your wake word and keeping quiet. After a few seconds it will time out but the music volume wont go back up. The error command fixed that.

[Unit]
Description=Wyoming Satellite
Wants=network-online.target
After=network-online.target
Requires=wyoming-openwakeword.service
Requires=2mic_leds.service
Requires=pulseaudio.service
[Service]
Type=simple
ExecStart=/home/livingroomsatellite/wyoming-satellite/script/run \
    --name 'Living Room Satellite' \
    --uri 'tcp://0.0.0.0:10700' \
    --mic-auto-gain 5 \
    --mic-noise-suppression 2 \
    --mic-command 'parecord --property=media.role=phone --rate=16000 --channels=1 --format=s16le --raw --latency-msec 10' \
    --snd-command-rate 44100 \
    --snd-volume-multiplier 0.1 \
    --snd-command 'paplay --property=media.role=announce --rate=44100 --channels=1 --format=s16le --raw --latency-msec 10' \
    --wake-uri 'tcp://127.0.0.1:10400' \
    --detection-command '/home/livingroomsatellite/wyoming-enhancements/snapcast/scripts/awake.sh' \
    --tts-stop-command '/home/livingroomsatellite/wyoming-enhancements/snapcast/scripts/done.sh' \
    --error-command '/home/livingroomsatellite/wyoming-enhancements/snapcast/scripts/done.sh' \
    --vad-trigger-level 2 \
    --vad-threshold 0.9 \
    --wake-word-name 'dimerzel' \
    --awake-wav sounds/awake.wav \
    --done-wav sounds/done.wav \
    --event-uri 'tcp://127.0.0.1:10500'
WorkingDirectory=/home/livingroomsatellite/wyoming-satellite
Restart=always
RestartSec=1

[Install]
WantedBy=default.target
1 Like

Do you need VAD settings if your are using local
Wakeword detection? Still let me try it out as I still get false wakeword detection.

Im pretty sure its making a difference. Still assessing.

Im not entirely convinced the VAD settings are doing anything. I cant seem tio find an answer on this…
The open wake word integration has these settings, it would seem the satellites would also…

How to shutdown the satellite? Through SSH or have you configured a shutdown switch using GPIO3 or any other GPIO

Just SSH. The ones I have built are either already, or planning to be in the ceiling.

1 Like

Mine would be table top. I just tried the button on the respeaker HAT button corresponding to GPIO17 and it works only for shutdown. I have to repower it to boot. Used dtoverlay=gpio-shutdown,gpio_pin=17

I don’t believe the vad settings do anything without also passing in --vad. Also though, VAD is not supported with a local openWakeWord, if I recall correctly about the error I had when I tried enabling vad

1 Like

Thanks. I wound up re-training my custom wake word and it seems to have helped alot. Even though the one I was using was well trained…
My original I had the first 2 sliders set at 50,000 and left the false_activation_penalty alone.
This time I set the false_activation_penalty to 2650.
I loaded it this morning and I dont think I have had any false triggers yet with a TV /radio playing all day.

Sounds like I might need to train my own wake word. I am using the built in “Alexa” but it triggers on the sounds of rain sometimes. I tried using “Ok Nabu” but it was triggering randomly, but wouldn’t trigger when I said it.

Edit: Right after clicking “Send”, it triggered on a sigh…

Itll cost a couple bucks but probably worth it in the long run.
2650 was a little aggressive. Its hard to trigger when there is background noise.Gonna split the difference between default and 2650.

First 2 sliders at 50,000 and the false_activation_penalty set at 2000 is working really well. No false activations in the past couple hours and responds well even with the tv playing.

Does the RPi zero 2w with Respeaker 2 mic HAT heat up in your satellite. Mine heats upto 65-66 C in an ambient temperature of 32C. Since I am planning to put it into a wooden enclosure looks like I gotta add a small cooling fan in it.

Yes, it gets quite warm when playing music.
The one I put in the loft ceiling I had put a box over the enclosure to keep the blow in insulation out of it. That one would play about 10 minutes before shutting down due to heat. I put an exhaust stack in the box and it fixed it up.

How do you change the volume of the satellite , both piper output and music assistant output? snd-volume-multiplier is not convenient and cannot be done on the fly. Unless you follow the enhancement by futureproofhomes.

For Music assistant youll have a volume slider.
I just adjusted my amplifier violume to where I like the voice assistant.
I purchased this since I have the voice assistant sharing speakers with my surround system. I alos have a chromecast for TTS announcements. I can adjust the volume of all 3 with this.
https://www.amazon.com/gp/product/B09XH3WPXR?ref=ppx_pt2_dt_b_prod_image

Hi Rich37804, can I ask how you managed to configure custom wake words to work? I’ve been going around in circles.

I have added in what I understand to me the service config requirements, and saved the custom wake word to the corresponding directory, but to no alas.

Cheers, A