From 28d69e8598179a31a95658c9254b615aa15c2c0a Mon Sep 17 00:00:00 2001 From: c0ffeeca7 Date: Mon, 26 May 2025 10:32:05 +0200 Subject: [PATCH] Common tasks: remove configuration check include file - with Supervisor and Core gone, there is no longer and reuse - move remaining steps into OS and Container file instead As per architecture discussion on home-assistant/architecture#1197, and home-assistant/architecture#1198 https://www.home-assistant.io/blog/2025/05/22/deprecating-core-and-supervised-installation-methods-and-32-bit-systems --- .../common-tasks/configuration_check.md | 109 ------------------ source/common-tasks/container.markdown | 37 +++++- source/common-tasks/os.markdown | 21 +++- 3 files changed, 56 insertions(+), 111 deletions(-) delete mode 100644 source/_includes/common-tasks/configuration_check.md diff --git a/source/_includes/common-tasks/configuration_check.md b/source/_includes/common-tasks/configuration_check.md deleted file mode 100644 index 993ef257afa..00000000000 --- a/source/_includes/common-tasks/configuration_check.md +++ /dev/null @@ -1,109 +0,0 @@ -## 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 - -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 {% term 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). - -### 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. - -```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: - -```bash -docker exec homeassistant python -m homeassistant --script check_config --config /config -``` - -Listing all loaded files: - -```bash -docker exec homeassistant python -m homeassistant --script check_config --files -``` - -Viewing an integration’s configuration ([`light`](/integrations/light) in this example): - -```bash -docker exec homeassistant python -m homeassistant --script check_config --info light -``` - -Or all integrations’ 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" %} - -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. - - ```bash - source /srv/homeassistant/bin/activate - ``` - -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 integration’s configuration ([`light`](/integrations/light) in this example): - - ```bash - hass --script check_config --info light - ``` - - Or all integrations’ 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 %} diff --git a/source/common-tasks/container.markdown b/source/common-tasks/container.markdown index 841e2af514b..ee41a9b3144 100644 --- a/source/common-tasks/container.markdown +++ b/source/common-tasks/container.markdown @@ -14,4 +14,39 @@ To learn how to back up the system or how to restore a system from a backup, ref {% include common-tasks/specific_version.md %} {% include common-tasks/beta_version.md %} {% include common-tasks/development_version.md %} -{% include common-tasks/configuration_check.md %} + +## Configuration check + +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: + +```bash +docker exec homeassistant python -m homeassistant --script check_config --config /config +``` + +Listing all loaded files: + +```bash +docker exec homeassistant python -m homeassistant --script check_config --files +``` + +Viewing an integration’s configuration ([`light`](/integrations/light) in this example): + +```bash +docker exec homeassistant python -m homeassistant --script check_config --info light +``` + +Or all integrations’ 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 +``` diff --git a/source/common-tasks/os.markdown b/source/common-tasks/os.markdown index 833a4e851ae..4d589c7ac4f 100644 --- a/source/common-tasks/os.markdown +++ b/source/common-tasks/os.markdown @@ -96,7 +96,26 @@ Alternatively, if the Operating Systems runs on a platform that uses the GRUB bo {% include common-tasks/network_storage.md %} {% include common-tasks/lost_password.md %} {% include common-tasks/third-party-addons.md %} -{% include common-tasks/configuration_check.md %} + +## Configuration check + +After changing configuration or automation files, check if the configuration is valid before restarting Home Assistant Core. + +### Running 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 {% term 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). + +### 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. + +```bash +ha core check +``` ## Home Assistant versions