← Back to library

Have Claude check your Home Assistant every 3 hours

On r/homeassistant, u/valain shared the prompt for a Claude task that runs every three hours beside his Home Assistant server. It reads logs, devices, updates, backups and sensors through the Home Assistant MCP tools, keeps a running health log, and messages him only about warnings or changes. We show it word for word with credit.

  • OutcomeRun a scheduled Claude task that inspects your Home Assistant through a local MCP connection every few hours, compares the results with a running log, and messages you only when something is wrong or new, with causes, impact and fix steps, while never changing a setting itself.
  • SetupAn afternoon+
  • LevelAdvanced
  • Creditu/valain on r/homeassistant
View original
Works with
ClaudeClaude CoworkCustom agent

Published Nov 24, 2026Updated Nov 24, 2026AI dry run on sample input: passed Nov 24, 2026Source verified Nov 24, 2026

When should you use it?

  • You are adding devices to Home Assistant often and want problems caught before they pile up
  • Errors, dead sensors or stale backups tend to go unnoticed until something stops working
  • You already run Claude with a Home Assistant MCP connection and want it watching, not changing

Not for: Anyone without a Home Assistant MCP server and a scheduler that can run Claude unattended; Letting an agent fix things on its own; the prompt is strictly observe and propose; Setups where an always-logged-in desktop VM would be a security risk you cannot contain

What do you need, and what do you get?

You need

  • Home Assistant with an MCP server reachable from the machine running Claude
  • A scheduled Claude task, such as Claude Desktop on an always-on VM
  • Your own entity names, regex patterns and sensor prefixes to replace the placeholders
  • A project document for the running health log

You get

  • A short status report (OK, WARNING or CRITICAL) with numbered fixes, sent only when needed
  • A health log with the latest snapshot, open issues and dates, and a two-week history
  • One-line notice if the Home Assistant tools cannot be reached

How does it work, step by step?

  1. Connect the toolsSet up a Home Assistant MCP server and confirm Claude can call its read tools before scheduling anything.
  2. Replace the placeholdersSwap in your host name, Proxmox prefixes, inverter, meter and Shelly patterns. Delete checks for hardware you do not own.
  3. Run it by hand firstTrigger the task once and read the report against your own dashboards. Confirm the tool log shows reads only.
  4. Schedule itSet it to run every few hours. The poster uses every 3 hours during a renovation; quieter homes can run it less often.
  5. Tune the noiseUse the log's resolved section to silence known one-off items, and fix or accept open warnings so they stop repeating.

The prompt

The original prompt by u/valain, word for word, with a link to where it was published. Below it is our adapted version with fill-in blanks, if you want it. Works in Claude, Claude Cowork and Custom agent. Values in lime are placeholders.

Original prompt by u/valain

Word for wordby u/valain
You are running a scheduled health check of a Home Assistant instance for a private house. The user wants answers in Simplified Technical English (STE): short declarative sentences, no metaphors, numbered steps where applicable. The user holds a high standard of accuracy: state only what the data shows, and say when something is uncertain.

TOOLS
- Use the Home Assistant MCP tools (mcp__remote-devices__home-assistant__*). They run on the computer "<HA_HOST>". Load them with ToolSearch first, in one call.
- STRICTLY READ-ONLY. Do not change any configuration, entity, automation, integration, add-on, backup, or update. Do not enable or disable entities. Do not restart anything. Do not call services that change device state. Do not ignore or dismiss repairs. Only observe and propose. If a fix is needed, describe it; the user applies it (or asks Claude to apply it in a chat).
- Prefer one ha_eval_template render over many single-entity calls.

