Adjust check config documentation (#18411)

This commit is contained in:
Joakim Sørensen 2021-07-06 19:40:41 +02:00 committed by GitHub
parent a56e917892
commit b1a0c1ec45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 12 deletions

View File

@ -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

View File

@ -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).

View File

@ -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)

View File

@ -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 components 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 components 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 %}