The most common way to break a Home Assistant automation is to paste YAML with a syntax error and not find out until HA reloads and throws a vague error in the logs. This validator catches those problems before they touch your system.
Paste your YAML here first. Fix what it finds. Then paste it into HA.
Validate Your YAML
Copy your YAML from your editor, an article, or the HA automation UI’s YAML mode. Paste it into the field below and click Validate. If there are errors, the line number and a plain-English description will appear. Fix the issue, re-paste, and validate again until it passes. Then paste it into Home Assistant.
YAML Validator
Paste your Home Assistant automation YAML and check for syntax errors
Common Home Assistant YAML Mistakes
If your YAML is failing and you are not sure why, check these first.
- Indentation errors: YAML uses spaces, not tabs, and indentation level carries meaning. Two spaces per level is the HA convention. A single inconsistent tab or extra space will break the whole block.
- Missing quotes around values with special characters: Template strings that contain colons, curly braces, or exclamation marks need to be wrapped in quotes. A message value that includes a Jinja2 template expression must be quoted or it will fail to parse.
- Wrong data types:
trueandfalseare booleans in YAML, not strings. HA expects specific types in specific fields, and a string where a boolean is expected will cause the automation to fail silently or not load at all. - Duplicate keys: Having the same key appear twice in the same block is treated inconsistently. HA will usually take the last value, which is rarely what you intended.
- Missing alias or description fields: Not errors that break syntax, but HA will generate generic names for automations without them. Worth adding before you have 200 automations and can no longer tell them apart.
Scope note: This validator checks YAML syntax only. It does not verify whether your entity IDs exist in your system, whether your service calls are valid, or whether your templates will render correctly at runtime. For template testing, use the Template Tester. For building automations from scratch, use the YAML Generator.
Found this useful? This tool is free and always will be. If it saved you a debugging session, consider supporting the network.
Support the Network →