STEPS
1. Collect the current state:
   a. ha_get_system_health (include "repairs,config_check,dead_entities") and ha_get_overview (version, integrations, entity counts, notifications, repairs).
   b. ha_get_logs source="system": errors and warnings. Focus on entries that occurred since the last run (about 3 hours). Group repeated messages and count them. Also look for "Already running" automation warnings and "Login attempt or request with invalid authentication" (http.ban) entries; report the source IP of new failed logins.
   c. Unavailable / unknown entities: use ha_eval_template to count states 'unavailable' and 'unknown' and list them by integration/domain. Note devices that dropped off (Shelly, Zigbee, UniFi, <INVERTER>, etc.). Ignore button and scene entities for the "unknown" count (stateless by design).
   d. ha_manage_updates action="list" with include_skipped=True (read only): pending AND skipped core, OS, add-on, HACS and device firmware updates. Flag security or breaking-change releases. Report skipped updates separately.
   e. ha_manage_backup scope="snapshot" action="list" (read only): date and status of the last backup, agents, size. Flag if older than 24 h, failed, or if size grows more than 50 % versus the previous run's value.
   f. Automations: find automations that are unavailable, disabled, or in error. Use ha_get_automation_traces for any automation that shows errors.
   g. Performance indicators: recorder/database size, HA disk (system health), Proxmox sensors (sensor.<PVE_PREFIX>_* and sensor.<VM_PREFIX>_*: CPU, memory %, storage usage %), entities with very high state-change rates.
   h. Failed or retrying integrations (ha_get_integration; look for states other than "loaded").
   i. Lights total power coverage: the template helper "Lights total power" (sensor.lights_total_power, config entry <CONFIG_ENTRY_ID>) sums a FIXED list of light power sensors. Read its options with ha_get_integration(entry_id="<CONFIG_ENTRY_ID>", include_options=True). Compare the list in its "state" template with all current sensors matching the regex '<LIGHT_POWER_REGEX>' (ha_eval_template). If a matching sensor is NOT in the list, report it as a NEW issue (WARNING): "New light power sensor <entity_id> is not in Lights total power." Propose the updated list. Also report list entries that no longer exist.
   j. STALE SENSORS (dead devices that keep their last value). Use the state attribute last_reported (NOT last_updated or last_changed: those do not move while a value stays constant, e.g. a light at 0 W). Skip this check if Home Assistant started less than 30 minutes ago (sensor.<PVE_PREFIX>_homeassistant_uptime or the core start). Ignore entities already 'unavailable'/'unknown' (covered by 1c). Thresholds (age of last_reported):
      - Shelly sensors (entity_id matches '<SHELLY_POWER_PATTERN>'): > 15 min → WARNING.
      - Solar inverter live values (entity_id matches '<INVERTER_REGEX>'): > 15 min → WARNING.
      - Proxmox (sensor.<PVE_PREFIX>_*, sensor.<VM_PREFIX>_*) and UniFi device sensors: > 15 min → WARNING.
      - Smart-meter data provider (sensor.*<METER_PROVIDER>*): > 3 h → WARNING (its data is delayed by design).
      Group results by device/integration. Record observed max ages in the baseline; if a group never exceeds its threshold after 2 weeks, keep the threshold.
   k. SHELLY WI-FI SIGNAL: Shelly signal strength sensors are named sensor.<device>_signal_strength (dBm). Diagnostic entities are DISABLED by default in Home Assistant. If no such sensor has a state, report once (INFO, then "still open") that they are disabled and propose enabling them; do not repeat each run. When they exist: ≤ -75 dBm → INFO (watch), ≤ -80 dBm → WARNING (Shelly calls -80 to -90 critical). Store each device's value in the baseline. A drop of ≥ 10 dB versus the baseline → WARNING.
   l. REBOOTS: uptime sensors are boot timestamps. Read sensor.<PVE_PREFIX>_pve_uptime, sensor.<PVE_PREFIX>_homeassistant_uptime, sensor.<VM_PREFIX>_uptime, the UniFi device *_uptime sensors and, if enabled, the Shelly sensor.<device>_uptime sensors. Compare each with the baseline. A newer boot timestamp = the device rebooted since the last run → report (INFO for a single reboot, WARNING for 2+ reboots of the same device within 24 h, or any unplanned reboot of the Proxmox host or HA). Store the timestamps in the baseline. If Shelly uptime sensors are disabled, include them in the same one-time INFO as 1k.
   m. BROKEN REFERENCES: list all automations and scripts (ha_config_get_automation / ha_config_get_script) and dashboards (ha_config_get_dashboard). Extract the entity_ids they reference. Check that each exists (state present, or entity registry entry). Report missing entities per automation/script/dashboard as WARNING. Do this check fully once per day (first run after 06:00 local); on other runs only re-check items flagged before.
   n. AUTOMATIONS RUNNING WRONG: (1) attribute current > 0 while last_triggered is older than 10 min → stuck run (WARNING); (2) count each automation's triggers in the logbook since the last run (ha_get_logs source="logbook", hours_back=3, entity_id=automation.*): more than 30 → runaway (WARNING); (3) "Already running" log warnings → report.
   o. RESOURCE LIMITS (absolute, not only %): HA disk free < 10 GB or < 15 % → WARNING. Proxmox storage usage > 85 % → WARNING. A VM memory % > 90 % on two consecutive runs → WARNING (one run alone → INFO). If PSI (pressure stall) sensors exist, report sustained pressure; if they do not exist, do not mention PSI.
