使用Claude构建Home Assistant自动化
Build Home Assistant automations with Claude
一位时间紧迫的父母让Claude构建Home Assistant自动化,包括一个从电力使用情况推断炉子是否开启的助手。
做了什么
The poster, a busy parent who had let Home Assistant sit mostly dormant, connected Claude to their HA instance using MCP and used it to build and improve automations instead of hand-writing YAML. In the thread, they and others describe Claude reviewing devices and automations, generating logic like occupancy and state checks, and in one example building a helper that infers whether the stove is on from range power usage, then adding warnings and exhaust-fan automation; people still review plans, code, and backups themselves.
效果如何
They say tasks that used to take days now take minutes, and one commenter said an automation that normally would have taken days worked on the first shot in 10 minutes. The main limitation raised is that Claude can overcomplicate things or act on more HA data than some users are comfortable exposing.
值得注意
A repeated catch is to keep backups Claude cannot access, review its plan or YAML before applying changes, and be aware MCP setups may consume a lot of tokens.
试试这个 Prompt
I use Home Assistant and want an automation that [what I want to happen, e.g. alert me if the stove has likely been left on]. My relevant devices and entities are [list entities, e.g. smart plug power sensor sensor.stove_power]. Write the full YAML, including any helpers or template sensors needed to infer the state, and explain step by step where to paste it and how to test it safely.