There is a special card for batteries that is useful here as well:
- type: custom:auto-entities
card:
type: custom:battery-state-card
filter:
include:
- attributes:
device_class: battery
state: "< 50" # Changed for the example
exclude:
- integration: mobile_app
sort:
method: state
reverse: true
card_mod:
style: |
ha-card {
border: none !important
}
Here is my extended setup, showing all batteries:

Full config:
type: custom:vertical-stack-in-card
title: Batteries
cards:
- type: custom:auto-entities
title: Batteries needing attention
card:
type: custom:battery-state-card
filter:
include:
- attributes:
device_class: battery
state: < 25
exclude:
- integration: mobile_app
- name: Kostal-*
sort:
method: state
numeric: true
card_mod:
style: |
ha-card {
border: none !important
}
- type: custom:auto-entities
card:
type: custom:battery-state-card
filter:
include:
- attributes:
device_class: battery
state: unknown
- attributes:
device_class: battery
state: unavailable
exclude:
- integration: mobile_app
- name: Kostal-*
sort:
method: state
numeric: true
card_mod:
style: |
ha-card {
border: none !important
}
- type: custom:auto-entities
card:
type: custom:battery-state-card
filter:
include:
- attributes:
device_class: battery
state: '>= 25'
exclude:
- integration: mobile_app
- name: Kostal-*
sort:
method: state
numeric: true
card_mod:
style: |
ha-card {
border: none !important
}