Use Claude Code to maintain Home Assistant automations

Adam relied on Claude Code plus an MCP server to inspect Home Assistant, edit automation YAML, and troubleshoot behavior from traces.

Done with Claude Code· Intermediate

What they did
Adam kept his Home Assistant automations in YAML files inside a git repository. Claude Code connected into Home Assistant through MCP so it could search for entities, examine automation traces, and reload the setup after edits. Each time, it changed the file, copied it into Home Assistant with scp, triggered a reload, and then committed the update. For the shed motion light, it began by studying similar motion rules, checking for conflicts, and asking clarifying questions before writing anything.
How it went
A camera automation that was reacting to home-to-home GPS updates was found and repaired in under two minutes. Another brightness change needed four messages. The shed light logic also saves the previous state of each light, so lights that were already on remain on.
Tips
Adam’s skills files describe his conventions and device quirks, which helps Claude Code follow the existing patterns. It is also useful to ask the agent to compare against nearby automations before making live changes.

Try it yourself with Claude Code

I want to manage my Home Assistant automations through Claude Code and an MCP server. Start by finding the entities for [room/device] and checking any related automations or traces. Then draft the YAML for [desired behavior] and explain any possible conflicts or assumptions. Show me the exact change before you do anything irreversible, and wait for my approval before you reload, save, submit, commit, or send anything. If there is a problem after testing, inspect the trace, explain the cause, and propose the next fix. Stop at each approval point.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

3 more reports of this

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.