Split config - multiple automation files without directories

Apologies - I am a relative novice. I am strugling to find the best way of splitting my automations into different files (for clarity as there are many automations).

I would prefer to see the list of files in te same place as my current automations file i.e. avoid having to delve into a subfolder. But the only way I can find is to make a new “directory” (in this case is this the same as a folder?) and use one of the “advanced” !include commands (and unsure which of these would be best to use anyway…).

Can anyone point me in the right direction for either my prefered option or the best subfolder-based option? I have looked at a few of the examples of configs online but cannot see any showing a solution to my problem. Any pointers gratefully received :slight_smile:

I use packages, i.e. I have files per area of interest (solar/ electicity / transport /etc.) in which I add any type of integration so they stay nicely together which is also great when they are referrring one another

One subfolder ‘packages’ in which I have15 files

Packages - Home Assistant (home-assistant.io)

I personally use !include_dir_merge_list for my YAML automations. This allows you to create a subfolder and place your YAML automations in here in as many files as you like. You could have one for “Lights”, “Switches” etc, or even one automation per file, it doesn’t matter with the merge type. There is a good example of this right at the bottom of the splitting the configuration doc.

Personally I think this is the easiest type (as long as you remember to start all entries with a hyphen) but it doesn’t satisfy your wish of having them all on the top level (although depending how you split them up, it might be neater in a subfolder anyway!)

thanks for this - yes I did look at packages but couldn’t quite get my head round them at the time - will have to look again:)

if you use packages you will still need to create a folder to put the packages into. I don’t think it will work any other way.

if you want to have each automation in a different file I’m pretty sure you will need to create at least one subfolder to put them in.

thanks for this - will also have a better look at some youtube videos on working with yaml using visual studio code which I tend to use.

yes I agree it sounds like I will have to accept a tiered approach