How to fix error: "Only automations in automations.yaml are editable"?

Hello,
I have automations in separate folder called automations so I have in my config file this:
automation: !include_dir_merge_list automations
Automation are working fine, but when I try to save a new one using UI editor, it is not saved. So I added new automation to my automations/automations.yaml manualy using external editor. Problem is that I cannot edit this automation using UI editor and all I get is this error: Only automations in automations.yaml are editable. Does that mean that UI editor doesn’t support folders?

Haw can I fix that?
Thank you.

See here: https://www.home-assistant.io/docs/automation/editor/#updating-your-configuration-to-use-the-editor

I see… So basically new UI editor doesn’t support folders.
Thanks.

Correct, it wouldn’t know what file to put the automations in.

For others who, like me, kept being led to this page while the folder structure wasn’t the cause of the error.

Beware that you need a unique id for each automation that you want to be editable. For automations created with the editor the id will be generated automatically.

https://www.home-assistant.io/docs/automation/yaml/#migrating-your-yaml-automations-to-automationsyaml

Best practice (IMO) is to reserve automations.yaml for UI-created automations, and keep your manual ones in the folder structure. I also add unique_ids to my manual ones (using this).

2 Likes

Interesting approach, thank you for sharing the link!

Makes sense not to edit the document that is used for the UI-created automations. However, I’ve had a few cases where I wanted to use the automation debugging tool for my manual automations. For this, it seems, I needed to put the manual automation in automations.yaml.

Or did you find a way to use the folder structure for manual automations while still retaining the ability to do automation debugging via the UI?

The debugger works fine with manual automations that have ids (not unique_ids, apologies) defined.

This automation is /config/automations/misc/kitchen-display-charger.yaml, and thus not editable in the UI.

So, in reality, you can have UI-editable automations outside automations.yaml after all?

I’m unable to use automation debugging via the UI for my automations in the packages folder. For these automations, I get the above error even though they have an id (i.e., Only automations in automations.yaml are editable). Perhaps it is necessary to have the automations included under automation: in configuration.yaml?

That’s not what I said. The debugger shows the traces (the clock icon), but you can’t edit the automation (the pencil icon).

image

Good to know. That makes things easier for me. I thought debugging was only accessible via the editor. Completely missed the other icon.

Thank you for the helpful screenshots!

automation: !include automations.yaml
automation split: !include_dir_list ./automations

1 Like

this worked for me:

I am moving automations to automations folder, one per file.
It works fine by using:

automation: !include automations.yaml
automation split: !include_dir_list ./automations

But automation can’t be edited on UI even if I am adding an id to every automation using UUID Generator.
I am getting the following “warning” when I open the automation with the UI


And if I open the automation with the yaml editor on the UI, I can see all my automation field without the id one.
Maybe, for some reason, the id field is not loaded when the config is processed?
Anyone was able to edit automation from the UI while they are stored on a different yaml file then automations.yaml??

Some more data I could find.
Giving a automation defined on the automations folder with something like

id: 4bee4558-91b8-46d7-8c69-95d3b1c3e84d
alias: my alias automation
....

When I click on the notification from the notification list, the URL that it try to open is:
https://[HOME_ASSISTANT_DOMAIN]/config/automation/edit/4bee4558-91b8-46d7-8c69-95d3b1c3e84d

but after a second it is redirected to:
https://[HOME_ASSISTANT_DOMAIN]/config/automation/show/automation.my_alias_automation

As the warning states, automations that aren’t in /config/automations.yaml can’t be edited in the UI.

The warning copy also said “or doesn’t have an ID”, I assume having ID was enough to be able to edit them from the UI.

How are you updating automation when you have them split into multiple files?
Do you manually update them on code?

2 Likes

Using the code editor of your choice