feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Web Server Component - allow custom order of elements

Open MagMeister opened this issue 2 years ago • 3 comments

In web server V1, the order in which elements are displayed in the web interface are determined by type (sensor, switch, ...) and the order in which they appear in the configuration file.

Since web server V2 the order is alphabetical by name.

It would be useful if it were possible to define an order for each element, in the style of a "z-index" and in second, the sorting could then be done alphabetically.

MagMeister avatar Jun 19 '22 05:06 MagMeister

Any update?

dmachadol avatar Feb 23 '23 14:02 dmachadol

Yeah this is annoying. Perhaps:

  1. Sort type: Defaulting to "alpha by name" for v2 backwards compatibility?
  2. Sort type: "index", uses an item's "sort_index: #" value (default 0). No errors -- components with the same index # receive the same rank and, thus, an arbitrary order.

For optional grouping, higher up hierarchy components could possibly also allow sort_index, where the sort would bring their children together. If not specified, perhaps a default of -1 would be useful, where they do not receive a sort. OR we have a "sorted: true/false" on them.

I'm a bit new to esphome config so I'm not sure how compatible this all is with the config philosophy.

jaggzh avatar Jul 31 '23 11:07 jaggzh

For certain, I think this would be a fantastic idea. If only for testing and development. I usually interface with all my devices through HA, but when setting up a new device, getting it's calibrations right, etc, I do use the web server component, and it can be quite annoying when you have sensors that should be grouped, be at opposite ends of the list.

I hope something like this does get implemented in a future release.

bilbs84 avatar Feb 29 '24 07:02 bilbs84

hello all, i guess this idea was not implemented ?

smarthomedesign avatar Mar 29 '24 14:03 smarthomedesign

Work in progress: https://github.com/esphome/esphome/pull/6445

nagyrobi avatar Mar 29 '24 14:03 nagyrobi