{% set total = batteries|length %}
{% set available = batteries|selectattr('status','eq','available')|list|length %}
{% set installed = batteries|selectattr('status','eq','installed')|list|length %}
{% set retired = batteries|selectattr('status','eq','retired')|list|length %}
{{ total }}
Total
{{ available }}
Available
{{ installed }}
Installed
{{ retired }}
Retired
{% if ha_enabled %}
{% set low_pct = batteries | selectattr('battery_percentage', 'ne', none) | selectattr('battery_percentage', 'lt', 20) | list %}
{% if low_pct %}
{{ low_pct|length }}
Low Battery
{% endif %}
{% endif %}
{% if total_charges %}
Charged {{ total_charges }}× total{{ charges_last_year }}× in last year
{% endif %}
{% set na_low_cap = needs_attention.low_capacity %}
{% set na_low_pct = needs_attention.low_pct %}
{% if na_low_cap or na_low_pct %}
⚠Needs Attention {{ (na_low_cap|length) + (na_low_pct|length) }}