Alexa + Home Assistant with Local AI β Complete Integration Guide
This is the exact integration running in a real home β a Raspberry Pi 5 (8GB) running Home Assistant OS, an Echo Dot 5, and a fully local AI that answers questions about the house in 3β5 seconds. No subscription AI. No data leaves the LAN. Zero cloud AI costs.
- "Alexa, turn on the geyser" β direct device control
- "Alexa, ask house what is the battery level" β local AI answers in 3-5 seconds
- "Alexa, ask house will the battery last tonight?" β calculates from live sensor data
- "Alexa, ask house run zone 2 for 8 minutes" β sprinklers start
- Home Assistant speaks proactively through the Echo Dot at any time
Three-Layer Architecture
| Layer | What it does | Technology |
|---|---|---|
| Layer 1 | Direct device control β "Alexa, turn on geyser" | Nabu Casa Smart Home Skill |
| Layer 2 | Natural language queries via local AI | Custom Alexa Skill β AWS Lambda β HA β Node-RED β Ollama |
| Layer 3 | Proactive TTS β HA speaks through Echo Dot | alexa_devices HA integration |
The Data Flow
You speak β Echo Dot β Alexa Cloud β AWS Lambda (Python, eu-west-1)
β
βΌ sets input_text.alexa_query
Home Assistant (Pi 5)
β
βΌ rest_command β NR webhook
Node-RED
β
βΌ /api/chat (local)
Ollama (qwen2.5:1.5b)
β
βΌ {"service":"script.alexa_battery_status"}
Home Assistant script
β
βΌ Jinja2 templates β message
Echo Dot speaks
Lambda runtime: under 1 second (fire-and-forget β returns "Checkingβ¦" immediately)
Total latency: 3β5 seconds from spoken question to spoken answer
AI processing: 100% local on Pi 5, offline, never leaves your LAN
Hardware and Software Required
- Raspberry Pi 5 (8GB) β 4GB may work but leaves very little headroom with Ollama loaded
- Amazon Echo Dot (any generation with a speaker)
- Nabu Casa subscription (~R150/month) β needed for the external URL and Smart Home Skill. There is no free alternative for Layer 1.
- AWS account (free) β Lambda stays well within the free tier at ~50 queries/day
- Amazon Developer account (free) β for building the custom Alexa skill
- Ollama HA add-on + Node-RED HA add-on β both free
Cost Summary
| Component | Cost |
|---|---|
| Nabu Casa | ~R150/month (~$8 USD) |
| AWS Lambda | R0 (well within free tier) |
| Ollama / qwen2.5:1.5b | Free, runs locally |
| Echo Dot 5 | ~R700 once-off |
| Cloud AI API costs | R0 β everything runs on-device |
Performance
| Stage | Time |
|---|---|
| Lambda β HA (set input_text) | < 1 second |
| HA automation β NR webhook | < 0.5 seconds |
| Ollama prompt eval (KV cache warm) | ~0.05 seconds |
| Ollama generation (~20 tokens) | ~2-3 seconds |
| HA script + Echo Dot speech | < 1 second |
| Total end-to-end | 3β5 seconds |
Pi 5 stats at idle with this integration running: CPU ~17%, RAM ~62% (with Ollama + Frigate also loaded).
Why Local AI Instead of ChatGPT/Claude API?
Three reasons: privacy, cost, and latency. Every query about your home β battery levels, solar production, sprinkler zones β would go through a third-party API server if you used cloud AI. With Ollama running locally, none of that data ever leaves your network. There are no API costs at all. And with the KV cache warmed up, local inference on a Pi 5 is nearly as fast as a cloud API call anyway.
The model used is qwen2.5:1.5b β small enough to fit alongside everything else in Pi 5 RAM (~900MB), fast enough at ~7.5 tokens/second, and accurate enough for structured JSON intent classification. For this use case (mapping spoken queries to HA script names), a 1.5B parameter model is more than sufficient.