ha-automations
Skill1 starsChanged 40 days agoMITView on GitHub
Author and edit Home Assistant automations, scripts, scenes, and helpers for Brandon - new automation, converting/consolidating existing ones, adding a script or helper. Use whenever building HA logic. For dashboards use ha-dashboards; for "why did X fire/not fire" use ha-debug.
In this repository9 other files it gives its agents.
- blogSkill
- closeSkill
- ha-dashboardsSkill
- ha-debugSkill
- superchargeSkill
- update-skillsSkill
- upstream-contribSkill
- wled-docsSkill
- writing-voiceSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Write tools are gated by a BestPracticeKey read-receipt: fetch it from ha_get_skill_guide (any reference file.
- Very specific: line 30
Use entity_id, not device_id (device_id breaks on re-add).
- Very specific: line 41
Right mode: - don't default to single.
- Very specific: line 45
No extra helper scripts: - don't factor shared logic into a new script.* entity.
- Very specific: line 46
Notification tags: - use tag to replace stale transient notifications (arming, UPS, washer).
- Distinctive: line 51
When he asks "can we do X?" - answer/propose first, don't unilaterally restructure his existing automations or dashboards.
- Distinctive: line 53
When he says "just fix it" / "stop going back and forth", take the most autonomous path with the tools you have and stop diagnosing.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Home Assistant Automation Authoring
Brandon expects this done autonomously through the HA MCP server (ha_config_set_automation / _script / _scene / _helper) - create and validate via the config API, never hand him YAML snippets to paste or tell him to edit configuration.yaml. Always load home-assistant-best-practices first - it holds the native-condition/helper decision workflow and the safe-refactoring rules; this skill is his personal conventions layered on top. (That plugin skill is read-only - it's overwritten on updates, so durable additions land here, never there.)
The HA MCP server (ha-mcp, configured 2026-09-05)
- User-scope
home-assistantserver in~/.claude.json(type http, ha-mcp 8.4.3). Loads at session start; a session started before it existed has no HA tools and needs a restart (claude --continuepreserves the conversation). - Write tools are gated by a
BestPracticeKeyread-receipt: fetch it fromha_get_skill_guide(any reference file; the key is in the first line and rotates hourly - re-fetch on BPS_ACKNOWLEDGMENT_REQUIRED, don't retry a stale key). PassMandatoryBPS=falseafter the first read. ha_config_set_automationreloads all automations = kills in-flight runs. A run holding a snapshot/restore pair (paused ambient lighting, page snapshots) gets orphaned mid-way; after any automation config write during active hours, check what the killed run may have left behind.ha_import_blueprint overwrite=trueis the programmatic "Re-download blueprint"; WS commandblueprint/delete(via ha_call_service ws_command) removes one.
Blueprint authoring (Brandon's bar, learned across ~20 revisions of gameday)
- Derive, don't ask. Every input he was shown got challenged: entity pickers became a device picker, page names became runtime auto-detect, action names derived from the device, preset names became effect dropdowns, effect entities derived from the chosen lights. The form he accepted: one sensor + one device + optional dropdowns. When an input can be computed from another at runtime (device_entities, state_attr option matching), compute it; free-text inputs are a last resort with a working default.
- Dropdowns only for universal values (WLED built-in effect names yes, user-created preset names no - blueprints cannot populate selectors from live data, so anything user-specific must be derived or defaulted, never typed).
- Stamp a version in the description ("Blueprint version: N") and bump every push - it is the only way to tell which copy HA is running, and GitHub's raw CDN caches ~5 min so re-imports silently fetch stale copies (a brand-new file path skips the cache). Push, wait out the window, import, verify the stamp.
- Renaming a blueprint file = a new blueprint to HA: import the new one, repoint the automation's
use_blueprint.pathvia python_transform,blueprint/deletethe old. Cheap only while there are no users. - Live-demo discipline: when Brandon is watching a test, demo exactly ONE change per run ("this time i just want to test 1 thing not 4"), announce the step list first, and remember hand-driven API pacing distorts timing - say so, and prefer letting the real automation run when judging speed/feel.
Before writing: ground it in evidence
- Pull real history before choosing thresholds or logic (
ha_get_historyon the entities and mode selectors involved). Base the design on how things actually behave, not assumption - he explicitly rewards this. - When he describes a manual habit on a schedule ("I run Mr Freeze around 8pm"), propose automating it directly - auto-trigger gated so a manual pick always wins - rather than a reminder/notification.
- Native triggers/conditions and built-in helpers before any Jinja - check the best-practices skill's substitution tables (numeric_state, time condition, min_max/threshold/derivative helpers, Template Helper via config flow instead of
template:YAML). - Use
entity_id, notdevice_id(device_id breaks on re-add). Exception: Z2M autodiscovered device triggers. - For Zigbee buttons/remotes: ZHA →
eventtrigger withdevice_ieee; Z2M →deviceormqtttrigger. Watch numeric-string coercion on button payloads (see ha-debug). - New multi-sensor/climate devices: check the generated entity IDs before wiring them anywhere - a device named after its area produces doubled slugs (
sensor.living_room_living_room_climate_*), which he wants renamed before they're referenced. His light groups are a deliberate 4-layer hierarchy (leaf /*_group/*_all/ top-level*_lights) - don't "fix" them.
New integrations: trim entities before building on them
When an integration creates a pile of entities (Unraid Management Agent made 124 on 2026-10-19), list them, keep only what alerts and dashboards actually use, disable the rest, and turn on the entry's pref_disable_new_entities (WS config_entries/update) so an update doesn't bring a new batch back. He called the full set spamming the database. Fast-changing sensors (CPU, RAM, network every 15 to 30 s) stay off unless a dashboard needs their history; say the row cost when proposing them. ha_set_entity enabled=false works one entity per call; the registry-update WS command is blocked.
Brandon's authoring checklist (apply every time)
- Aliases on everything - set
alias:on every trigger, condition, choose-option, and action so the visual editor and trace timeline read like sentences. - Right mode - don't default to
single. Motion-with-timeout →restart; sequential (locks) →queued; independent per-entity →parallel; one-shot notify →single. - The watchdog pattern - a threshold-crossing trigger never fires when the condition is ALREADY true (cat room hot all night = nothing crosses). Pair crossing triggers with a periodic re-check trigger (e.g.
/30) as a safety net; this is his named, established convention ("guest watchdog pattern"). - Categories + labels - list his existing categories and labels first (
ha_config_get_category/ha_config_get_label), then apply them to every new automation/script/helper. His semantics:security= physical security/safety + UPS;monitoring= system/appliance health. Create a new label rather than leaving something unlabeled, but reuse his taxonomy before inventing buckets. - Consolidate - N near-identical automations that share a trigger and differ only in data become ONE automation with trigger IDs + a
choose:keyed ontrigger.id. Don't ship a family of copies. - No extra helper scripts - don't factor shared logic into a new
script.*entity. Reuse an existing automation/script (e.g. an existing init sequence) or inline the actions. - Notification tags - use
tagto replace stale transient notifications (arming, UPS, washer). Multi-instance alerts (per-room CO2, per-device) get a templated per-entity tag (co2_high_{room}) so one room's clear can't eat another's active alert. Never auto-clear safety alerts (smoke/CO/leak). - Blueprint
description:fields are user-facing behavior only - what it does for the user, never implementation diffs or PR-style changelogs.
Respect his intent
- When he asks "can we do X?" - answer/propose first, don't unilaterally restructure his existing automations or dashboards.
- Smallest change that does the job; don't redesign unless he asks.
- When he says "just fix it" / "stop going back and forth", take the most autonomous path with the tools you have and stop diagnosing.
Verify
Trigger the scenario where possible (fire the trigger, toggle the helper, ha_call_service) and confirm via a fresh ha_get_automation_traces / ha_get_history that it behaved. Device quirk to remember: some hardware treats "innocent" commands as power-on (his Midea ACs power on from a fan-speed command) - gate device commands on the device actually being in the expected state. After any HA restore/rollback incident, re-verify your automations actually match what you left before trusting them. Tell him plainly what you built, what conventions you applied, and what you observed. For diagnosing misbehavior, hand off to ha-debug.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

