home-assistant-best-practices
Skill by antbald
Home Assistant Best Practices guides AI assistants when they write or edit Home Assistant automations, scripts, scenes, helpers and device controls. It steers them toward native constructs, built-in helpers and entity_id references.
Install home-assistant-best-practices
Built from the published package, never by AI.
git clone --depth 1 https://github.com/antbald/ha-ev-smart-charger /tmp/ha-ev-smart-charger && mkdir -p ~/.claude/skills && cp -r /tmp/ha-ev-smart-charger/.agents/skills/home-assistant-best-practices ~/.claude/skills/home-assistant-best-practicesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install home-assistant-best-practices in Claude Code
git clone --depth 1 https://github.com/antbald/ha-ev-smart-charger /tmp/ha-ev-smart-charger && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/ha-ev-smart-charger/.agents/skills/home-assistant-best-practices ~/.gemini/antigravity-cli/skills/home-assistant-best-practicesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install home-assistant-best-practices in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
Home Assistant Best Practices is an agent skill that guides an AI assistant when it creates or edits Home Assistant automations, scripts, scenes, helpers and device controls. Its core principle is to use native Home Assistant constructs wherever possible, since templates bypass validation and fail silently at runtime. The skill sets out a decision workflow: check for native conditions and triggers, check for built-in helpers before template sensors, select the correct automation mode, and prefer entity_id over device_id.
It also covers Zigbee button and remote automations for ZHA and Zigbee2MQTT, and a safe refactoring workflow for renaming entities or migrating device_id references. Supporting reference files cover automation patterns, helper selection, template guidelines, device control and compound examples. It is aimed at Home Assistant users who want an AI assistant to write or change automation config in line with these practices.
Written from the project's SKILL.md and checked against it.
What it can do
- Native condition and trigger guidanceSuggests numeric_state, state, time and other native alternatives to Jinja2 templates.
- Built-in helper selectionPoints to min_max, group, derivative, threshold and utility_meter helpers instead of template sensors.
- Automation mode selectionRecommends restart, queued, parallel or single mode based on the scenario.
- entity_id over device_idAdvises using entity_id in triggers and actions, with device_ieee for ZHA.
- Zigbee button and remote patternsCovers event triggers for ZHA and device or mqtt triggers for Zigbee2MQTT.
- Safe refactoring workflowRequires impact analysis before renaming entities or replacing helpers and restructuring automations.
- Compound examplesProvides examples/examples.yaml combining several best practices in one automation.
Try asking
- Write a hallway light automation that turns on with motion and uses restart mode
- Replace this template sensor that sums three power sensors with a min_max helper
- Set up a ZHA remote button automation that toggles a living room light
Good to know
- Wait_template and wait_for_trigger behave differently when the state is already true.
- Zigbee2MQTT autodiscovered device triggers are the stated exception to the entity_id rule.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/home-assistant-best-practices/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to home-assistant-best-practices
All alternatives →Diagnoses slow React components and suggests targeted performance fixes. Built for developers who want to reduce re-renders or list lag in React UIs.
Diagnoses slow React components and suggests targeted performance fixes. Built for React developers who need to reduce re-renders, list lag, or expensive render work.
Designs masterclass-style lectures as slide courses with dense pages, long teacher narration and rare quizzes. Built for subjects where understanding matters more than hands-on practice.
Designs hands-on workshop courses in which the learner practises through exercise and quiz pages instead of watching. It suits workshops, bootcamp sessions and skills the learner should leave able to use.
Analyzes competition and develops market positioning strategies using Porter's Five Forces, Blue Ocean Strategy, and positioning maps. Useful for founders and teams evaluating competitors or preparing a startup or investor pitch.
Designs courses whose content depends on current or external facts. It researches the topic first, records each claim with its source, and builds the outline and pages from fetched material. Built for educators teaching time-sensitive subjects.
Compare with react-component-performance, react-component-performance or lecture-style
home-assistant-best-practices: common questions
Does this skill replace template sensors everywhere?
No. The source says templates are still appropriate in some cases and lists them in the template guidelines reference, but it advises native conditions and helpers where they exist.
Which automation mode should I use for motion lights?
The source recommends restart mode for motion lights with a timeout, because re-triggers must reset the timer. It says the default single mode is often wrong.
Why does the skill prefer entity_id to device_id?
The source says device_id breaks when devices are re-added. For ZHA it recommends device_ieee instead, which it describes as persistent.
How do I install home-assistant-best-practices?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is home-assistant-best-practices free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is home-assistant-best-practices safe to use?
It scores 71 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to home-assistant-best-practices?
Similar skills: react-component-performance, react-component-performance, lecture-style, workshop-style.
