Local vs Cloud Voice Assistant: Thai Context
Google Assistant and Amazon Alexa support Thai, but with limitations: every utterance is sent to Google’s or Amazon’s cloud for processing — raising PDPA and privacy concerns — and requires constant internet with 0.5–2 second latency depending on network conditions. A local AI voice assistant solves all these problems by running everything on-device.
Local AI Voice Assistant Stack
Wake word detection: openWakeWord or Porcupine running on CPU, detecting keywords such as สวัสดีบ้าน, using <5% CPU load.
STT (Speech-to-Text): OpenAI’s Whisper.cpp running a quantised model on Pi 5 CPU — no GPU required.
Intent and response: Ollama running LLaMA 3.2 3B quantised (Q4) as a local LLM to process commands and generate responses, connecting to Home Assistant via API.
TTS (Text-to-Speech): Piper TTS (the fastest open-source local TTS), converting text to speech with a Thai voice model.
Raspberry Pi 5 Specs and Performance
Raspberry Pi 5 (8GB RAM): Whisper.cpp Tiny Thai (Q4): ~1–2 seconds per 10-word sentence; Whisper.cpp Small Thai (Q4): ~3–5 seconds (more accurate); Ollama LLaMA 3.2 3B (Q4): ~3–8 seconds per 50-token response; Piper TTS: <0.5 seconds per 20-word sentence. Total latency: 4–15 seconds — acceptable for Smart Home commands but 3–5× slower than cloud.
Recommendation: use Tiny/Small model for Smart Home commands with limited vocabulary to minimise latency; reserve larger models for complex queries.
Comparison with Google Assistant and Alexa
Google Assistant (Thai): 0.5–1 second latency, best Thai NLU — but sends audio to Google Cloud, requires constant internet, and exists within an advertising ecosystem.
Amazon Alexa (limited Thai): limited Thai support with some Skills not available in Thai; latency similar to Google; smaller ecosystem for Thailand.
Local Whisper + Ollama: complete privacy, works without internet, no subscription fees — but higher latency and hardware investment required (Pi 5 costs ~2,500–3,500 THB).
Ollama for Home Automation Intent
Ollama serves the LLM locally via REST API at localhost:11434. Write a system prompt defining the role: a HappySmart smart home assistant that receives Thai commands and sends Home Assistant actions as JSON. Home Assistant connects to Ollama via a custom component or Python REST script to execute the resulting action.
Voice Pipeline in Home Assistant
HA 2023.10+ includes the built-in Wyoming protocol, supporting local STT/TTS/wake word. Install Whisper.cpp and Piper as HA OS add-ons or Docker containers; connect them to the Assist pipeline in HA Settings. The result is a microphone-based voice interface that speaks and understands natively through Home Assistant.
Cost and ROI
Cloud (Google/Alexa): free but with privacy trade-offs and internet dependency. Local (Pi 5 8GB + USB microphone + speaker): 3,000–4,000 THB one-time, no monthly fees. Immediate return if privacy is valued highly.
