Home Assistant Integration Knowledge

VerifiedSafe

Complete reference for building, testing and reviewing Home Assistant integrations, covering best practices, entity platforms, and quality scale rules.

Sby Skills Guide Bot
DevelopmentIntermediate
8/29/2026
Claude CodeCursorWindsurfCopilotCodex
#home-assistant#integration-development#quality-scale#entity-platforms#python

Recommended for

Automated summary

A knowledge-base reference that guides building, testing and reviewing Home Assistant Integrations using the core repository conventions and the Integration Quality Scale.

Strengths

  • States the exact code and test locations (`./homeassistant/components/<domain>/` and `./tests/components/<domain>/`)
  • Encodes concrete, commonly missed rules: no configurable `scan_interval`, no user-set config entry names, direct indexing instead of `.get()`
  • Enforces the thin-wrapper principle, pushing protocol parsing and state machines into a separate PyPI library
  • Points to the official quality scale rules and the diagnostics/repairs guides, with done/exempt/todo semantics in `quality_scale.yaml`

Limitations

  • Assumes the agent already has the Home Assistant core checkout and access to the external rules pages
  • Gives directives and pointers rather than complete example code
  • Testing guidance stays high level, with no specifics on fixtures or mocking patterns
When to use it

Load it whenever you write, change or review a Home Assistant integration so the work matches core conventions and quality scale rules.

When not to use it

For development outside Home Assistant, or for generic Python questions that do not involve entity platforms or the quality scale.

Security analysis

Safe
Quality score88/100

This is a documentation-only Home Assistant integration guidance file. It declares no tools, contains no executable commands, and does not instruct destructive, exfiltrating, or obfuscated actions. It only references local documentation and external best-practice URLs.

No concerns found

How this analysis is made

Examples

Review a new integration
Review my new integration at homeassistant/components/my_device/ against the Integration Quality Scale rules and tell me which bronze and silver rules are still missing.
Check config flow conventions
Look at my config flow in homeassistant/components/my_device/config_flow.py and flag anything that violates Home Assistant conventions, like user-set entry names or polling interval options.
Entity lifecycle symmetry
Check that async_added_to_hass and async_will_remove_from_hass in my sensor platform are symmetric and that I'm not duplicating attributes the SensorEntity base class already provides.

name: ha-integration-knowledge description: Everything you need to know to build, test and review Home Assistant Integrations. If you're looking at an integration, you must use this as your primary reference.

File Locations

  • Integration code: ./homeassistant/components/<integration_domain>/
  • Integration tests: ./tests/components/<integration_domain>/

General guidelines

  • When looking for examples, prefer integrations with the platinum or gold quality scale level first.
  • Polling intervals are NOT user-configurable. Never add scan_interval, update_interval, or polling frequency options to config flows or config entries.
  • Do NOT allow users to set config entry names in config flows. Names are automatically generated or can be customized later in UI. Exception: helper integrations may allow custom names.
  • For entity actions and entity services, avoid requesting redundant defensive checks for fields already enforced by Home Assistant validation schemas and entity filters; only request extra guards when values bypass validation or are transformed unsafely.
  • When validation guarantees a key is present, prefer direct dictionary indexing (data["key"]) over .get("key") so invalid assumptions fail fast.
  • Integrations should be thin wrappers. Protocol parsing, device state machines, or other domain logic belong in a separate PyPI library, not in the integration itself. If unsure, ask before inlining.
  • Integrations should not implement fixes or workarounds for limitations in libraries. Instead, the library should be updated to fix the issue.

The following platforms have extra guidelines:

Entity platforms

  • Ensure async_added_to_hass() and async_will_remove_from_hass() have symmetrical behavior. For example, if a subscription is created in async_added_to_hass(), it should be unsubscribed in async_will_remove_from_hass(). Also, if something is torn down in async_will_remove_from_hass(), it should be set up in async_added_to_hass().
  • Entity base class (e.g. SensorEntity, TrackerEntity) provide a stable API for child classes to inherit from. Do not suggest redeclaring or duplicating attributes, properties, or methods the base class already provides, and do not add guards against the parent's behavior changing — rely on the base class instead.

Integration Quality Scale

  • When validating the quality scale rules, check them at https://developers.home-assistant.io/docs/core/integration-quality-scale/rules
  • When implementing or reviewing an integration, always consider the quality scale rules, since they promote best practices.

Template scale file: ./script/scaffold/templates/integration/integration/quality_scale.yaml

How Rules Apply

  1. Check manifest.json: Look for "quality_scale" key to determine integration level
  2. Bronze Rules: Always required for any integration with quality scale
  3. Higher Tier Rules: Only apply if integration targets that tier or higher
  4. Rule Status: Check quality_scale.yaml in integration folder for:
    • done: Rule implemented
    • exempt: Rule doesn't apply (with reason in comment)
    • todo: Rule needs implementation

Testing Requirements

  • Tests should avoid interacting or mocking internal integration details. For more info, see https://developers.home-assistant.io/docs/development_testing/#writing-tests-for-integrations

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/home-assistant-integration-knowledge-mte1lfql' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/home-assistant-integration-knowledge-mte1lfql/download' --output '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md.part' && mv '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md.part' '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md' && test -s '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ha-integration-knowledge' && cp -R '.skill-downloads/home-assistant-integration-knowledge-mte1lfql' '.claude/skills/ha-integration-knowledge'

Cursor
test -f '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md' && test -s '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/ha-integration-knowledge' && cp -R '.skill-downloads/home-assistant-integration-knowledge-mte1lfql' '.cursor/skills/ha-integration-knowledge'

Codex
test -f '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md' && test -s '.skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/ha-integration-knowledge' && cp -R '.skill-downloads/home-assistant-integration-knowledge-mte1lfql' '.agents/skills/ha-integration-knowledge'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/home-assistant-integration-knowledge-mte1lfql'

openskills read 'home-assistant-integration-knowledge-mte1lfql'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/home-assistant-integration-knowledge-mte1lfql/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills