Desmond-Dong's picture
docs: update README to emphasize automated installation
23c71b8
|
Raw
History Blame
7.79 kB
metadata
title: Reachy Mini Home Assistant Voice Assistant
emoji: πŸ€–
colorFrom: blue
colorTo: purple
sdk: static
pinned: false

Reachy Mini Home Assistant Voice Assistant

A voice assistant application that runs on Reachy Mini robot and integrates with Home Assistant via the ESPHome protocol.

Note: This application runs directly on the Reachy Mini robot (Raspberry Pi 4), not on Hugging Face Spaces. The Hugging Face Space is used for code hosting and documentation only.

Features

  • 🎀 Offline Wake Word Detection: Uses microWakeWord or openWakeWord for local wake word detection
  • πŸ”„ ESPHome Integration: Seamlessly integrates with Home Assistant through ESPHome protocol
  • πŸ€– Motion Control: Full control over Reachy Mini's head movements and antenna animations
  • ⚑ Low Latency: Optimized for real-time voice interaction
  • 🎭 Expressive: Speech-reactive motions and gestures

Architecture

This project is based on OHF-Voice/linux-voice-assistant and adapted for Reachy Mini robot.

Key Design:

  • STT (Speech-to-Text) and TTS (Text-to-Speech) are handled by Home Assistant
  • Audio streams are transmitted via ESPHome protocol
  • Wake word detection is processed locally on the robot
  • Motion control enhances the voice interaction experience

Installation

Prerequisites

  • Python 3.8 or higher
  • Reachy Mini robot
  • Home Assistant with ESPHome integration

Quick Installation (Recommended)

# Clone the repository
git clone https://github.com/yourusername/reachy_mini_ha_voice.git
cd reachy_mini_ha_voice

# Run the automated installation script
# For Linux/Mac:
./install.sh

# For Windows:
powershell -ExecutionPolicy Bypass -File install.ps1

The automated installation script will:

  • βœ“ Check Python version
  • βœ“ Create virtual environment
  • βœ“ Install all dependencies
  • βœ“ Download wake word models and sound effects
  • βœ“ Create configuration file
  • βœ“ Check Reachy Mini SDK installation
  • βœ“ Check audio devices

Manual Installation

# Clone the repository
git clone https://github.com/yourusername/reachy_mini_ha_voice.git
cd reachy_mini_ha_voice

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -e .

# Download wake word models and sound effects
# For Linux/Mac:
./download_models.sh

# For Windows:
powershell -ExecutionPolicy Bypass -File download_models.ps1

# Copy environment template
cp .env.example .env

# Configure your settings
# Edit .env file with your preferences

Usage

Basic Usage

# Start the voice assistant
python -m reachy_mini_ha_voice

# With custom configuration
python -m reachy_mini_ha_voice \
  --name "My Reachy Mini" \
  --audio-input-device "Microphone Name" \
  --audio-output-device "Speaker Name" \
  --wake-model okay_nabu

List Audio Devices

# List available input devices
python -m reachy_mini_ha_voice --list-input-devices

# List available output devices
python -m reachy_mini_ha_voice --list-output-devices

Web UI

# Start with Gradio web interface
python -m reachy_mini_ha_voice --gradio

Wireless Version

# For wireless Reachy Mini
python -m reachy_mini_ha_voice --wireless

Configuration

Environment Variables

Create a .env file (copy from .env.example):

# Audio Configuration
AUDIO_INPUT_DEVICE=
AUDIO_OUTPUT_DEVICE=
AUDIO_SAMPLE_RATE=16000
AUDIO_CHANNELS=1
AUDIO_BLOCK_SIZE=1024

# Voice Configuration
WAKE_WORD=okay_nabu
WAKE_WORD_DIR=wakewords

# Motion Configuration
MOTION_ENABLED=true
SPEECH_REACTIVE=true

# ESPHome Configuration
ESPHOME_HOST=0.0.0.0
ESPHOME_PORT=6053
ESPHOME_NAME=Reachy Mini

# Robot Configuration
ROBOT_HOST=localhost
ROBOT_WIRELESS=false

# Logging
LOG_LEVEL=INFO

Configuration File

You can also use a config.json file:

{
  "audio": {
    "input_device": null,
    "output_device": null,
    "sample_rate": 16000,
    "channels": 1,
    "block_size": 1024
  },
  "voice": {
    "wake_word": "okay_nabu",
    "wake_word_dirs": ["wakewords"]
  },
  "motion": {
    "enabled": true,
    "speech_reactive": true
  },
  "esphome": {
    "host": "0.0.0.0",
    "port": 6053,
    "name": "Reachy Mini"
  },
  "robot": {
    "host": "localhost",
    "wireless": false
  }
}

Home Assistant Integration

Step 1: Add ESPHome Integration

  1. Go to Home Assistant β†’ Settings β†’ Devices & Services
  2. Click "Add Integration"
  3. Search for "ESPHome"
  4. Click "Set up another instance of ESPHome"
  5. Enter your Reachy Mini's IP address and port (default: 6053)
  6. Click "Submit"

Step 2: Configure Voice Assistant

Home Assistant should automatically detect the voice assistant. You can then:

  • Set up voice commands
  • Create automations
  • Configure STT/TTS services

Step 3: Test

  1. Say the wake word (default: "Okay Nabu")
  2. Speak your command
  3. Reachy Mini should respond with motion and voice

Project Structure

reachy_mini_ha_voice/
β”œβ”€β”€ src/
β”‚   └── reachy_mini_ha_voice/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ main.py              # Entry point
β”‚       β”œβ”€β”€ app.py               # Main application
β”‚       β”œβ”€β”€ state.py             # State management
β”‚       β”œβ”€β”€ audio/               # Audio processing
β”‚       β”‚   β”œβ”€β”€ adapter.py       # Audio device adapter
β”‚       β”‚   └── processor.py     # Audio processor
β”‚       β”œβ”€β”€ voice/               # Voice processing
β”‚       β”‚   β”œβ”€β”€ detector.py      # Wake word detection
β”‚       β”‚   β”œβ”€β”€ stt.py           # STT (backup)
β”‚       β”‚   └── tts.py           # TTS (backup)
β”‚       β”œβ”€β”€ motion/              # Motion control
β”‚       β”‚   β”œβ”€β”€ controller.py    # Motion controller
β”‚       β”‚   └── queue.py         # Motion queue
β”‚       β”œβ”€β”€ esphome/             # ESPHome protocol
β”‚       β”‚   β”œβ”€β”€ protocol.py      # Protocol definitions
β”‚       β”‚   └── server.py        # ESPHome server
β”‚       └── config/              # Configuration
β”‚           └── manager.py        # Config manager
β”œβ”€β”€ profiles/                    # Personality profiles
β”‚   └── default/
β”œβ”€β”€ wakewords/                   # Wake word models
β”œβ”€β”€ pyproject.toml               # Project config
β”œβ”€β”€ PROJECT_PLAN.md              # Project plan
β”œβ”€β”€ ARCHITECTURE.md              # Architecture docs
β”œβ”€β”€ REQUIREMENTS.md              # Requirements
└── README.md                    # This file

Development

Running Tests

# Install development dependencies
pip install -e .[dev]

# Run tests
pytest

# Run with coverage
pytest --cov=reachy_mini_ha_voice

Code Style

# Format code
ruff format .

# Lint code
ruff check .

Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Acknowledgments

Support

For issues and questions:

  • Open an issue on GitHub
  • Join the Discord community
  • Check the documentation

Made with ❀️ for Reachy Mini and Home Assistant community