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

{{ device.name }}

{% if ha_enabled and device.ha_entity_id and ha_live_pct is not none %} {% set _pct = ha_live_pct %} {% set _fill = ((_pct / 100) * 48) | int %} {% if _pct < 20 %}{% set _color = '#ef4444' %} {% elif _pct < 60 %}{% set _color = '#f59e0b' %} {% else %}{% set _color = '#22c55e' %}{% endif %}
{% if _fill > 0 %} {% endif %} {{ _pct }}%
{% endif %} {% if device.device_type %} {% endif %} {% if device.battery_size %} {% endif %} {% if device.has_mixed_brands() %} {% endif %} {% if device.location %} {% endif %} {% if device.notes %} {% endif %} {% if ha_enabled and device.ha_entity_id %} {% endif %}
Slots {{ device.installed_count() }} / {{ device.battery_slots }} used
Type {{ device.device_type }}
Battery Size {{ device.battery_size }}
Warning ⚠ Mixed brands installed
Location {{ device.location }}
Notes {{ device.notes }}
HA Live % {% if ha_live_pct is not none %} {% if ha_live_pct < 20 %} ⚠ {{ ha_live_pct }}% {% else %} {{ ha_live_pct }}% {% endif %} {% else %} {% endif %}

Install Batteries

{% set free_slots = device.battery_slots - device.installed_count() %}

{{ free_slots }} slot(s) free{% if device.battery_size %} — showing {{ device.battery_size }} batteries only{% endif %}

Brand Qty

Installed Batteries

{% set installed = device.batteries | selectattr('status', 'eq', 'installed') | list %} {% if installed %}
{% if ha_enabled %}{% endif %} {% for b in installed %} {% if ha_enabled %} {% endif %} {% endfor %}
LabelBrandBat %NotesActions
{{ b.label }} {{ b.brand }} {% if b.battery_percentage is not none %} {% if b.battery_percentage < 20 %} ⚠ {{ b.battery_percentage }}% {% else %}{{ b.battery_percentage }}%{% endif %} {% else %}—{% endif %} {{ b.notes or '—' }}
{% else %}

No batteries installed.

{% endif %}

Install Specific Battery{% if device.battery_size %} ({{ device.battery_size }} only){% endif %}

{% if available_batteries %}
{% else %}

No available batteries.

{% endif %}

Logbook

{% if logbook_entries %}
{% for entry in logbook_entries %}
{{ entry.recorded_at }}
{{ entry.body }}
{% endfor %}
{% else %}

No logbook entries yet.

{% endif %}

Add Entry

Edit Device

{% set _preset_types = ['Remote Control','Game Controller','Flashlight','Lock','Sensor','Toy','Clock','Smoke Detector'] %}
{% set _preset_sizes = ['AA','AAA','C','D','9V','CR2032','CR2025','CR2016','18650','14500','16340','26650','LR44/AG13'] %}
{% if ha_enabled %}
{% endif %}

Delete Device

Deleting this device will unassign all installed batteries and mark them available.

← Back to Devices {% if ha_enabled %} {% endif %} {% endblock %}