Voice satellite for Home Assistant
Project description
Home Assistant Satellite
Python-based satellite for Assist that streams audio to Home Assistant from a microphone.
You must have the openWakeWord add-on installed.
Requirements
- Python 3.9 or higher
- ffmpeg
- libportaudio2 (for sounddevice)
Installation
Install Python and the required system dependencies:
apt-get install python3 python3-pip python3-venv \
ffmpeg libportaudio2
Clone the repository and run the setup script:
git clone https://github.com/synesthesiam/homeassistant-satellite.git
cd homeassistant-satellite
script/setup
This will create a virtual environment and install the package.
Long-Lived Access Token
You must create a long-lived access token in Home Assistant for the satellite to access the websocket API.
- Go to your profile page in Home Assistant
- Scroll down to "Long-lived access tokens"
- Click "Create token"
- Enter a name and click "OK"
- Copy the entire token using the copy button provided
- Save the token somewhere you can paste from later
Running
script/run --host <IP> --token <TOKEN>
where <IP>
is the IP address of your Home Assistant server and <TOKEN>
is the long-lived access token.
This will stream audio from the default microphone to your preferred pipeline in Home Assistant.
See --help
for more options
Feedback Sounds
Use --awake-sound <WAV>
and --done-sound <WAV>
to play sounds when the wake word is detected and when a voice command is finished.
For example:
script/run ... --awake-sound sounds/awake.wav --done.wav sounds/done.wav
Change Microphone/Speaker
Use --mic-device <NUMBER>
and --snd-device <NUMBER>
to change the microphone and speaker. Get a list of devices with:
python3 -m sounddevice
Voice Activity Detection
Use --vad webrtcvad
to only stream audio when speech is detected.
Make use of silero VAD with:
.venv/bin/pip3 install -r requirements_extra.txt
and
script/run ... --vad silero
Audio Enhancements
Use --noise-suppression <NS>
suppress background noise, such as fans (0-4 with 4 being max suppression, default: 0).
Use--auto-gain <AG>
to automatically increase the microphone volume (0-31 with 31 being the loudest, default: 0).
Use--volume-multiplier <VM>
to multiply volume by <VM>
so 2.0 would be twice as loud (default: 1.0).
Troubleshooting
Add --debug
to get more information about the messages being exchanged with Home Assistant.
Add --debug-recording-dir <DIR>
to save recorded audio to a directory <DIR>
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for homeassistant_satellite-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26f75a1d57f81dfca6ba5755c347767dd3345e65e3c92c46febe7ed2c4bf22cf |
|
MD5 | e7e615a8299dbec5458922c7374e7102 |
|
BLAKE2b-256 | d6d49bfdcb68ce22031bf406073e2c9a4fc97a344ecd6a773bd75ebcf871cc3c |