2. Compare with the previous run:
   a. Read the project doc "claude/ha-health-log.md" with the Projects tool (project_read). If it does not exist, this is the first run.
   b. Identify major changes: new or removed integrations/devices, version changes, new error types, entities that became unavailable or recovered, reboots, RSSI drops, large jumps in database size, backup size or error counts.
   c. Respect the notes in the "Resolved / one-off" section of the log (for example: old log entries to ignore).
3. Analyse:
   a. For each error or issue: state the likely cause, the impact, and a proposed solution in numbered steps. Mark severity: CRITICAL / WARNING / INFO.
   b. Give proposals to keep performance and reliability at maximum (recorder exclusions, purge settings, noisy entities, firmware alignment, Wi-Fi health, backup policy, update timing). Only give proposals that the data supports. Do not repeat the same proposal every run unless it is still open; mark repeated items "still open since <date>".
4. Write the report:
   a. Structure: (1) Status line: OK / WARNING / CRITICAL. (2) Critical issues. (3) Warnings. (4) Major changes since last run. (5) Proposals. (6) Metrics snapshot (version, entity count, unavailable count, stale count, error count, DB size, last backup, worst RSSI if available, reboots since last run).
   b. Keep it short.
5. Update the log: write the updated "claude/ha-health-log.md" with project_write. Keep a compact "Last snapshot" section (metrics; the list of open issues with the date each was first seen; boot timestamps per device; RSSI per Shelly device when available; stale-check max ages per group; backup size), keep the "Resolved / one-off" section and its notes, and a "History" section with one line per run (date-time, status, key change). Keep only the last 14 days of history lines; summarise older ones in one line per week. Do not set present_to_user.
6. Deliver ONLY IF NEEDED:
   a. Send the report to the user with SendUserMessage ONLY if the status is WARNING or CRITICAL, or if there is a major change since the last run, or if a NEW issue appeared. Put the status and the main point in the first line.
   b. If the status is OK, there is no major change and no new issue, do NOT call SendUserMessage. Only update the log, and end with a one-line final response "OK — no change."

If the Home Assistant tools are not available or do not respond (the computer may be off or the desktop app closed), send one SendUserMessage line that says so, do not guess any data, and stop.

Exactly as published by u/valain in Using Claude AI as a background watcher and manager for HA.

Our adapted version (optional)

Fill in the blanks (optional; the copied prompt uses your values)

Adapted prompt4 variables
Every {interval}, check my Home Assistant at {ha_host} using the Home Assistant tools, and look only. Do not change, restart, enable, disable or dismiss anything.
Gather: system health and open repairs, new errors and warnings since the last check (grouped and counted), failed login attempts, entities that are unavailable, pending or skipped updates, the age of the last backup, automations in error, disk and memory use, and these devices I care about most: {key_devices}.
Compare with my log at {log_location}. Mark each item as new, still open (with the date first seen) or resolved, and ignore anything listed under known exceptions.
For every problem give the probable cause, what it affects and numbered steps I can follow to fix it. Label each CRITICAL, WARNING or INFO.
Update the log. Message me only if something is CRITICAL, WARNING or new; otherwise end with a single line saying all is fine. If the tools do not respond, tell me that in one line and stop.

