3.1 KiB
Configuration check
{% 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.
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
{% elsif page.installation == "core" %}
After changing configuration files, check if the configuration is valid before restarting Home Assistant Core.
-
Switch to the user that is running Home Assistant.
sudo -u homeassistant -H -s
-
Activate the virtual environment that Home Assistant is running in.
source /srv/homeassistant/bin/activate
-
Run the configuration check.
Run the full check:
hass --script check_config
Listing all loaded files:
hass --script check_config --files
Viewing a integration’s configuration (
light
in this example):hass --script check_config --info light
Or all integrations’ configuration
hass --script check_config --info all
You can get help from the command line using:
hass --script check_config --help
-
When that is complete, restart the service for it to use the new files.
{% endif %}