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

Sort by state using percentage gives unexpected sort order #485

Open
thecreaser opened this issue Jan 17, 2025 · 1 comment
Open

Sort by state using percentage gives unexpected sort order #485

thecreaser opened this issue Jan 17, 2025 · 1 comment

Comments

@thecreaser
Copy link

I have a card showing battery percentages. All battery entities have attributes state_class: measurement, unit_of_measurement: %, device_class: battery and have the string battery in their entity ids and names.

Entities with 100% battery level seem to be sorted in the wrong position i.e. the 100% is treated as 1%
This happens irrespective of the sort order.

type: custom:auto-entities
card:
  type: entities
  title: Batteries
  state_color: true
  show_header_toggle: false
filter:
  include:
    - entity_id: sensor.*battery*
  exclude:
    - entity_id: sensor.*battery*state*
sort:
  method: state
  reverse: false

Image

@ildar170975
Copy link

Try with numeric: true:

type: custom:auto-entities
card:
  type: entities
  title: Batteries
  state_color: true
filter:
  include:
    - domain: sensor
      attributes:
        device_class: battery
sort:
  method: state
  numeric: true
  reverse: false

This is not a bug, this is a question.
Suggest to ask questions in Community: https://community.home-assistant.io/t/auto-entities-automatically-fill-cards-with-entities/147801.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants