2024.4: Organize all the things!

I used the category feature for my 130 automations and 30 or so scripts.

I found that using the GUI convert method to be annoying because it actually duplicates your yaml automation, which you then have to remove by deleting or renaming the old yaml files. You end up with all the new automations with an entity names that are suffixed _2. And a lot of old automation entities that you have to delete one by one.

There is a much easier way.

Do these steps

  1. Make sure all the yaml automations have an id. It can be any string. It just have to be unique. If you had to add any to add, reload automations.

  2. Make sure that all your existing automations are defined as a list. Ie each automation starts with a “-”

  3. Make a safety copy of your existing automations.yaml file unless it is empty

  4. Copy all your yaml automations into the automations.yaml file. Just append with what is already. Do not reload automations at this time!!!

  5. Rename your old automations files to something that does not end with .yaml (or move the file to a location that HA does not include automations from)

5 Reload automations in HA

6 Go to the automations in Settings. Pick any of them and edit yaml (in the 3-dot menu in the upper right corner). Add a space somewhere and delete it again. And save. This makes HA rewrite the automations.yaml file.

7 Now you can organize all the automations like you had then in files and folders by using Category feature maybe combined with labels.

Note that all comments are deleted when you do this. But you can use the description field for each automation to put your notes. It can be multiple lines. You can edit this in the GUI. It is part of the rename automation feature. You leave the name unchanged and you can add or change the description below. In practical this is fine for those little details you know you will forget.

When you do it this way, nothing is duplicated, nothing is renamed. It all works like before except now you can edit the automations via the GUI incl editing each automation as yaml in the GUI

What held many of us from using the GUI was the horror of one long list of automations. The category feature alone has done it for me. I have around 10 categories for my 130 automations. That is plenty to organize them so I can find things quickly. I love that new feature!!

9 Likes