Home Assistant is made up of thousands of integrations. Official integration quality rules have been created to help maintain an overall great level of quality among these integrations. Integrations that pass these rules can grow their quality ranking to bronze, silver, gold and finally platinum. These rules are extensively documented and define the perfect user experience, documentation, error handling and performance for integrations.
This repository contains a collection of scripts to use AI to generate reports if an integration follows a rule, and if not, what it should do to improve. Generated reports can be found here.
Disclaimer: AI can be wrong, and following guidance from these reports will not guarantee that your contribution will be accepted into Home Assistant.
The scrips use the Google Gemini API. Create a file .token
that contains your Google Gemini API key. You can create one here..
This script will test an integration against the Home Assistant integration quality scale rules. It will generate a report for each rule.
uv run checker.py wled
By default it assumes that the Home Assistant core repository exists as ../core
. If that is not the case, specify it by adding --core-path
to the command line.
Specify the direct path to the integration's directory. If this is provided, the script will load the integration from this path. The positional domain
argument becomes optional, and if not provided, will be inferred from the directory name. Example: uv run checker.py --integration-path /path/to/my_integration
By default it will stop checking rules for the first integration quality scale level that has rules left to be done. Set --target-scale silver
to check all rules for the silver level and below.
The configured model is set to a paid model and requires billing to be enabled. Add --free
to the command line to use a free model. Quality will be lower.
Only run a single rule. This is useful for testing and debugging.
By default it will not generate reports that are already generated. Set --force-update
to force the generation of reports.
Set --dry-run
to only print the rules that would be checked, without actually checking them. This is useful for testing and debugging.
Set --include-done
to generate reports for rules that are already marked done.
When set, the script will create a commit with the generated reports and push it to the main
branch of the repository. This is useful for automating the generation of reports.
This script will take a generated report and use it to fix the issues in the integration by generating a diff.
uv run fixer.py wled has-entity-name
By default it assumes that the Home Assistant core repository exists as ../core
. If that is not the case, specify it by adding --core-path
to the command line.