brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: check your Home Assistant configuration before you restart, not after

Home Assistant
~/tips/tip-home-assistant-config-check

ha core check

Validates the YAML configuration before a restart, so one typo does not take Home Assistant down.

One wrong indent in configuration.yaml and a restart can leave Home Assistant without the integrations you broke. Checking first takes seconds.

In the UI: go to Settings, then Tools, then YAML, and press “Check configuration” in the “Check and restart” section. The docs say it is there to make sure there are no syntax errors before you restart.

On Home Assistant OS you can do the same from the CLI:

ha core check

For a plain Python install there is a script for it, with useful extra options:

hass --script check_config -c /path/to/config --info all

--info prints what each integration got after parsing, -f lists the files that were loaded, --fail-on-warnings treats warnings as errors and --json gives machine-readable output. -s shows your secrets in the output, so leave that one off when you paste the result anywhere.

The docs also say a check runs automatically when you reload the configuration or restart, which is a safety net. Still, I’d rather see the error while the old config is running than after.

Caveat: the check catches YAML and schema problems, not logic. An automation that is valid but triggers at the wrong time passes just fine. Keep a backup of the config before big edits.

Further reading: Home Assistant: configuration, Home Assistant OS common tasks, Home Assistant: check_config script, On this site: !secret keeps passwords out of configuration.yaml

Going deeper: Guide: Home Assistant backups in Docker, with a failure alert on your phone and a copy off the box

More Home Assistant tips Trust X-Forwarded-For: on Unlimited login attempts: off automation: sequence: template: All Home Assistant tips (11) All topics

Link