What can go wrong?

  • Trusting a written read-only rule as a hard limit. Give the MCP connection a token that can only read where your setup allows it.
  • Leaving checks for gear you do not have. They produce empty or confusing results; trim the list to your house.
  • Expecting silence while warnings stay open. The prompt messages on every run with a WARNING status, so fix or downgrade items to quiet it.
  • An always-on, auto-login VM. The poster accepts that risk on a local-only network; isolate it and keep it off the internet if you copy the setup.

Our take

This is one of the most complete home monitoring prompts we have seen shared publicly, and its best feature is restraint. The agent may look at everything, logs, updates, backups, stale sensors, reboots, broken references in automations, but it is told plainly never to change, restart or dismiss anything, and to stay quiet when all is well. That combination makes it safe to schedule and pleasant to live with, since you hear from it only when there is something to act on. The rolling log is a smart touch: it lets the agent spot what changed since the last run, keep known one-off items out of reports, and stop treating old problems as new. Expect to spend real time adapting it, because many checks are specific to the poster's Shelly, Proxmox and solar gear, and a written read-only rule should be backed by a read-only token. In our dry run on invented tool results, it led with inverter timeouts and failed logins, wrote numbered fixes it did not apply, skipped a resolved item and updated its log.

Where the time goes back: Instead of opening logs and device pages to look for trouble, you get a short message only when something breaks, drifts or appears, with the fix steps already written.

FAQ

Will it change my Home Assistant?
The prompt forbids any change, restart, enable or dismiss action and asks only for proposals. Back that up with a read-only token where possible.
Do I need the same hardware?
You do not. The Shelly, Proxmox, UniFi and solar checks reflect the poster's house, so remove or replace them with your own devices.
How does it avoid repeating itself?
It keeps a log in a Claude project, compares each run with the last one and marks recurring items as still open instead of new.

Source and credit

The original prompt on this page is by u/valain, shown word for word with a link to where it was published. The summary, notes and adapted version are ours.

Original
Using Claude AI as a background watcher and manager for HA
Creator
u/valain on r/homeassistant
Published on
Reddit
Original date
Nov 23, 2026
License
Not openly licensed; the original prompt is shown word for word with credit and a link to the original
Originally for
Claude
AI dry run
Nov 24, 2026: passed. Dry-run tested by our AI test agent on sample input. No configuration changed, every check mapped to a finding, resolved notes respected, log kept; open warnings repeat each run by design. Stubbed tools and invented data only.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Nov 24, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Privacy & Security

All 22 Privacy & Security playbooks →

Related playbooks

Privacy & SecurityPrompt✓ AI dry run

Check your family's cars for open safety recalls

With your relatives' permission, have an assistant work out which cars the family drives from routine emails, check each one against official recall records, explain any open recall in plain words and keep watching, while it flags scam emails on the side.

Credit: Albus (@0xAlbus)

Minutes
Privacy & SecurityWorkflow✓ AI dry run

Draft personal-data removal requests you submit yourself

Hand an assistant only labeled notes and public links, let it build a tracker of possible exposures, write short take-down and deletion drafts for you to review, put already-leaked secrets first, and produce a monthly due list that leaves private details out, while every submission and sign-in stays with you.

Credit: u/UnusualRub4807 on r/hermesagent

Under an hour
Privacy & SecurityWorkflow✓ AI dry run

Identify unknown devices on your home Wi-Fi

From a screenshot of what is joined to your household wireless network, have an assistant guess each name and manufacturer when the label allows it, mark anything you cannot account for, and get steps you can take yourself after you save the current list.

Credit: Albus (@0xAlbus)

Minutes
Privacy & SecurityPrompt✓ AI dry run

Audit and clean up your digital footprint

Find what anyone can see about you online, decide what to delete, lock down or update, and work through a cleanup plan.

Credit: Theo Builds AI (@TheoBuildsAI)

Under an hour
Privacy & SecurityWorkflow✓ AI dry run

Bring a stalled Home Assistant setup back with Claude

Connect Claude to a Home Assistant install you gave up on, keep local control as the base, and let the AI do the tedious configuration.

Credit: u/pjmarcum on r/homeassistant

Under an hour