evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Sort consumers alphabetically (energy flow lists them in creation order)

Open ghaeprv opened this issue 1 month ago • 2 comments

Is your feature request related to a problem? Please describe. The energy flow lists consumers (additional meters used as consumers) in the order they were created. With 16 consumers, every new device lands at the bottom and the list ends up in no useful order. The Config UI has no way to change it: Energyflow.vue renders [...consumers, ...aux] as configured, and Config.vue lists site.consumer without a move or drag option.

Describe the solution you'd like A simple alphabetical sort of the consumers, in the energy flow and in the Config UI, would be enough. A manual order (drag and drop, or up and down buttons) would be a nice extra, but is not needed.

Describe alternatives you've considered

  • A display option that sorts the energy flow list by current power.
  • Reordering consumerMeters in the database by hand with evcc stopped. It works, but no user should have to do it, and it silently changes the id tag of the InfluxDB consumersPower and consumersEnergy series, because that id is the list position. Any reorder feature would have the same side effect, so it may be worth tagging those series by meter name instead.

Additional context evcc 0.318.1, all consumers configured in the UI (database).

🤖 Generated with Claude Code

ghaeprv avatar Oct 26 '26 21:10 ghaeprv

The code matches the description: assets/js/components/Energyflow/Energyflow.vue renders [...consumers, ...aux] in site order, and assets/js/views/Config.vue builds consumerMeters from site.consumer (new entries are pushed to the end) without any reordering control. Saving a reordered site.consumer list is possible via the existing saveSite("consumer"), so the UI part looks feasible. The InfluxDB side effect (series id tag = list position) would need a decision before reordering is offered.

No similar issue found in the last 3 months. Needs a maintainer decision on the UI approach (drag and drop vs. sorting option) and the InfluxDB tagging.

🤖 Generated with Claude Code

github-actions[bot] avatar Oct 26 '26 21:10 github-actions[bot]

Good point. Adding manual sorting (drag & drop) in config ui sounds like something we could introduce eventually. For now going with alphabetical for consumers sounds like a good and pragmatic move.

Exception: On the new energy page we show them sorted by energy used descending (color assign already happens alphabetically for stability). This will be kept since sorting also transports meaning here.

Image

I'll provide a PR.

naltatis avatar Oct 27 '26 08:10 naltatis