A comprehensive, AI-powered smart home assistant built for Raspberry Pi 5 with Hailo 8 AI accelerator, featuring voice recognition, computer vision, device control, and learning capabilities.
- Voice Processing: Wake word detection, speech-to-text, and text-to-speech
- Computer Vision: Object detection, face recognition, and person tracking using Hailo AI
- Device Control: Home Assistant integration for smart home automation
- Memory System: Persistent conversation history and learning capabilities
- Context Awareness: Maintains conversation context and user preferences
- Modular Architecture: Easy to extend and customize
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Voice Input │ │ Vision System │ │ Device Control │
│ (Wake Word) │ │ (Hailo AI) │ │ (Home Assistant)│
└─────────┬───────┘ └─────────┬───────┘ └─────────┬───────┘
│ │ │
└──────────────────────┼──────────────────────┘
│
┌─────────────▼─────────────┐
│ Smart Assistant Core │
│ (AI Agent + Memory) │
└─────────────┬─────────────┘
│
┌─────────────▼─────────────┐
│ MQTT Broker │
│ (Message Bus) │
└───────────────────────────┘
- Raspberry Pi 5 (16GB recommended)
- Hailo 8 AI Kit
- Camera (CSI port 0)
- USB microphone and speaker
- ZBT-1 dongle (USB)
- MicroSD card (64GB+ recommended)
- Raspberry Pi OS (64-bit)
- Python 3.9+
- Docker (for Home Assistant)
-
Clone the repository:
git clone <repository-url> cd HailoHome
-
Run the setup script:
chmod +x setup_pi.sh ./setup_pi.sh
-
Reboot your Raspberry Pi:
sudo reboot
-
Update system:
sudo apt update && sudo apt upgrade -y -
Install dependencies:
sudo apt install -y git build-essential python3-dev python3-pip python3-venv sudo apt install -y python3-pyaudio portaudio19-dev libopenjp2-7 libtiff6 sudo apt install -y python3-opencv libcap-dev rpicam-apps mosquitto mosquitto-clients
-
Enable hardware interfaces:
sudo raspi-config # Enable Camera, SSH, I2C, SPI -
Install Hailo AI software:
wget -O - https://hailo-csdata.s3.eu-west-2.amazonaws.com/repositories/hm-rpi.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/hailo.gpg echo "deb https://hailo-csdata.s3.eu-west-2.amazonaws.com/repositories/debian stable main" | sudo tee /etc/apt/sources.list.d/hailo.list sudo apt update sudo apt install -y hailo-all hailo-firmware-hailo8 hailo-online-compiler hailo-tappas
-
Setup Python environment:
mkdir ~/smart-assistant cd ~/smart-assistant python3 -m venv --system-site-packages .venv source .venv/bin/activate pip install -r requirements.txt
-
Install Home Assistant:
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo usermod -aG docker $USER # Log out and back in docker run -d --name homeassistant --privileged --restart=unless-stopped -e TZ=Europe/Paris -v ~/homeassistant_config:/config --network=host ghcr.io/home-assistant/home-assistant:stable
Edit config.yaml to match your setup:
system:
name: "Smart Assistant"
debug: true
log_level: "INFO"
hardware:
camera:
device: 0
resolution: [1920, 1080]
fps: 30
audio:
sample_rate: 16000
channels: 1
mqtt:
broker: "localhost"
port: 1883
ai:
voice:
wake_word: "hey assistant"
tts_voice: "en_US-lessac-medium"- Open Home Assistant web interface:
http://<PI_IP>:8123 - Go to Settings > Devices & Services
- Add MQTT integration
- Configure device discovery
- Wake Word: Change in
config.yamlunderai.voice.wake_word - TTS Voice: Download different voices from Piper Voices
- STT Model: Configure Whisper model size based on your needs
# Test mode
python main.py --test
# Normal mode
python main.py
# As system service
sudo systemctl start smart-assistant
sudo systemctl status smart-assistant- Wake Word: "Hey Assistant" (configurable)
- Device Control: "Turn on the living room lights"
- Information: "What's the temperature?"
- General Chat: "Tell me about the weather"
- Object Detection: Automatically detects objects in camera view
- Face Recognition: Recognizes familiar faces
- Person Tracking: Tracks movement in the room
-
Camera not detected:
sudo raspi-config # Enable camera rpicam-hello --timeout 1000 # Test camera
-
Audio issues:
arecord -l # List audio devices aplay -l # List playback devices
-
Hailo not detected:
hailo scan # Check Hailo devices sudo reboot # Reboot if needed
-
MQTT connection issues:
sudo systemctl status mosquitto mosquitto_pub -h localhost -t test -m "hello"
- Application logs:
smart_assistant.log - System logs:
journalctl -u smart-assistant - MQTT logs:
/var/log/mosquitto/mosquitto.log
HailoHome/
├── core/ # Core modules
│ ├── assistant.py # Main assistant class
│ ├── config_manager.py # Configuration management
│ ├── memory.py # Memory and learning system
│ ├── voice.py # Voice processing
│ ├── vision.py # Computer vision
│ └── device_controller.py # Device control
├── config.yaml # Configuration file
├── main.py # Application entry point
├── requirements.txt # Python dependencies
├── setup_pi.sh # Raspberry Pi setup script
└── README.md # This file
- Create new module in
core/directory - Add to assistant in
core/assistant.py - Update configuration in
config.yaml - Add tests and documentation
- Add new tools in
core/assistant.py - Update agent with new capabilities
- Test with voice input
- Convert models to Hailo format (.hef)
- Place in models/ directory
- Update vision.py to load new models
- GPU Memory Split: Increase to 128MB in
raspi-config - CPU Governor: Set to
performancemode - Thermal Management: Ensure adequate cooling
- Power Supply: Use official 27W power supply
- Cleanup old data: Configure in
memory.cleanup_interval - Limit conversation history: Set
memory.max_conversations - Optimize models: Use smaller models for better performance
- MQTT Authentication: Enable in production
- API Keys: Secure Home Assistant tokens
- Firewall: Configure appropriate rules
- Local Processing: All AI processing happens locally
- No Cloud Dependencies: No data sent to external services
- Encrypted Storage: Optional database encryption
- Resource Usage: CPU, memory, GPU utilization
- Service Health: Component status monitoring
- Error Tracking: Comprehensive logging
- Response Time: Voice command processing time
- Accuracy: STT and vision detection accuracy
- Uptime: System availability
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Hailo Technologies for AI acceleration
- OpenAI for Whisper STT
- Mozilla for Piper TTS
- Home Assistant for smart home integration
- LangChain for AI agent framework
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki pages
Happy Building! 🏠🤖