mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-06-05 01:36:49 +00:00
90 lines
6.2 KiB
Markdown
90 lines
6.2 KiB
Markdown
---
|
|
title: "Configuration.yaml"
|
|
description: "Configuring Home Assistant via text files."
|
|
related:
|
|
- docs: /docs/configuration/yaml/
|
|
title: YAML syntax
|
|
- docs: /docs/configuration/secrets
|
|
title: Storing credentials in `secrets.yaml` file
|
|
- docs: /common-tasks/os/#backups
|
|
title: Creating and restoring backups
|
|
- docs: /integrations/backup/docs/tools/dev-tools/#reloading-the-yaml-configuration
|
|
title: Creating backups for Home Assistant Container and Core
|
|
- docs: /docs/tools/dev-tools/#reloading-the-yaml-configuration
|
|
title: Reloading the YAML configuration from developer tools
|
|
- docs: /common-tasks/os/#configuring-access-to-files
|
|
title: Configuring file access on the Operating System
|
|
- docs: /common-tasks/supervised/#configuring-access-to-files
|
|
title: Configuring file access on Supervised
|
|
- docs: docs/configuration/troubleshooting/
|
|
title: Troubleshooting the configuration
|
|
---
|
|
|
|
While you can configure most of Home Assistant from the user interface, for some integrations, you need to edit the `configuration.yaml` file. This file contains {% term integrations %} to be loaded along with their configurations. Throughout the documentation, you will find snippets that you can add to your configuration file to enable specific functionality.
|
|
|
|
<p class='img'>
|
|
<img src='/images/docs/configuration/config-yaml_via-file-editor.png' alt='Screenshot of an example of a configuration.yaml file, accessed using the File editor add-on on a Home Assistant Operating System installation.'>
|
|
Example of a configuration.yaml file, accessed using the File editor add-on on a Home Assistant Operating System installation.
|
|
</p>
|
|
|
|
## Editing `configuration.yaml`
|
|
|
|
How you edit your `configuration.yaml` file depends on your editor preferences and the [installation method](/installation/#advanced-installation-methods) you used to set up Home Assistant.
|
|
|
|
### To set up access to the files and prepare an editor
|
|
|
|
Before you can edit a file, you need to know how to access files in Home Assistant and setup an editor.
|
|
File access depends on your [installation method](/installation/#advanced-installation-methods). If you use {% term "Home Assistant Operating System" %} or {% term "Home Assistant Supervised" %}, you can use editor add-ons, for example, but not if you use {% term "Home Assistant Core" %} or {% term "Home Assistant Container" %}.
|
|
|
|
1. To set up file access, follow the steps for your [installation method](/installation/#advanced-installation-methods):
|
|
|
|
- [Configuring file access on the Operating System](/common-tasks/os/#configuring-access-to-files)
|
|
- If you are unsure which option to choose, install the [file editor add-on](/common-tasks/os/#installing-and-using-the-file-editor-add-on).
|
|
- Alternatively, use the [VS Code add-on](/common-tasks/os/#installing-and-using-the-visual-studio-code-vsc-add-on). This editor offers live syntax checking and auto-fill of various Home Assistant entities. But it looks more complex than the file editor.
|
|
- If you prefer to use a file editor on your computer, use the [Samba add-on](/common-tasks/os/#installing-and-using-the-samba-add-on).
|
|
- [Configuring file access on Supervised](/common-tasks/supervised/#configuring-access-to-files)
|
|
- [File editor add-on](/common-tasks/supervised/#installing-and-using-the-file-editor-add-on).
|
|
- [VS Code add-on](/common-tasks/supervised/#installing-and-using-the-visual-studio-code-vsc-add-on).
|
|
- [Samba add-on](/common-tasks/supervised/#installing-and-using-the-samba-add-on).
|
|
|
|
2. To look up the to your configuration directory, go to {% my system_health title="**Settings** > **System** > **Repairs**" %}.
|
|
- Select the three dots menu and select **System information**.
|
|
|
|

|
|
|
|
3. Find out the location of the **Configuration directory**.
|
|
|
|

|
|
- Unless you changed the file structure, the default is as follows: -
|
|
- {% term "Home Assistant Operating System" %}: the `configuration.yaml` is in the `/config` folder of the installation.
|
|
- {% term "Home Assistant Container" %}: the `configuration.yaml` is in the config folder that you mounted in your container.
|
|
- {% term "Home Assistant Core" %}: the `configuration.yaml` is in the config folder passed to the `hass` command (default is `~/.homeassistant`).
|
|
|
|
## Validating the configuration
|
|
|
|
After changing configuration or automation files, you can check if the configuration is valid. A configuration check is also applied automatically when you reload the configuration or when you restart Home Assistant.
|
|
|
|
The method for running a configuration check depends on your [installation type](/installation/#advanced-installation-methods). Check the common tasks for your installation type:
|
|
|
|
- [Configuration check on Operating System](/common-tasks/os/#configuration-check)
|
|
- [Configuration check on Supervised](/common-tasks/supervised/#configuration-check)
|
|
- [Configuration check on Container](/common-tasks/container/#configuration-check)
|
|
- [Configuration check on Core](/common-tasks/core/#configuration-check)
|
|
|
|
## Reloading the configuration to apply changes
|
|
|
|
For configuration changes to become effective, the configuration must be reloaded. Most integrations in Home Assistant (that do not interact with {% term devices %} or {% term services %}) can reload changes made to their configuration in `configuration.yaml` without needing to restart Home Assistant.
|
|
|
|
1. Under **Settings**, select the three dots menu (top right), select **Restart Home Assistant** > **Quick reload**.
|
|
|
|

|
|
|
|
2. If you find that your changes were not applied, you need to restart.
|
|
- Select **Restart Home Assistant**.
|
|
- Note: This interrupts automations and scripts.
|
|
|
|

|
|
|
|
## Troubleshooting the configuration
|
|
|
|
If you run into trouble while configuring Home Assistant, refer to the [configuration troubleshooting page](/docs/configuration/troubleshooting/) and the [`configuration.yaml` examples](/examples/#example-configurationyaml). |