2.0 KiB
Configuration check
{% if page.installation == "os" %}
After changing configuration or automation files, check if the configuration is valid before restarting Home Assistant Core.
Running a configuration check from the UI
- Go to {% my profile title="your user profile" %} and enable Advanced Mode.
- Go to {% my server_controls title="Developer tools > YAML" %} and in the Configuration validation section, select the Check configuration button.
- This is to make sure there are no syntax errors before restarting Home Assistant.
- It checks for valid {% term YAML %} and valid config structures.
- If you need to do a more comprehensive configuration check, run the check from the CLI.
Running a configuration check from the CLI
Use the following command to check if the configuration is valid. The command line configuration check validates the {% term YAML %} files and checks for valid config structures, as well as some other elements.
ha core check
{% elsif page.installation == "container" %}
After changing configuration files, check if the configuration is valid before restarting Home Assistant Core.
If your container name is something other than homeassistant
, change that part in the examples below.
Run the full check:
docker exec homeassistant python -m homeassistant --script check_config --config /config
Listing all loaded files:
docker exec homeassistant python -m homeassistant --script check_config --files
Viewing an integration’s configuration (light
in this example):
docker exec homeassistant python -m homeassistant --script check_config --info light
Or all integrations’ configuration
docker exec homeassistant python -m homeassistant --script check_config --info all
You can get help from the command line using:
docker exec homeassistant python -m homeassistant --script check_config --help
{% endif %}