Validate automation YAML authoring rules
automations_validate_best_practicesLint Home Assistant automation YAML against static authoring rules before saving to catch missing mode, alias, trigger IDs, deprecated service keys, and other issues.
Instructions
Validate automation YAML against static Home Assistant authoring rules.
Parses yaml_content with plain yaml.safe_load (HA-only tags like
!input/!secret are NOT resolved and make parsing fail with a YAML
parse error, same as any other unknown tag) and runs fixed checks: a
state trigger without 'for:', a missing 'mode:', multiple triggers
without 'id:', a missing 'alias:'/'id:', the deprecated 'service:'
action key, 'restart' mode, and a missing 'description:'.
Use when: linting automation YAML before saving it with
automations_set_automation_config.
Not for: checking that referenced entities/services actually exist —
use automations_validate_automation_references; blueprint content
with unresolved '!input'/'!secret' tags — extract them to plain YAML
first.
Returns: dict {valid_yaml, automations_checked, issues_total, warnings, infos, issues[], summary}; each issue is {automation, rule, severity, message} with severity 'warning' (should fix) or
'info' (good to know).
Errors: returns {"valid_yaml": False, "error": "YAML parse error: ...", "issues": []} for invalid YAML.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| yaml_content | Yes | YAML text of a single automation dict or a list of automation dicts to lint. Parsed with plain `yaml.safe_load`, so HA-only tags like '!input'/'!secret' are not resolved. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||