# Home Assistant Satellite
Python-based satellite for [Assist](https://www.home-assistant.io/voice_control/) that streams audio to Home Assistant from a microphone.
You must have the [openWakeWord add-on](https://my.home-assistant.io/redirect/supervisor_addon/?addon=47701997_openwakeword&repository_url=https%3A%2F%2Fgithub.com%2Frhasspy%2Fhassio-addons) installed.
## Requirements
* Python 3.9 or higher
* ffmpeg
* libportaudio2 (for [sounddevice](https://python-sounddevice.readthedocs.io))
## Installation
Install Python and the required system dependencies:
``` sh
apt-get install python3 python3-pip python3-venv \
ffmpeg libportaudio2
```
Clone the repository and run the setup script:
``` sh
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.
1. Go to your profile page in Home Assistant
2. Scroll down to "Long-lived access tokens"
3. Click "Create token"
4. Enter a name and click "OK"
5. Copy the **entire token** using the copy button provided
6. Save the token somewhere you can paste from later
## Running
``` sh
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:
``` sh
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:
``` sh
python3 -m sounddevice
```
### Voice Activity Detection
Use `--vad webrtcvad` to only stream audio when speech is detected.
Make use of [silero VAD](https://github.com/snakers4/silero-vad/) with:
``` sh
.venv/bin/pip3 install -r requirements_extra.txt
```
and
``` sh
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>`.
Raw data
{
"_id": null,
"home_page": "http://github.com/synesthesiam/homeassistant-satellite",
"name": "homeassistant-satellite",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "voice satellite home assistant",
"author": "Michael Hansen",
"author_email": "mike@rhasspy.org",
"download_url": "",
"platform": null,
"description": "# Home Assistant Satellite\n\nPython-based satellite for [Assist](https://www.home-assistant.io/voice_control/) that streams audio to Home Assistant from a microphone.\n\nYou must have the [openWakeWord add-on](https://my.home-assistant.io/redirect/supervisor_addon/?addon=47701997_openwakeword&repository_url=https%3A%2F%2Fgithub.com%2Frhasspy%2Fhassio-addons) installed.\n\n\n## Requirements\n\n* Python 3.9 or higher\n* ffmpeg\n* libportaudio2 (for [sounddevice](https://python-sounddevice.readthedocs.io))\n\n\n## Installation\n\nInstall Python and the required system dependencies:\n\n``` sh\napt-get install python3 python3-pip python3-venv \\\n ffmpeg libportaudio2\n```\n\nClone the repository and run the setup script:\n\n``` sh\ngit clone https://github.com/synesthesiam/homeassistant-satellite.git\ncd homeassistant-satellite\nscript/setup\n```\n\nThis will create a virtual environment and install the package.\n\n## Long-Lived Access Token\n\nYou must create a long-lived access token in Home Assistant for the satellite to access the websocket API.\n\n1. Go to your profile page in Home Assistant\n2. Scroll down to \"Long-lived access tokens\"\n3. Click \"Create token\"\n4. Enter a name and click \"OK\"\n5. Copy the **entire token** using the copy button provided\n6. Save the token somewhere you can paste from later\n\n\n## Running\n\n``` sh\nscript/run --host <IP> --token <TOKEN>\n```\n\nwhere `<IP>` is the IP address of your Home Assistant server and `<TOKEN>` is the long-lived access token.\n\nThis will stream audio from the default microphone to your preferred pipeline in Home Assistant.\n\nSee `--help` for more options\n\n### Feedback Sounds\n\nUse `--awake-sound <WAV>` and `--done-sound <WAV>` to play sounds when the wake word is detected and when a voice command is finished.\n\nFor example:\n\n``` sh\nscript/run ... --awake-sound sounds/awake.wav --done.wav sounds/done.wav\n```\n\n### Change Microphone/Speaker\n\nUse `--mic-device <NUMBER>` and `--snd-device <NUMBER>` to change the microphone and speaker. Get a list of devices with:\n\n``` sh\npython3 -m sounddevice\n```\n\n### Voice Activity Detection\n\nUse `--vad webrtcvad` to only stream audio when speech is detected.\n\nMake use of [silero VAD](https://github.com/snakers4/silero-vad/) with:\n\n``` sh\n.venv/bin/pip3 install -r requirements_extra.txt\n```\n\nand\n\n``` sh\nscript/run ... --vad silero\n```\n\n### Audio Enhancements\n\nUse `--noise-suppression <NS>` suppress background noise, such as fans (0-4 with 4 being max suppression, default: 0).\n\nUse`--auto-gain <AG>` to automatically increase the microphone volume (0-31 with 31 being the loudest, default: 0).\n\nUse`--volume-multiplier <VM>` to multiply volume by `<VM>` so 2.0 would be twice as loud (default: 1.0).\n\n\n## Troubleshooting\n\nAdd `--debug` to get more information about the messages being exchanged with Home Assistant.\n\nAdd `--debug-recording-dir <DIR>` to save recorded audio to a directory `<DIR>`.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Voice satellite for Home Assistant",
"version": "1.1.0",
"project_urls": {
"Homepage": "http://github.com/synesthesiam/homeassistant-satellite"
},
"split_keywords": [
"voice",
"satellite",
"home",
"assistant"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d6d49bfdcb68ce22031bf406073e2c9a4fc97a344ecd6a773bd75ebcf871cc3c",
"md5": "e7e615a8299dbec5458922c7374e7102",
"sha256": "26f75a1d57f81dfca6ba5755c347767dd3345e65e3c92c46febe7ed2c4bf22cf"
},
"downloads": -1,
"filename": "homeassistant_satellite-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e7e615a8299dbec5458922c7374e7102",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 1527341,
"upload_time": "2023-09-28T21:47:35",
"upload_time_iso_8601": "2023-09-28T21:47:35.585396Z",
"url": "https://files.pythonhosted.org/packages/d6/d4/9bfdcb68ce22031bf406073e2c9a4fc97a344ecd6a773bd75ebcf871cc3c/homeassistant_satellite-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-28 21:47:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "synesthesiam",
"github_project": "homeassistant-satellite",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "homeassistant-satellite"
}