配置.yaml.


虽然您可以直接从用户界面配置大多数主助手配置, some parts need you to edit 配置.yaml. This file contains 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.

如果您在配置家庭助理时遇到麻烦,请参阅配置故障排除页面配置.yaml例子.

编辑Configuration.yaml.

The easiest option to edit 配置.yaml is to use the Visual Studio代码加载项。 VS代码提供实时语法检查和自动填充各种主助手实体(如果您的系统不可用,请使用文件编辑器加载项反而)。

如果您希望在计算机上使用文件编辑器,请使用Samba附加组件访问文件作为网络共享。

If you use Home Assistant Container, you can find 配置.yaml in the config folder that you mounted in your container.

If you use Home Assistant Core, you can find 配置.yaml in the config folder passed to the hass command (default is ~/.homeasssistant).

重新加载变更

Most integrations in Home Assistant that do not interact with devices or services can reload changes made to their configuration in 配置.yaml. To do this, go to 配置 ->服务器控件并向下滚动到yaml配置重新加载部分(替代,在UI中命中“C”并搜索)。

如果您无法在那里看到您的集成,则需要重新启动Home Assistant以进行更改以生效。

从命令行测试对配置文件的任何更改,请查看常见任务操作系统, 监督, 容器, 如何做到这一点。也可以通过导航到ui来测试配置更改配置 ->服务器控件并单击“检查配置”。

迁移到新系统

迁移到新系统的首选方法是做一个备份.

If you run the container or core installation methods, you will need to manually make a backup of your configuration folder. Be aware that some of the files you need start with ., which is hidden by default from both ls (in SSH), in Windows Explorer, and macOS Finder. You’ll need to ensure that you’re viewing all files before you copy them.