πŸ”Š

Alexa + Home Assistant
with Local AI

"Alexa, ask house will the battery last tonight?" β€” spoken answer in 3-5 seconds. Fully local AI on Raspberry Pi 5. Zero cloud AI costs. Every query stays on your LAN.

3-5s
Response time
R0
Cloud AI cost
21
Voice commands
3
Layers

Three-Layer Architecture

Layer 1
Direct Device Control
Native Alexa voice control for lights, switches, AC, geyser, sprinklers and scripts. No code required. 15-minute setup.
Nabu Casa Smart Home Skill
Layer 2
Natural Language Queries
Free-form voice queries routed to local AI. "Alexa, ask house will the battery last tonight?" Answered from live sensor data.
Custom Alexa Skill β†’ AWS Lambda β†’ Ollama
Layer 3
Proactive TTS
Home Assistant speaks through the Echo Dot proactively β€” morning briefs, charge complete alerts, automation announcements.
alexa_media v5.15.0 (HACS)

The Data Flow

You speak β†’ Echo Dot β†’ Alexa Cloud β†’ AWS Lambda (Python 3.12, eu-west-1) β”‚ β–Ό sets input_text.alexa_query = "query|timestamp" Home Assistant (Pi 5) β”‚ β–Ό automation β†’ rest_command β†’ Node-RED webhook Node-RED "Alexa AI" tab β”‚ β–Ό POST /api/chat (local) Ollama qwen2.5:1.5b β”‚ β–Ό {"service":"script.alexa_will_battery_last","data":{}} HA Script runs β†’ reads live sensors β”‚ β–Ό alexa_devices.send_text_command Echo Dot speaks βœ“

What You Can Ask

🎀 Alexa, ask house battery status
🎀 Alexa, ask house will the battery last
🎀 Alexa, ask house charge overnight
🎀 Alexa, ask house solar status
🎀 Alexa, ask house good night
🎀 Alexa, ask house good morning
🎀 Alexa, ask house is there loadshedding
🎀 Alexa, ask house boost the geyser
🎀 Alexa, ask house run zone 2 for 8 minutes
🎀 Alexa, ask house stop sprinklers
🎀 Alexa, ask house set aircon to 22 degrees
🎀 Alexa, ask house aircon boost
🎀 Alexa, ask house biltong status
🎀 Alexa, ask house how long has Eskom been out
🎀 Alexa, ask house start Eskom import
🎀 Alexa, ask house import to 75 percent
🎀 Alexa, turn on the geyser
🎀 Alexa, set aircon to 22 degrees
🎀 Alexa, turn off the stoep light
🎀 Alexa, discover devices

Common Gotchas

AWS Region must be eu-west-1 (Ireland) β€” Stockholm silently fails. Lambda is created but Alexa never reaches it. No error message.
rest_command needs a full HA restart β€” reload_core_config does NOT load it. Settings β†’ System β†’ Restart.
KV cache mismatch = 22-second responses β€” warmup and process nodes must have byte-identical SYSTEM prompts. One space difference = full retokenization on every query.
"Alexa-hosted" shows Amazon's ARN β€” if endpoint shows arn:aws:lambda:us-east-1:797176512873, you chose the wrong hosting option. Start over with "Provision your own".
Alexa hears "my bottom status" β€” Alexa STT mishears "biltong status". Fix: add the misheard version as an example in the Ollama SYSTEM prompt.
Silent NR JS syntax error β€” literal \n inside a JS string causes Node-RED to silently fail. Alexa says "Checking" but nothing ever happens.

Step-by-Step Guides

Overview Β· 15 min read
πŸ—ΊοΈ Complete Integration Overview
Architecture, cost breakdown, performance numbers, and what you end up with. Start here.
Layer 1 Β· 6 min read
☁️ Nabu Casa Smart Home Skill
Enable direct device control. No code required. 15-minute setup from subscription to working voice commands.
Layer 2 Β· 12 min read
⚑ Custom Skill + AWS Lambda
Alexa Developer Console, skill creation, Lambda Python code, interaction model JSON. Every click documented.
Layer 3 Β· 15 min read
πŸ€– Ollama + Node-RED Flow
The complete NR flow, KV cache alignment trick (3s vs 23s), warmup node, supervisor API calls.
YAML Β· 15 min read
πŸ“ HA Scripts β€” Full YAML
Exact production YAML for all 21 scripts: battery, solar, overnight charging, sprinklers, aircon, biltong.
Hardware used in this installation
Pi 5 (8GB)~R2,500 once-off
Echo Dot 5~R700 once-off
Nabu Casa~R150/month (~$8)
AWS LambdaR0 (free tier)
Ollama / qwen2.5:1.5bFree, local