Key Takeaways
- Rule-based automation is deterministic but blind to context it was not scripted for
- A local LLM reasons over intent and context: time, presence, weather, sensor states
- Describe automations as plain-language goals; the model maps them to device actions
- Run it locally via Ollama + Home Assistant β no cloud, no data leaving the house
- Keep safety-critical automations (locks, alarms) as deterministic rules
- Use a small function-calling model and constrain scope for reliability
The Limits of Rule-Based Automation
Rule-based automation fires a fixed action for a fixed trigger and cannot weigh context it was not explicitly scripted for. It is reliable and fast, but every nuance needs another hand-written condition.
- Combinatorial blow-up: "turn on the light, unless it is bright, unless someone is asleep, unless I am away" becomes many nested conditions.
- No intent: rules cannot interpret "make it cosy" β only exact entity states.
- Brittle edge cases: unscripted situations fall through with no sensible default.
What an LLM Adds: Context, Intent, Language
An LLM adds three things rules lack: it understands plain language, infers intent, and reasons over multiple context signals at once. Use it where nuance matters; keep rules where determinism matters.
| Aspect | Rule-based | Local-LLM driven |
|---|---|---|
| Trigger handling | Fixed action per trigger | Weighs context before acting |
| Phrasing | Exact conditions only | Plain-language goals |
| Context | Only scripted states | Time, presence, sensors together |
| Edge cases | Falls through | Reasonable default from context |
Example Automations (With the Prompts)
These examples show where an LLM-driven automation beats a rule: each is a plain-language goal the model resolves against live context. Wire them as Home Assistant automations that call the conversation agent.
- Provide the model the relevant entity states in the prompt so it has the context to reason over.
- For the end-to-end setup, see running your smart home on a local LLM.
- 1Leaving-home reminder
Why it matters: Prompt: "If it looks like rain in the next hour and I am heading out, remind me to take an umbrella." The model checks the weather entity and presence before notifying β a rule would need explicit thresholds. - 2Adaptive evening scene
Why it matters: Prompt: "When the last person gets home after sunset, set a warm, low-light scene unless someone is already asleep." The model weighs presence, time, and sleep state together. - 3Energy nudge
Why it matters: Prompt: "If heating is on and a window has been open more than five minutes, turn the heating down and tell me which room." The model combines two sensor states and explains its action.
The Architecture
The automation triggers in Home Assistant, passes context to the local LLM via the conversation agent, and the model returns device actions. Everything runs locally.
- Home Assistant automation supplies the trigger and current entity states.
- The local model (via the Ollama integration) reasons and returns actions.
- Only entities you expose to Assist are actionable, which bounds what the model can do.
Reliability and Guardrails
Keep safety-critical automations deterministic, constrain the model's scope, and prefer a small fast model to keep latency low. LLM automations should enhance, not own, critical functions.
- Never route safety to the model: smoke alarms, door locks, and security stay as plain rules.
- Constrain scope: expose only the entities the model needs and add a system prompt limiting actions.
- Pick the model for latency: see best local LLM models for smart home control.
- Log and review: check the conversation logs to confirm the model acts as intended before trusting it unattended.
- For agent patterns and workflows, see autonomous local agents that actually work (cross-cluster).
FAQ
Are local-LLM automations reliable enough to trust?
For comfort and convenience automations, yes β when you constrain scope and review behaviour first. Keep safety-critical automations (locks, alarms, smoke detectors) as deterministic rules rather than routing them through the model.
Does an LLM replace all my automations?
No. Use deterministic rules for simple, time-sensitive, or safety-critical triggers, and reserve the LLM for automations that need context, nuance, or natural-language goals. The two work together.
What model is best for AI automations?
A small, fast, function-calling model keeps automation latency low while reliably emitting device actions. See the best local LLM models for smart home guide for current picks matched to hardware.
How much latency do LLM automations add?
Latency depends on model size and hardware. A small model on a mini PC with a GPU or NPU responds quickly enough for non-instant automations; avoid routing latency-critical triggers through the model.