Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting not working #29

Closed
GeraldPape opened this issue May 31, 2023 · 7 comments
Closed

Sorting not working #29

GeraldPape opened this issue May 31, 2023 · 7 comments
Labels
bug Something isn't working released

Comments

@GeraldPape
Copy link

I have set sorting to order_by:current but this takes no effect:
grafik

@Sese-Schneider
Copy link
Owner

@GeraldPape that's weird! I assume this is because of the different orders of magnitude in the units 🤔
I will have a look.
Would you be able to share your full config with me?

@Sese-Schneider Sese-Schneider added the bug Something isn't working label May 31, 2023
@mx-vatte
Copy link

mx-vatte commented Jun 30, 2023

I can confirm that the ordering/sorting is also not working for me.

image
type: custom:energy-overview-card
entities:
  - power: sensor.ug_backofen_power
    voltage: sensor.ug_backofen_voltage
    current: sensor.ug_backofen_current
    name: UG Backofen
  - power: sensor.ug_backofen_2_power
    voltage: sensor.ug_backofen_2_voltage
    current: sensor.ug_backofen_2_current
    name: UG Backofen 2
  - power: sensor.ug_wz_tv_power
    voltage: sensor.ug_wz_tv_voltage
    current: sensor.ug_wz_tv_current
    name: UG WZ TV
  - power: sensor.schreibtisch_patrick_power
    voltage: sensor.schreibtisch_patrick_voltage
    current: sensor.schreibtisch_patrick_current
    name: Schreibtisch Patrick
  - power: sensor.ug_waschmaschine_power
    voltage: sensor.ug_waschmaschine_voltage
    current: sensor.ug_waschmaschine_current
    name: UG Waschmaschine
  - power: sensor.ug_trockner_power
    voltage: sensor.ug_trockner_voltage
    current: sensor.ug_trockner_current
    name: UG Trockner
  - power: sensor.schreibtisch_sandra_power
    voltage: sensor.schreibtisch_sandra_voltage
    current: sensor.schreibtisch_sandra_current
    name: Schreibtisch Sandra
  - power: sensor.ug_bad_lampe_power
    voltage: sensor.ug_bad_lampe_voltage
    current: sensor.ug_bad_lampe_current
    name: UG Bad Lampe
  - power: sensor.treppe_power
    voltage: sensor.treppe_voltage
    current: sensor.treppe_current
    name: Treppe
  - power: sensor.ug_kuehlschrank_power
    voltage: sensor.ug_kuehlschrank_voltage
    current: sensor.ug_kuehlschrank_current
    name: UG Kuehlschrank
  - power: sensor.ug_kuehlschrank_2_power
    voltage: sensor.ug_kuehlschrank_2_voltage
    current: sensor.ug_kuehlschrank_2_current
    name: UG Kuehlschrank 2
  - power: sensor.ug_kammer_kuehlschrank_power
    voltage: sensor.ug_kammer_kuehlschrank_voltage
    current: sensor.ug_kammer_kuehlschrank_current
    name: UG Kammer Kuehlschrank
  - power: sensor.ug_geschirrspuler_power
    voltage: sensor.ug_geschirrspuler_voltage
    current: sensor.ug_geschirrspuler_current
    name: UG Geschirrspueler
  - power: sensor.ug_geschirrspuehler_2_power
    voltage: sensor.ug_geschirrspuehler_2_voltage
    current: sensor.ug_geschirrspuehler_2_current
    name: UG Geschirrspueler 2
  - power: sensor.ug_gefrierschrank_gross_power
    voltage: sensor.ug_gefrierschrank_gross_voltage
    current: sensor.ug_gefrierschrank_gross_current
    name: UG Gefrierschrank gross
  - power: sensor.ug_gefrierschrank_klein_power
    voltage: sensor.ug_gefrierschrank_klein_voltage
    current: sensor.ug_gefrierschrank_klein_current
    name: UG Gefrierschrank klein
  - power: sensor.og_az_drucker_ir_heizung_power
    voltage: sensor.og_az_drucker_ir_heizung_voltage
    current: sensor.og_az_drucker_ir_heizung_current
    name: OG AZ Drucker+IR+Heizung
order_by: power
animation:
  inverted: false

@borodaaaaa
Copy link

borodaaaaa commented Aug 23, 2023

  • +1 Sorting does not work , Also dont look at the current , It is actually Daily consumption that I show this way. Tried removing it , so there just power alone - still the same

image

  - type: custom:energy-overview-card
    entities:
      - power: sensor.water_heater_active_power
        current: sensor.water_heater_consumption_today_2
        icon_trailing: mdi:water-boiler
        icon_leading: mdi:home-lightning-bolt-outline
      - power: sensor.stove_active_power
        current: sensor.stove_consumption_today
        icon_trailing: mdi:stove
        icon_leading: mdi:home-lightning-bolt-outline
      - power: sensor.coffee_machine_power
        current: sensor.coffee_machine_consumption_today_2
        icon_trailing: mdi:coffee-maker
        icon_leading: mdi:home-lightning-bolt-outline
      - power: sensor.ac_active_power
        current: sensor.ac_consumption_today_2
        icon_trailing: mdi:air-conditioner
        icon_leading: mdi:home-lightning-bolt-outline
      - power: sensor.dishwasher_active_power
        current: sensor.dishwasher_consumption_today
        icon_trailing: mdi:dishwasher
        icon_leading: mdi:home-lightning-bolt-outline
      - power: sensor.washing_machine_active_power
        current: sensor.washing_machine_consumption_today
        icon_trailing: mdi:washing-machine
        icon_leading: mdi:home-lightning-bolt-outline
      - power: sensor.plug_scooter_charger_active_power
        current: sensor.scooter_charger_consumption_today
        icon_trailing: mdi:scooter-electric
        icon_leading: mdi:home-lightning-bolt-outline
    order_by: power
    animation:
      inverted: false

@ad8mustanggt
Copy link

Not sure if this card is still maintained but I can confirm with the latest HASS version and the latest energy-overview-card version the "order_by" option doesn't work.

Sese-Schneider added a commit that referenced this issue Dec 29, 2023
github-actions bot pushed a commit that referenced this issue Dec 29, 2023
## [2.5.0](v2.4.2...v2.5.0) (2023-12-29)

### Features

* Add optional card title ([5abdfc2](5abdfc2))

### Bug Fixes

* Sorting not working ([#29](#29)) ([19a992d](19a992d))
@Sese-Schneider
Copy link
Owner

The bug is finally fixed in the lastest release!

cc: @ad8mustanggt @GeraldPape @borodaaaaa @mx-vatte

@mx-vatte
Copy link

Thank you very much! The sorting now works in general. But there is the a problem with sorting over units e.g. W and kW.

Screenshot_20231229-132148_Home_Assistant

@Sese-Schneider
Copy link
Owner

@mx-vatte this is a known limitation right now unfortunately ...
I have to trade of being able to sort different types (power, voltage, etc) and converting numbers to compare.

Feel free to open a new issue for this please or try to implement a fix.
You can set the unit of measurement in your HA entity to have it uniform across the card, and have the sorting working for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

5 participants