Getting "This automation cannot be edited from the UI, because it is not stored in the automations.yaml file, or doesn't have an ID." when opening automation

Hey forum. I have put the following in my configuration.yaml

automation: !include_dir_merge_list automations/

my goal is to have each of my automations in its own file under the “automations” directory. I create a yaml file under the automation directory, and the automations shows up fine in the “Automations” page in the UI. The automation also works just fine. However when i open it I see this message

" This automation cannot be edited from the UI, because it is not stored in the automations.yaml file, or doesn’t have an ID."

what am i missing here to be able to edit automations that are created in individual files under the automations directory to be editable in the UI

Hello jakeshbazi,

If it’s not actually included in the automations.yaml file that Home Assistant creates with the UI Automation editor, the UI Automation Editor cannot edit it.

May I ask, what benefit you see with this storage method for your Automations?

The deal is that if you want to use the UI editor, then HA controls the location and naming og the files, the entity_ids and the formatting of the YAML inside the files.
This is to ensure that the editor knows how to read the stored automations.
We humans add extras and “wrong” formatting to the YAML files to make it more readable and we do not do this in a coherent way, so it is hard to make an editor that can handle every single way we decide to do things.

Hey thanks for the questions. So I set up git along with the VS code integration. My goal is to be able to have versioning for better organization. I noticed that all automations are in a single file and that made me think of that’s a good idea…. Is that make sense or not and how if it’s better or not to have every automation separated into its own file.

Now that I think about it more, given a versioning system to track changes , maybe I don’t need this and it’s better to use it all in one file

I prefer to have it in several files, but that means no GUI, so it is all YAML editing.
YAML editing do add extra options at times, because not all options are available in the GUI at the moment.
The not_from and not_to options in automations require YAML still.

1 Like

The biggest thing I like about having my automations outside the automations.yaml file is that I can include comments and white space to make them more readable to me. This is very helpful when I come back later to try to remember what I’d done.

I also like being able to format the layout and order of the YAML in a way which makes sense to me. I find the auto-generated lines seem out of order, to my thinking.

While I’m at it, I also give each automation a meaningful ID. I know that’s not really visible anywhere else, but it helps when skimming through the automations in each file.