Problem with including yaml files

Hi,

I would like to create multiple files for my automations and store them in a folder.
I’ve created a folder AUTOMATIONS and, as a test, I put my automations.yaml in there instead of the same emplacement of configuration.yaml

In my configuration.yaml I replace

automation: !include automations.yaml

by

automation: !include_dir_named AUTOMATIONS/

I read in the docs that this is the way to do to be able to include multiple yaml files wich are stored in a folder.

But this doesn’t work. My automations dosn’t work anymore

Do you have an idea why ?

Don’t move or edit automations.yaml.

You need this in configuration.yaml:

automation: !include automations.yaml
automation manual: !include_dir_merge_list AUTOMATIONS

Then the files are:

/config/automations.yaml
/config/AUTOMATIONS/other-files.yaml

with as many “other files” as you want, can be in subfolders. These are the files you edit. automations.yaml is where HA stores automations created in the UI.

2 Likes

To add to what Troon has said, when choosing an include type “include…named” is for dictionaries, “include…list” is for lists.

Lists have a “-” in front of each element. Dictionaries do not.

Look closely as your automations and scripts.

Automations are a list.

Scripts are a dictionary.

1 Like

Thanks, it works !
However, I can’t find somthing in the docs about writing “automation manual” to be able to include more automations yaml files :thinking:

Thanks for thoses additionnals info :+1:

See the link I posted above. manual is just the label I chose.

1 Like