Local Thai Voice Command: Privacy-First Smart Home Control
Conventional voice assistants (Google, Siri, Alexa) send every spoken word to foreign cloud servers for processing. A local voice pipeline keeps all audio on-premises through three layers: wake word detection → speech recognition → intent understanding.
Layer 1: Thai Wake Word with Porcupine
Picovoice Porcupine provides on-device wake word detection using ~2% CPU on Raspberry Pi 5. Custom Thai wake words (e.g., บ้านฉลาด or เฮ้บ้าน) are trained via the Picovoice Console web interface and downloaded as model files — free for up to 3 wake words. The detector runs continuously, activating command recording only on wake word detection.
Layer 2: Local Whisper ASR for Thai
After wake word detection, 3–5 seconds of audio are recorded and transcribed by Whisper small (461MB, running on CPU). Thai transcription word-error-rate is 8–12% for short command phrases — sufficient for intent classification. Transcription latency on Raspberry Pi 5: 3–5 seconds.
Layer 3: Rasa NLU for Thai Intent Recognition
Rasa open-source NLU with Thai tokenizer classifies transcribed text into intents (turn_on_light, set_temperature, lock_door, check_air_quality) and extracts entities (room, temperature value). Training on 20–30 Thai examples per intent yields >90% accuracy for in-domain commands.
Home Assistant REST API Integration
Rasa routes classified intents to Home Assistant service calls via REST API. Turn on lights, set thermostat, lock doors, and check sensor readings — all triggered by natural Thai speech with no cloud involvement.
Latency and Privacy
End-to-end latency: ~7–9 seconds (wake word + 3s recording + 3–5s Whisper + 0.2s Rasa + 0.5s HA). No audio data leaves the local network at any stage.
