You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/_topics/packages.markdown
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,7 @@ sharing: true
9
9
footer: true
10
10
---
11
11
12
-
## {% linkable_title About %}
13
-
14
-
Packages in Home Assistant provides a way to bundle different component's configuration together. We were already introduced to the two configuration styles (specifying platforms entries together or individually) on the [adding devices](/getting-started/devices) page. Both of these configuration methods require you to create the component key in the main `configuration.yaml` file. With packages we have a way to include different components, or parts of configuration using any of the `!include` directives introduced in [splitting the configuration](/topics/splitting_configuration).
12
+
Packages in Home Assistant provides a way to bundle different component's configuration together. We were already introduced to the two configuration styles (specifying platforms entries together or individually) on the [adding devices](/getting-started/devices/) page. Both of these configuration methods require you to create the component key in the main `configuration.yaml` file. With packages we have a way to include different components, or parts of configuration using any of the `!include` directives introduced in [splitting the configuration](/topics/splitting_configuration).
15
13
16
14
Packages are configured under the core `homeassistant/packages` in the configuration and take the format of a packages name (no spaces, all lower case) followed by a dictionary with the package config. For example, package `pack_1` would be created as:
17
15
@@ -20,12 +18,12 @@ homeassistant:
20
18
...
21
19
packages:
22
20
pack_1:
23
-
...package config here...
21
+
...package configuration here...
24
22
```
25
23
26
24
The package configuration can include: `switch`, `light`, `automation`, `groups` or the majority of the Home Assistant components.
27
25
28
-
It can be specified inline, or in a seperate yaml file using `!include`
26
+
It can be specified inline, or in a seperate YAML file using `!include`
29
27
30
28
Inline example, main `configuration.yaml`:
31
29
@@ -43,13 +41,16 @@ homeassistant:
43
41
```
44
42
45
43
Include example, main `configuration.yaml`:
44
+
46
45
```yaml
47
46
homeassistant:
48
47
...
49
48
packages:
50
49
pack_1: !include my_package.yaml
51
50
```
51
+
52
52
The file `my_package.yaml` contains the "top-level" configuration:
53
+
53
54
```
54
55
switch:
55
56
- platform: rest
@@ -73,20 +74,18 @@ There are some rules for packages that will be merged:
73
74
```
74
75
4. Any component that is not a platform [2], or dictionaries with Entity ID keys [3] cannot be merged and can only occur once between all packages and the main config
75
76
76
-
77
77
<p class='note tip'>
78
78
Components inside packages can only specify platform entries using configuration style 1, where all the platforms are grouped under the component name.
79
79
</p>
80
80
81
-
82
81
### {% linkable_title Create a packages folder %}
83
82
84
-
One way to organise packages would be to create a folder named "packages" in your Home Assistant configuration directory. In the packages directory you can store any number of packages in a yaml file. This entry in your `configuration.yaml` will load all packages:
83
+
One way to organise packages would be to create a folder named "packages" in your Home Assistant configuration directory. In the packages directory you can store any number of packages in a YAML file. This entry in your `configuration.yaml` will load all packages:
85
84
86
85
```yaml
87
86
homeassistant:
88
87
packages: !include_dir_named packages
89
88
```
90
89
91
90
This uses the concept splitting the configuration and will include all files in a directory with the keys representing the filenames.
92
-
See the documentation about [splitting the configuration](/topics/splitting_configuration) for more information about `!include_dir_named` and other include statements that might be helpful.
91
+
See the documentation about [splitting the configuration](/topics/splitting_configuration/) for more information about `!include_dir_named` and other include statements that might be helpful.
0 commit comments