Why are my automations not sorted alpabetically?

I have a mix of automatically created automations and ‘hand made’.
At some point in the later revisions of HA, some of them stopped appearing in alphabetical order.
an example:


I’m not sure, but it seems to be happening if I rename the automation.
This makes it rather complicated to find the automations.
So why does this happen, and how do I fix it?

I’ve started moving quite a few of them to node-red, so the problem gets less and less, but it’s still really odd?

where does it happen?

1 Like

Strange. I don’t normally look at Configuration > Automations but I just checked and the list of automations is sorted alphabetically on both my production server (0.103.2) and my test server (0.107.6).

Which version are you using?

1 Like

Not sure if it uses the alias or the ID for sorting… Perhaps check those.

1 Like

Uses ID to sort :slight_smile:

1 Like

I have 3 automations with an id and the rest do not have an id. Nevertheless, all of the automations appear alphabetically sorted in Configuration > Automations. Therefore it can’t be using id to sort them.

1 Like

NONE of my automations have an ID (192 of them) all under alias:
ALL sorted alphabetically

1 Like

Ahaaa, that might be it then. So I could just modify the ID I guess, and reload the automation.

Hi Ahmad, the snap is from the ‘automations’ overview in the settings.

I’m at 107.6 :slight_smile:

Configuration -> Automations (Automation Editor), to be precise.
Well, mine are sorted alphabetically (I’m on 0.107.6 :wink: ).
Do you know that you can go to Developer Tools -> States and filter your entities by entering automation.? Does it show the automations in the same order?
By the way, there you can quickly filter them by state, too, to show only those that are off, for example :wink:
Or type an automation’s name if you need to find it quickly.

1 Like

Hi Ahmad
Yes, I know, and it’s also viewable under entities, but neither places allow them to be edited :wink:

You can only edit them if they have an ID as well as an alias (in order to edit in GUI editor)

1 Like

what kind of editing are you talking about if I may ask?

1 Like

? Editing via the GUI of the automations.

Ah… never did that.
Well, if there is no search and it changed the way it works the only option I see is to create a feature request for either sort automations (alphabetically or else, with some options) or add search option.
Alternatively, use Ctrl-F :wink:

I found the same.
If I rename the automation, it continues to sort by the original name prior to renaming the automation using the gui editor

easy fix, use a custom Lovelace card:

- type: 'custom:auto-entities'
  filter:
    include:
      - domain: automation
  sort:
    method: name
  card:
    type: 'custom:fold-entity-row'
    head:
      type: section
      label: Automations

but will it allow to edit them?

if you don’t define IDs for you automations when you create them in Editor (and I presume you don’t), it generates ID for you and then uses it for sorting. And it does not change it if you change the name. That’s probably why you see this behaviour.

so adding sorting criteria to the Editor sounds sensible for people using it.

You might need to rename the entity…