The question everyone asks when they hear an AI built a smart home system is simple: "Wait — the AI built it? Like, actually built it?" In part two of his Home Assistant series, developer Kyle J. Katarn answers this by detailing how he deployed Claude to implement a predictive thermostat system on real hardware. The result wasn't a fragile demo of a bot clicking buttons; it was a robust, self-documenting build that exposed a critical insight for agent developers: AI agents are strongest when they leverage a system's own APIs rather than imitating human interaction.
The Agent That Stopped Clicking
Katarn’s initial expectation was to watch the agent crawl through Home Assistant’s menus, opening settings and filling forms forty times over. Instead, the agent recognized it was operating within an authenticated browser session and pivoted to using Home Assistant’s internal API directly. This allowed it to programmatically create template sensors, statistics sensors, automations, and dashboards without relying on the UI layer. Crucially, this didn't result in mysterious backend hacks; every object created remained a standard, editable Home Assistant entity, identical to what a human would have built via the interface.
A Discipline of Verification
The build process revealed a workflow discipline that many human engineers often skip. The agent began by querying the live system to verify reality, discovering that no plain 'outdoor temperature' sensor existed and that data was buried within weather entities. Before committing any logic, the agent test-rendered formulas against live data to ensure sane outputs, effectively dry-running the math. It built the system in layers—data first, then control logic, then the user interface—and maintained a running reference document in the project folder. This documentation proved invaluable for debugging and future maintenance, costing nothing during the build but paying dividends later.
Where the Human Still Matters
Despite the agent's technical prowess, critical decision-making remained with the human. The agent surfaced a conflict between two weather data sources that disagreed by nearly 3°C, a discrepancy that could flip the heating logic entirely. It handed the choice of which source represented 'reality' back to Katarn. Similarly, the core policy—only stopping an overshoot when weather conditions wouldn't naturally recover it—was a human intuition about thermal energy that the agent translated into code but did not invent. The agent also wisely implemented tuning sliders for comfort trade-offs rather than hard-coding values, acknowledging that optimal settings are personal.
Key Takeaways
- APIs over UI Automation: Agents should be encouraged to use internal APIs when available, as this yields more reliable and maintainable results than browser automation.
- Verify Before Committing: Implement a strict 'test-render' phase where logic is validated against live data before being saved as permanent configuration.
- Human-in-the-Loop for Policy: Agents excel at mechanism and verification, but humans must define intent, trust sources, and handle domain-specific exceptions like utility pre-cooling programs.
- Embrace Documentation: Require agents to generate and maintain reference docs as they build; this transparency aids debugging and proves the system's integrity.
The Bottom Line
This build proves that the future of AI agents isn't in mimicking human clumsiness, but in leveraging machine-speed access to system internals while leaving judgment calls to the operator.