diff --git a/source/_includes/common-tasks/configuration_check.md b/source/_includes/common-tasks/configuration_check.md index cc68d407518..4d0fbaa64bf 100644 --- a/source/_includes/common-tasks/configuration_check.md +++ b/source/_includes/common-tasks/configuration_check.md @@ -2,12 +2,28 @@ {% if page.installation == "os" or page.installation == "supervised" %} +After changing configuration or automation files, check if the configuration is valid before restarting Home Assistant Core. + +## To run a configuration check from the UI + +1. Go to {% my profile title="your user profile" %} and enable **Advanced Mode**. +2. 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 YAML and valid config structures. +3. If you need to do a more comprehensive configuration check, [run the check from the CLI](#to-run-a-configuration-check-from-the-cli). + +## To run a configuration check from the CLI + +Use the following command to check if the configuration is valid. The command line configuration check validates the YAML files and checks for valid config structures, as well as some other elements. + ```bash 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: @@ -42,19 +58,21 @@ docker exec homeassistant python -m homeassistant --script check_config --help {% elsif page.installation == "core" %} -1. Switch to the user that is running Home Assistant +After changing configuration files, check if the configuration is valid before restarting Home Assistant Core. + +1. Switch to the user that is running Home Assistant. ```bash sudo -u homeassistant -H -s ``` -2. Activate the virtual environment that Home Assistant is running in +2. Activate the virtual environment that Home Assistant is running in. ```bash source /srv/homeassistant/bin/activate ``` -3. Run the configuration check +3. Run the configuration check. Run the full check: @@ -86,6 +104,6 @@ docker exec homeassistant python -m homeassistant --script check_config --help hass --script check_config --help ``` -4. When that is complete restart the service for it to use the new files. +4. When that is complete, restart the service for it to use the new files. {% endif %}