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.

1 Like

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.

I get this message but have a different question – all my automations (of interest) are in automations.yaml and have unique IDs. I can use the GUI to see each automation flow, see traces etc – all reasons I did this.

However, the two requirements listed in the message (in automations.yaml with unique ID) do not seem to be the only requirements. If I click on the automation so I can see the automation flow, I’m not presented with the option to edit it (the option to migrate is presented). I can click the hamburger menu and “edit in yaml” and the yaml text comes up but interestingly… there is no “id:” line present, even though it is in reality in the automations.yaml file for that integration.

Wondering if anyone has insight into what else HA is looking for here before I dig in randomly trying to figure this out. I was planning to save off a copy of the yaml file, then migrate an automation – I’m guessing I’ll lose all comments, possibly all other automations that haven’t been migrated?

This is more curiosity than anything. My guess is having HA manage the automations.yaml means I can’t have comments in the actual yaml. If it could update and format the yaml code just for that particular section (leaving other automations and comments between “active” code alone) this GUI editing could work for me, but if it formats the entire file each time and strips comments I will just move on.

You can not edit anything in the configuration.yaml from GUI.
I did not know you could migrate it, but my guess is it will move the automation to the GUi file and just disable the one from configuration.yaml.

I put too much in that post. Everything is in automations.yaml already, the “stated requirements” seem to be met (unique id for each) but no go on gui editing. So I’m guessing there are other, unstated requirements – such as no comments, particular formatting, etc. and was asking if anyone could clarify.

It would be nice to have the GUI option, but not if it means no in-line commentary.

Yeah, that is not possible.
It is either GUI with it moving around in the format and removing “unnecessary” stuff, or no GUI and the ability to get the format you prefer.

1 Like

Interesting. I thought about adding a feature request, did a cursory search and found this nugget… looks like I should look into the “description” field. Per the linked comment it can be as long as necessary, use markdown and appears at the top of the GUI. Personally I was going to suggest being able to add comments in the GUI per section, maybe that appear as popups as you hover, but I’m good with this description field as well.