Script component always sorted alphanumerically

Hi!

New user here. I discovered a possible bug, but maybe i’m just missing something. Scripts always seem to be ordered alphanumerically and not in the order they were defined like with groups. Example:

I define the following group in groups.yaml:

test_view:
  name: Test View
  view: yes
  entities:
    - light.kueche
    - switch.mediarack
    - script.screen_up
    - script.screen_down    

with the scripts defined in scripts.yaml:

  screen_up:
    url: 'http://XXXXXXXXXXXXXXXXXXX:5000/api/screen_up'

  screen_down:
    url: 'http://XXXXXXXXXXXXXXXXXXX:5000/api/screen_down'

this results in the following view:

As can be seen, the scipt ‘Screen Down’ comes before ‘Screen Up’. This also happens to all my scripts and unfortunately there are many, since I moved my whole home automation setup to HASS-scripts, until I have time to implement the platforms nativly.

Is it possible to change this somehow? Is it a bug since other components get sorted accordingly?

I can’t test, but try this:

test_view:
  name: Test View
  view: yes
  entities:
    - light.kueche
    - switch.mediarack
    - group.test_scripts 

test_scripts:
  name: Scripts
  entities:
    - script.screen_up
    - script.screen_down

Well, that did the trick. Thanks!

1 Like