From b1a0c1ec4526c2f2c1f94f7d28657ac7b735b6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Tue, 6 Jul 2021 19:40:41 +0200 Subject: [PATCH] Adjust check config documentation (#18411) --- .../splitting_configuration.markdown | 13 +++-- .../configuration/troubleshooting.markdown | 9 ++-- source/_faq/component.markdown | 7 ++- .../common-tasks/configuration_check.md | 54 ++++++++++++++++++- 4 files changed, 71 insertions(+), 12 deletions(-) diff --git a/source/_docs/configuration/splitting_configuration.markdown b/source/_docs/configuration/splitting_configuration.markdown index 76cfefbcf7b..1582b8dabac 100644 --- a/source/_docs/configuration/splitting_configuration.markdown +++ b/source/_docs/configuration/splitting_configuration.markdown @@ -189,15 +189,14 @@ That about wraps it up. If you have issues checkout `home-assistant.log` in the configuration directory as well as your indentations. If all else fails, head over to our [Discord chat server][discord] and ask away. -## Debugging multiple configuration files +## Debugging configuration files -If you have many configuration files, the `check_config` script allows you to see how Home Assistant interprets them: +If you have many configuration files, Home Assistant provides a CLI that allows you to see how it interprets them, each installation type has it's own section in the common-tasks about this: -- Listing all loaded files: `hass --script check_config --files` -- Viewing a component's configuration: `hass --script check_config --info light` -- Or all components' configuration: `hass --script check_config --info all` - -You can get help from the command line using: `hass --script check_config --help` +- [Operating System](/common-tasks/os/#configuration-check) +- [Container](/common-tasks/container/#configuration-check) +- [Core](/common-tasks/core/#configuration-check) +- [Supervised](/common-tasks/supervised/#configuration-check) ## Advanced Usage diff --git a/source/_docs/configuration/troubleshooting.markdown b/source/_docs/configuration/troubleshooting.markdown index 399853c9148..b6880bde4a3 100644 --- a/source/_docs/configuration/troubleshooting.markdown +++ b/source/_docs/configuration/troubleshooting.markdown @@ -19,9 +19,12 @@ If you have incorrect entries in your configuration files you can use the config One of the most common problems with Home Assistant is an invalid `configuration.yaml` or other configuration file. -- With Home Assistant OS and Supervised you can use the [`ha` command](/hassio/commandline/#home-assistant): `ha core check`. - - You can test your configuration with Home Assistant Core using the command line with: `hass --script check_config`. If you need to provide the path for your configuration you can do this using the `-c` argument like this: `hass --script check_config -c /path/to/your/config/dir`. - - On Docker you can use `docker exec home-assistant python -m homeassistant --script check_config --config /config` - where `home-assistant` is the name of the container. +- Home Assistant provides a CLI that allows you to see how it interprets them, each installation type has it's own section in the common-tasks about this: + - [Operating System](/common-tasks/os/#configuration-check) + - [Container](/common-tasks/container/#configuration-check) + - [Core](/common-tasks/core/#configuration-check) + - [Supervised](/common-tasks/supervised/#configuration-check) + - The configuration files, including `configuration.yaml` must be UTF-8 encoded. If you see error like `'utf-8' codec can't decode byte`, edit the offending configuration and re-save it as UTF-8. - You can verify your configuration's YAML structure using [this online YAML parser](http://yaml-online-parser.appspot.com/) or [YAML Lint](http://www.yamllint.com/). - To learn more about the quirks of YAML, read [YAML IDIOSYNCRASIES](https://docs.saltstack.com/en/latest/topics/troubleshooting/yaml_idiosyncrasies.html) by SaltStack (the examples there are specific to SaltStack, but do explain YAML issues well). diff --git a/source/_faq/component.markdown b/source/_faq/component.markdown index 4acaa816335..950d2472e22 100644 --- a/source/_faq/component.markdown +++ b/source/_faq/component.markdown @@ -6,4 +6,9 @@ ha_category: Configuration When an integration does not show up, many different things can be the case. Before you try any of these steps, make sure to look at the `home-assistant.log` file and see if there are any errors related to your integration you are trying to set up. -If you have incorrect entries in your configuration files you can use the `check_config` script to assist in identifying them: `hass --script check_config`. +If you have incorrect entries in your configuration files you can use the CLI script to check your configuration, each installation type has it's own section in the common-tasks about this: + +- [Operating System](/common-tasks/os/#configuration-check) +- [Container](/common-tasks/container/#configuration-check) +- [Core](/common-tasks/core/#configuration-check) +- [Supervised](/common-tasks/supervised/#configuration-check) \ No newline at end of file diff --git a/source/_includes/common-tasks/configuration_check.md b/source/_includes/common-tasks/configuration_check.md index 2a5b598083e..4f39fdce11e 100644 --- a/source/_includes/common-tasks/configuration_check.md +++ b/source/_includes/common-tasks/configuration_check.md @@ -8,11 +8,37 @@ ha core check {% elsif page.installation == "container" %} +_If your container name is something other than `homeassistant`, change that part in the examples below._ + +Run the full check: + ```bash docker exec homeassistant python -m homeassistant --script check_config --config /config ``` -_If your container name is something other than `homeassistant`, change that part._ +Listing all loaded files: + +```bash +docker exec homeassistant python -m homeassistant --script check_config --files +``` + +Viewing a component’s configuration ([`light`](/integrations/light) in this example): + +```bash +docker exec homeassistant python -m homeassistant --script check_config --info light +``` + +Or all components’ configuration + +```bash +docker exec homeassistant python -m homeassistant --script check_config --info all +``` + +You can get help from the command line using: + +```bash +docker exec homeassistant python -m homeassistant --script check_config --help +``` {% elsif page.installation == "core" %} @@ -30,10 +56,36 @@ _If your container name is something other than `homeassistant`, change that par 3. Run the configuration check + Run the full check: + ```bash hass --script check_config ``` + Listing all loaded files: + + ```bash + hass --script check_config --files + ``` + + Viewing a component’s configuration ([`light`](/integrations/light) in this example): + + ```bash + hass --script check_config --info light + ``` + + Or all components’ configuration + + ```bash + hass --script check_config --info all + ``` + + You can get help from the command line using: + + ```bash + hass --script check_config --help + ``` + 4. When that is complete restart the service for it to use the new files. {% endif %}