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/splitting_configuration.markdown
+1-253Lines changed: 1 addition & 253 deletions
Original file line number
Diff line number
Diff line change
@@ -179,7 +179,7 @@ That about wraps it up.
179
179
180
180
If you have issues checkout `home-assistant.log` in the configuration directory as well as your indentations. If all else fails, head over to the [Gitter Chatroom](https://gitter.im/balloob/home-assistant) and ask away.
181
181
182
-
### {% linkable_title Advanced Usage %}
182
+
### {% linkable_title Advanced usage %}
183
183
184
184
We offer four advanced options to include whole directories at once.
185
185
@@ -190,255 +190,3 @@ We offer four advanced options to include whole directories at once.
190
190
`!include_dir_merge_list`will return content of a directory as a list by merging all files (which should contain a list) into 1 big list.
191
191
192
192
`!include_dir_merge_named`will return content of a directory as a dictionary by loading each file and merging it into 1 big dictionary.
193
-
194
-
#### {% linkable_title `!include_dir_list` Example %}
It is important to note that each file must contain only **one** entry when using `!include_dir_list`.
253
-
254
-
#### {% linkable_title `!include_dir_named` Example %}
255
-
256
-
`configuration.yaml`
257
-
258
-
```yaml
259
-
alexa:
260
-
intents:
261
-
LocateIntent:
262
-
action:
263
-
service: notify.pushover
264
-
data:
265
-
message: Your location has been queried via Alexa.
266
-
speech:
267
-
type: plaintext
268
-
text: >
269
-
{%- for state in states.device_tracker -%}
270
-
{%- if state.name.lower() == User.lower() -%}
271
-
{{ state.name }} is at {{ state.state }}
272
-
{%- endif -%}
273
-
{%- else -%}
274
-
I am sorry. Pootie! I do not know where {{User}} is.
275
-
{%- endfor -%}
276
-
WhereAreWeIntent:
277
-
speech:
278
-
type: plaintext
279
-
text: >
280
-
{%- if is_state('device_tracker.iphone', 'home') -%}
281
-
iPhone is home.
282
-
{%- else -%}
283
-
iPhone is not home.
284
-
{% endif %}
285
-
```
286
-
287
-
can be turned into:
288
-
289
-
`configuration.yaml`
290
-
291
-
```yaml
292
-
alexa:
293
-
intents: !include_dir_named alexa/
294
-
```
295
-
296
-
`alexa/LocateIntent.yaml`
297
-
298
-
```yaml
299
-
action:
300
-
service: notify.pushover
301
-
data:
302
-
message: Your location has been queried via Alexa.
303
-
speech:
304
-
type: plaintext
305
-
text: >
306
-
{%- for state in states.device_tracker -%}
307
-
{%- if state.name.lower() == User.lower() -%}
308
-
{{ state.name }} is at {{ state.state }}
309
-
{%- endif -%}
310
-
{%- else -%}
311
-
I am sorry. Pootie! I do not know where {{User}} is.
312
-
{%- endfor -%}
313
-
```
314
-
315
-
`alexa/WhereAreWeIntent.yaml`
316
-
317
-
```yaml
318
-
speech:
319
-
type: plaintext
320
-
text: >
321
-
{%- if is_state('device_tracker.iphone', 'home') -%}
322
-
iPhone is home.
323
-
{%- else -%}
324
-
iPhone is not home.
325
-
{% endif %}
326
-
```
327
-
328
-
#### {% linkable_title `!include_dir_merge_list` Example %}
329
-
330
-
`configuration.yaml`
331
-
332
-
```yaml
333
-
automation:
334
-
- alias: Automation 1
335
-
trigger:
336
-
platform: state
337
-
entity_id: device_tracker.iphone
338
-
to: 'home'
339
-
action:
340
-
service: light.turn_on
341
-
entity_id: light.entryway
342
-
- alias: Automation 2
343
-
trigger:
344
-
platform: state
345
-
entity_id: device_tracker.iphone
346
-
from: 'home'
347
-
action:
348
-
service: light.turn_off
349
-
entity_id: light.entryway
350
-
```
351
-
352
-
can be turned into:
353
-
354
-
`configuration.yaml`
355
-
356
-
```yaml
357
-
automation: !include_dir_merge_list automation/
358
-
```
359
-
360
-
`automation/presence.yaml`
361
-
362
-
```yaml
363
-
- alias: Automation 1
364
-
trigger:
365
-
platform: state
366
-
entity_id: device_tracker.iphone
367
-
to: 'home'
368
-
action:
369
-
service: light.turn_on
370
-
entity_id: light.entryway
371
-
372
-
- alias: Automation 2
373
-
trigger:
374
-
platform: state
375
-
entity_id: device_tracker.iphone
376
-
from: 'home'
377
-
action:
378
-
service: light.turn_off
379
-
entity_id: light.entryway
380
-
```
381
-
382
-
It is important to note that when using `!include_dir_merge_list`, you must include a list in each file (each list item is denoted with a hyphen [-]). Each file may contain one or more entries.
383
-
384
-
#### {% linkable_title `!include_dir_merge_named` Example %}
0 commit comments