Home Assistant Packages Instead of Include Files
说明与用途
将 Home Assistant 从按类型拆分的文件迁移到按区域拆分的包,旧实例和新实例并行运行,并自动化部署。
问题
Migrating a large Home Assistant configuration from a type‑split layout to a package‑per‑area layout while maintaining parallel operation of old and new instances.
结果
The migration succeeded with a clean package‑based configuration, parallel operation, and automated deployment, but package automations cannot be edited via the UI.
工作流
- Convert demo data to a package file.
- Create one package file per area, moving helpers, templates, automations, scripts and integrations into it.
- Enable shadow mode (initial_state: false) for new instance automations.
- Disable old instance automations for the area, then enable new instance ones.
- Use a deploy script to backup, rsync, check_config and reload domains.
- Repeat for each area in risk order (energy, helpers, lights, covers, heating, cameras, notifications).
证据
The Home Assistant config I am migrating away from is split by type, the way most guides show it: input_boolean.yaml, input_datetime.yaml, templates.yaml and one file per category under automations/. Together that is about 4,800 lines of YAML, of which about 2,900 lines are automations in 13 files.
Automations that come from a package cannot be edited in the UI editor. They show up in the UI and I can read their traces, but saving works only in YAML.
Once the new instance is connected to KNX, both instances share the bus for the rest of the migration. If the same automation runs on both, every action happens twice, so covers move twice and two push notifications go out.
- 记录日期: 2026-11-02T11:14:13.068Z