Unifi Internet Speed
On your display
Live-Download/-Upload (Mbit/s) und Datenvolumen der Unifi von Tag, Woche oder Monat - in der App waehlbar.
- Topic
- Multimedia
- Includes
- Script
Runs on
- Does not run on 32×8 (TC001 & DIY) Made for 52×16 (TC002).
- Runs on 52×16 (TC002)
- Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.
Choose your display in the next step.
Script description
Internet Speed zeigt Download und Upload deines Internetanschlusses live auf einer AWTRIX-NG-Uhr mit 52x16-Display (z. B. Ulanzi TC002) - gruener Pfeil fuer Download, blauer Pfeil fuer Upload, in Mbit/s.
NEU: optionale zweite Seite mit dem DATENVOLUMEN. In den Einstellungen der App waehlst du individuell, welcher Zaehler angezeigt wird:
- Tag = heute
- Woche = diese Woche
- Monat = dieser Monat
- Aus = ausgeschaltet (nur Geschwindigkeit)
Die Volumenseite wechselt sich alle 5 Sekunden mit der Geschwindigkeit ab: oben die Summe (z. B. "Vol. Tag 67GB"), unten Download und Upload. Die Beschriftung kuerzt sich selbst passend zum Display; ab 1000 GB zeigt die Uhr TB.
Die Werte kommen per MQTT - jede Quelle funktioniert: Home Assistant, Node-RED, ioBroker, UniFi, FRITZ!Box, UPnP ...
Format (Geschwindigkeit in Mbit/s, Volumen in GB):
{"down": 85.3, "up": 12.1, "vol_day_down": 65.2, "vol_day_up": 2.1, "vol_week_down": 312, "vol_week_up": 12.5, "vol_month_down": 1210, "vol_month_up": 48}
Pflicht sind nur "down" und "up"; die vol_...-Werte fuer die Zeitraeume schicken, die angezeigt werden sollen.
Einstellungen: MQTT-Thema (Standard awtrix/internet), Datenvolumen (Tag / Woche / Monat / Aus), Zeit bis "veraltet" (grau + roter Punkt), Farben fuer Download und Upload.
Voraussetzung: MQTT ist auf der Uhr eingerichtet.
Fertige Home-Assistant-Automation und UniFi-Paket (Live-Durchsatz + Datenvolumen Tag/Woche/Monat, inkl. WAN2-Failover): https://github.com/jan-wtn/awtrix-internet-speed
EINRICHTUNG IN 5 SCHRITTEN (ausfuehrlich: https://github.com/jan-wtn/awtrix-internet-speed/blob/main/docs/SETUP_de.md)
- MQTT-Broker - z. B. Home-Assistant-Add-on "Mosquitto broker".
Benutzer fuer MQTT anlegen: Einstellungen > Personen > Benutzer > Benutzer hinzufuegen, z. B. "mqtt",
"nur aus dem lokalen Netzwerk", KEIN Administrator. - Uhr: Weboberflaeche > Settings > MQTT > Broker-IP, Port 1883, MQTT-Benutzer und Passwort.
- Dieses Skript installieren, Einstellungen oeffnen: MQTT-Thema (awtrix/internet) und DATENVOLUMEN: Tag / Woche / Monat / Aus.
- Datenquelle in Home Assistant: Beispiel-Automation (GitHub) einfuegen und eigene Sensoren eintragen (Mbit/s, GB).
- UniFi-Gateway (UCG Ultra, UDM, UDR, UXG): LOKALES UniFi-Konto anlegen (Administratoren & Benutzer > Hinzufuegen >
"Nur lokales Konto", Rolle Network "View Only", Passwort direkt festlegen - keine Einladung), damit die Integration
UniFi Network in Home Assistant einrichten (Port 443, SSL-Pruefung aus), unifi_wan.py + internet.yaml von GitHub
kopieren, Home Assistant einmal neu starten.
Achtung: Nach falschen Passwoertern sperrt UniFi den Login fuer ca. 15 Minuten (HTTP 429).
Schnelltest: Entwicklerwerkzeuge > Aktionen > mqtt.publish, Thema awtrix/internet, Inhalt {"down": 85.3, "up": 12.1, "vol_day_down": 65.2, "vol_day_up": 2.1}
Autor: jan-wtn - Lizenz: MIT
Internet Speed shows your live internet download and upload on a 52x16 AWTRIX NG clock (e.g. Ulanzi TC002) - green arrow for download, blue arrow for upload, in Mbit/s.
NEW: optional second page with your DATA VOLUME. In the app settings you choose individually which counter is shown:
- Tag = today
- Woche = this week
- Monat = this month
- Aus = off (speed only)
The volume page alternates with the speed page every 5 seconds: the total in the top line (e.g. "Vol. Tag 67GB"), download and upload in the bottom line. The title shortens itself to fit the display; above 999 GB the clock shows TB.
Data comes via MQTT, so any source works: Home Assistant, Node-RED, ioBroker, UniFi, FRITZ!Box, UPnP ...
Payload (speed in Mbit/s, volume in GB):
{"down": 85.3, "up": 12.1, "vol_day_down": 65.2, "vol_day_up": 2.1, "vol_week_down": 312, "vol_week_up": 12.5, "vol_month_down": 1210, "vol_month_up": 48}
Only "down" and "up" are required; send the vol_... values for the periods you want to show.
Settings: MQTT topic (default awtrix/internet), Data volume (Tag / Woche / Monat / Aus), time until values are marked as outdated (grey + red dot), colours for download and upload.
Requires MQTT to be configured on the clock.
Ready-made Home Assistant automation and a UniFi gateway package (live WAN throughput + day/week/month volume, incl. WAN2 failover): https://github.com/jan-wtn/awtrix-internet-speed
SETUP IN 5 STEPS (full guide: https://github.com/jan-wtn/awtrix-internet-speed/blob/main/docs/SETUP_en.md)
- MQTT broker - e.g. Home Assistant add-on "Mosquitto broker".
Create a user for MQTT: Settings > People > Users > Add user, e.g. "mqtt", "local network only", NOT admin. - Clock: web UI > Settings > MQTT > broker IP, port 1883, the MQTT user and password.
- Install this script, open its settings: MQTT topic (awtrix/internet) and DATA VOLUME: Tag / Woche / Monat / Aus.
- Data source in Home Assistant: paste the example automation (GitHub) and enter your sensors (Mbit/s, GB).
- UniFi gateway (UCG Ultra, UDM, UDR, UXG): create a LOCAL UniFi account (Admins & Users > Add > "Local Account Only",
role Network "View Only", set password directly - no invite), add the UniFi Network integration in Home Assistant
with it (port 443, verify SSL off), copy unifi_wan.py + internet.yaml from GitHub, restart Home Assistant once.
Note: UniFi blocks logins for ~15 min after wrong passwords (HTTP 429).
Quick test: Developer tools > Actions > mqtt.publish, topic awtrix/internet, payload {"down": 85.3, "up": 12.1, "vol_day_down": 65.2, "vol_day_up": 2.1}
Author: jan-wtn - License: MIT
Sign in to view and copy the code of this script.
Discussion 0
Ask a question, suggest a change or share how you use it.
No comments yet. Start the conversation.
More scripts in Multimedia
Something wrong with this script? Report it.
Have an idea?
Sign in to ask questions and join the conversation.