Automations & Insight Jobs
Three ways to put Claude to work without opening the terminal.
brain.run_task — background jobs
Runs Claude as a background task from any automation or script — error-log digests, config audits, morning summaries — with an optional notification when it’s done.
automation: - alias: "Nightly error digest" trigger: - platform: time at: "23:30:00" action: - service: brain.run_task data: prompt: >- Check the Home Assistant error log for today. Summarize real problems (ignore benign warnings) and suggest fixes. notify: true timeout: 300Tasks run with a generous agentic budget (automation_max_turns, default 30 — nobody is waiting on a background job) and full MCP access — including Power Tools, so a task can fix what it finds, not just report it. Responses are also returned as service response data for use in the same automation.
brain.send_prompt — one-shot Q&A
A synchronous question → answer call, ideal inside scripts that need Claude’s answer immediately:
- service: brain.send_prompt data: prompt: "In one sentence: is anything in the house open or unlocked right now?" response_variable: claude- service: notify.mobile_app_phone data: message: "{{ claude.response }}"Insight jobs
Scheduled reports rendered to sensors — the dashboard-native sibling of the panel’s insight cards.
Create them from the integration: Settings → Devices & Services → brAIn → Add service → Insight job. Pick a shipped template — daily briefing, anomaly watch, battery & maintenance, camera check — or write a custom prompt. Custom prompts can embed HA templating ({{ states('sensor.outdoor_temp') }}), rendered just before each run.
- Scheduling: an interval, a daily time (HH:MM), both, or manual-only. Every job also gets a Run now button, and
brain.run_insighttriggers by name from automations. - Reading it: the report lives in the sensor’s attributes —
preview, fullmarkdown, and ready-to-pastecard_yaml. After the first successful run you get a notification containing the dashboard card. - Continuity: each run receives the home memory plus the previous report, so recurring insights note what changed instead of rediscovering the house.
- Events:
brain_insight_completefires after every run withname,entity_id,success, and apreview— ideal for TTS announcements.
type: markdowntitle: Morning Briefingcontent: >- {{ state_attr('sensor.morning_briefing_insight', 'markdown') or 'No insight yet — run brain.run_insight.' }}Jobs or insight cards? Jobs produce glanceable markdown on dashboards and TTS-able events; cards produce interactive visual analysis you click into. Both read the same memory, so most homes use jobs for tiles and briefings, and cards for deep dives.
Power Tools from automations
Every Power Tools service is a normal HA service — automations can call them directly, no Claude in the loop:
# Flag it in Repairs when the washer finishes but nobody empties it- service: brain.create_repair_issue data: title: "Washing machine done" description: "Cycle finished over 2 hours ago and the door hasn't opened." severity: warning issue_id: washer_forgotten