{# plugins/unifi/templates/unifi/widget.html #} {# Active alarms #} {% for al in active_alarms %}
⚠ {{ al.alarm_key }} alarm
{% endfor %} {# Offline device alerts #} {% for d in offline_devices %}
⚠ {{ d.name or d.mac }} offline
{% endfor %} {% if active_alarms or offline_devices %}
{% endif %} {% if latest_wan %}
WAN
{% if latest_wan.is_up %}Up{% else %}Down{% endif %} {% if latest_wan.latency_ms is not none %} lat {{ "%.0f"|format(latest_wan.latency_ms) }}ms {% endif %} {% if latest_wan.rx_bytes_rate is not none %} {% 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 %} {% 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 %} {% endif %}
{% endif %} {% if latest_clients %}
Clients
{{ latest_clients.total_clients }} {{ latest_clients.wireless_clients }}w / {{ latest_clients.wired_clients }}e
{% endif %} {% if top_clients %}
{% for c in top_clients %}
{{ c.hostname }}
{% set total_bps = c.tx_rate + c.rx_rate %} {% set rx = c.rx_rate %} {% if rx >= 1048576 %}{{ "%.1f"|format(rx / 1048576) }}M {% elif rx >= 1024 %}{{ "%.0f"|format(rx / 1024) }}K {% else %}{{ "%.0f"|format(rx) }}B{% endif %} {% set tx = c.tx_rate %} {% if tx >= 1048576 %}{{ "%.1f"|format(tx / 1048576) }}M {% elif tx >= 1024 %}{{ "%.0f"|format(tx / 1024) }}K {% else %}{{ "%.0f"|format(tx) }}B{% endif %}
{% endfor %}
{% endif %} {% if not latest_wan and not latest_clients and not active_alarms and not offline_devices %}

No UniFi data yet.

{% endif %}