{# plugins/unifi/templates/unifi/rows.html #} {# ── WAN health bar ───────────────────────────────────────────────────────── #} {% if latest_wan %}
WAN {% if latest_wan.is_up %}✓ Up{% else %}✗ Down{% endif %} {% if latest_wan.wan_ip %} {{ latest_wan.wan_ip }} {% endif %} {% if latest_wan.latency_ms is not none %} Latency {{ "%.1f"|format(latest_wan.latency_ms) }}ms {{ sparkline_latency | safe }} {% endif %} {% if latest_wan.rx_bytes_rate is not none %} ↓ RX {% set bps = latest_wan.rx_bytes_rate %} {% if bps >= 1048576 %}{{ "%.1f"|format(bps / 1048576) }} MB/s {% elif bps >= 1024 %}{{ "%.0f"|format(bps / 1024) }} KB/s {% else %}{{ "%.0f"|format(bps) }} B/s{% endif %} {{ sparkline_rx | safe }} ↑ TX {% set bps = latest_wan.tx_bytes_rate %} {% if bps >= 1048576 %}{{ "%.1f"|format(bps / 1048576) }} MB/s {% elif bps >= 1024 %}{{ "%.0f"|format(bps / 1024) }} KB/s {% else %}{{ "%.0f"|format(bps) }} B/s{% endif %} {{ sparkline_tx | safe }} {% endif %} {% if latest_wan.uptime_seconds is not none %} up {{ (latest_wan.uptime_seconds // 3600) }}h {{ ((latest_wan.uptime_seconds % 3600) // 60) }}m {% endif %}
{% endif %} {# ── Content columns ──────────────────────────────────────────────────────── #}
{# Client summary card #} {% if latest_clients %}
Clients {{ sparkline_clients | safe }}
{{ latest_clients.total_clients }} total {{ latest_clients.wireless_clients }}↗ wireless   {{ latest_clients.wired_clients }}↔ wired {% if latest_clients.guest_clients %}  {{ latest_clients.guest_clients }} guest{% endif %}
{% endif %} {# Infrastructure devices card #} {% if devices %}
Infrastructure Devices
{% for d in devices %} {% if d.state == 1 and d.uptime_seconds %} {% endif %} {% endfor %}
{{ d.name or d.mac }} {{ d.model or d.device_type or "" }} {{ d.ip or "" }}
up {{ (d.uptime_seconds // 86400) }}d {{ ((d.uptime_seconds % 86400) // 3600) }}h
{% endif %} {# Top talkers card #} {% if top_clients %}
Top Talkers
{% for c in top_clients %} {% endfor %}
{{ c.hostname }} {% if c.type == "wireless" and c.signal %} {{ c.signal }}dBm {% endif %} {% set rx = c.rx_rate %}{% set tx = c.tx_rate %} {% if rx >= 1048576 %}{{ "%.1f"|format(rx/1048576) }}M {% elif rx >= 1024 %}{{ "%.0f"|format(rx/1024) }}K {% else %}{{ "%.0f"|format(rx) }}B{% endif %} {% if tx >= 1048576 %}{{ "%.1f"|format(tx/1048576) }}M {% elif tx >= 1024 %}{{ "%.0f"|format(tx/1024) }}K {% else %}{{ "%.0f"|format(tx) }}B{% endif %}
{% endif %} {# WLAN SSIDs card #} {% if wlan_latest %}
Wireless Networks
{% for w in wlan_latest %} {% endfor %}
SSID Clients Score
{{ w.ssid }} {{ w.num_sta }} {% if w.satisfaction is not none %}{{ w.satisfaction }}%{% else %}—{% endif %}
{% endif %} {# Speedtest card #} {% if speedtest %}
Last Speed Test
{% if speedtest.download_mbps is not none %} ↓ DL {{ "%.1f"|format(speedtest.download_mbps) }} Mbps {% endif %} {% if speedtest.upload_mbps is not none %} ↑ UL {{ "%.1f"|format(speedtest.upload_mbps) }} Mbps {% endif %} {% if speedtest.latency_ms is not none %} Latency {{ "%.0f"|format(speedtest.latency_ms) }}ms {% endif %}
{% if speedtest.server_name %}
via {{ speedtest.server_name }}
{% endif %}
{{ speedtest.run_at.strftime("%Y-%m-%d %H:%M") }} UTC
{% endif %}
{% if not latest_wan and not devices %}

No UniFi data yet. Check your host, username, and password in the plugin config.

{% endif %}