{% extends "base.html" %} {% block title %}Dashboard — Battery Tracker{% endblock %} {% block content %}

Battery Dashboard

{% 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 | rejectattr('status', 'equalto', 'retired') | 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) }}
{% if na_low_cap %}
Low Capacity (<80%)
{% for b in na_low_cap %}
{{ b.label }} — {{ (b.tested_capacity_mah / b.capacity_mah * 100)|int }}% of rated
{% endfor %}
{% endif %} {% if na_low_pct %}
Low Battery %
{% for b in na_low_pct %}
{{ b.label }} — {{ b.battery_percentage }}%
{% endfor %}
{% endif %}
{% endif %}
{% if ha_enabled %}{% endif %} {% for b in batteries %} {% if ha_enabled %} {% endif %} {% else %} {% endfor %}
Label Brand Size Status Assigned To Actions
{{ b.label }} {{ b.brand }} {{ b.size or '—' }} {{ b.status|capitalize }} {% if b.device %} {{ b.device.name }} {% if b.device.has_mixed_brands() %} ⚠ mixed {% endif %} {% else %} {% endif %} View {% if not b.is_retired() %} {% endif %} {% if b.is_available() %} {% endif %} {% if b.is_installed() %} {% endif %} {% if not b.is_retired() %} {% endif %}
No batteries found. Add some.
{% endblock %}