Install
哥哥科技 / 小米路由器增强 Mi-Stat_Max

Published:

Version: 5.9.9+dbf47c1 updated

Summary: 哥哥科技 space.bilibili.com/501430041

License: CPAL-1.0

Antifeature: unspecified

Mi-Stat_Max (Author:Brother Tech/哥哥科技) is one of the most important branches of the Bro-Stat_Max series, a xMonkey enhancement script specifically customized for the Xiaomi router Web management dashboard, now coupled with a dedicated Home Assistant integration for smart home automation.作者:哥哥科技。ZTE Version
现全面增加对 Home Assistant 全屋智能家居接入集成支持!
Supports the entire MiRD router series, including various models such as Xiaomi BE3600, BE6500 (including Pro), 10 Gigabit, BE5000, BE7000, AX6000, etc!
Mi.png

Real-time Monitoring: Total WAN traffic (3s refresh), per-device speeds (3s interval), and official per-device traffic subtotals since boot (resume from history anytime). Note: Dual-WAN defaults to an aggregated sum (an inherent fallback, not by specific design).

Advanced Calculus: True WAN speed (derived via differential calculus) and per-device traffic (via ∫ integration), displayed in a dual-track comparison alongside official stats! Plug-and-play!

Data Scopes: Simultaneously compares: Official hardware readings (current session only), real-time online data, and cumulative totals since page load.

Core Features: WAN/LAN Ratio via tri-source smart arbitration; Event-driven traffic calculus; Ultra-fast true WAN speed rendering; Smart unit conversion & standardization; Instant data availability on launch—no background idling required.

Dashboard UI: Displays device name, uptime, IPv4, and connected interface. Features high-precision Up/Down speeds and ratios (dual-color indicators), historical upload / current download ratios against total network traffic (independent red/blue progress bars), and dynamic speed bars.

支持检测:WAN口总流量(3s刷新)、各设备速率(3s)、各设备开机以来官方流量小计,随时读档。双网默认为加和,并非有意设计。

支持计算:WAN口速率(从流量微分求导)、各设备流量(∫积分)+官方统计双轨制对比!即开即用!

统计口径:同时支持对比:官方值(只含本次接入)、当前在线、网页打开以来的总计。

特色功能:内外网比,3数据源综合裁决;事件驱动流量计算;更快地显示WAN真值速率;单位换算&统一;打开就有统计数据,无需挂机监控。

视觉UI:含设备名、在线时间、IPv4、接入端口,高精上下行和比例(双色雷达),历史上行、本次下行占全家比例(独立红蓝进度条),网速赛跑条。

logo

English | 简体中文

Router Web UI Enhancement × Mi Home Probe Linkage Integration (by "Brother Tech/哥哥科技"). Home Assistant plugin integration & UI enhancement, Mi Home Companion, supports the entire MiWiFi series!

Version  Platform  Integration

This script reconstructs the UI layout of the "Network Management" and "Connected Devices" pages via a self-built panel. It introduces trapezoidal integration algorithms, an abnormal traffic radar, and a dual-track traffic alignment display, providing a dashboard for network engineers and power users. Theoretically supports all Xiaomi WiFi 6/7 routers.

Separately tracks uplink and downlink traffic, displays traffic ratio and up/down proportions, and combats P2P/PCDN upstream leeching. Supports mutiple base systems and Mbps/GiB units. Enables global comparison between LAN and WAN traffic! Features a flattened device list for instant big-screen visualization. Everything you need is right here—no more tedious menu switching...

While the official Web dashboard is stable, its UX design for data visualization has some friction. For instance, real-time network speeds and historical accumulated traffic for devices are hidden behind secondary menus. You have to frequently click into specific devices to view them, making it impossible to form an intuitive, global comparison. The core purpose of this plugin is to "flatten" these hierarchies. It extracts the up/down network speeds of individual devices, the integrated traffic during the current session, and the underlying total accumulated throughput, pushing them all to the forefront of the main device list. Without any extra clicks, the network throughput status of all devices is clear at a glance.

🧬 Important:Alternative Wake-up Entry

If it isn't working, please check theleft sidebar navigation,find the 🚀 哥哥科技面板(BroTech Panel) and click to open it; the functionality is essentially the same.

Please ensure the Tampermonkey extension is running correctly!!Specifically, the extension icon in your browser should be displaying a number! The tutorial for allowing userscript injection is shown in the image below.

💡 TIPS
If the script is still not taking effect, please refer to the following tutorial::

图文教程

✨ Features

  • 🏠 Home Assistant Integration: Works seamlessly with the dedicated Brother Tech hub integration to push real-time status updates via Webhooks. This gracefully bypasses the single-session limitation of the native Web UI, enabling stable, concurrent multi-terminal concurrent monitoring. See the brother project (Universal): Mi-Stat_HA.
  • Traffic & Ratio Statistics: Tracks the uplink and downlink traffic of individual devices separately, allowing you to view real-time traffic ratio rates and up/down proportions. Adding LAN/WAN Ratio, etc.
  • Abnormal Upload Monitoring: Detects up/down ratios and visually flags abnormal uploads, combating PCDN / P2P bandwidth theft.
  • Precise Unit Conversion: Strictly differentiates between network transmission rates and storage capacity. Supports both 1000/1024 base systems and displays in Mbps / GiB.
  • Global Data Comparison: Supports aggregate statistics and intuitive comparison between the internal network (LAN algebraic sum) and the public network (WAN port).
  • High-Precision Integral Traffic Tracking ⏱️ & UI Grid Refactoring 🖥️:Fully mobile-friendly
  • Dual-Track Traffic Comparison: In addition to displaying the historical total throughput natively provided by the router interface, the frontend independently conducts high-frequency data sampling to track the actual traffic consumed while the page is open. Both metrics are displayed side-by-side for reference. Units are unified to the current session, focusing on the observability of changes.
  • Customization Support: Respects network engineering habits by allowing script variables to customize display logic for Base-1000 (Mbps) and Base-1024 (MiB/s).
  • 🛡️ Privacy Protection & UI Optimization:
    • Automatically masks sensitive MAC addresses and temporary IPv6 addresses during in-place DOM mutation rendering, ensuring safety when screen recording, capturing, or sharing network status.
    • Employs a forced bottom-alignment system based on Flexbox, fixing height discrepancies caused by CSS grids.
    • Trace-less injection. Does not break the native Vue state machine, ensuring browser rendering performance.
  • :rainbow: Event-driven: Optimises the integration algorithm to prevent miscalculations of flow area caused by misaligned sampling times or phase differences. Uses changes in network speed as the basis for the sampling interval.

📸 Screenshots

Normal Xiaomi Plugin ZTE Plugin Reference This Plugin
小米插件 原生界面 增强界面

🚀 Installation Guide

Requirements

Before using this script, ensure your browser has a user script manager extension installed, such as:

1.Brother project fully upgraded, now with smart integration ⇨ ZTE HACS

  1. Click "Install" or "Update" in the Tampermonkey popup interface.
  2. Log into your Xiaomi router's Web management dashboard, enter your admin password, and upon successful login, refresh the page and navigate to the "BroTech Panel" (哥哥科技面板) interface. The script will activate automatically.

🔗 Symlinks 友情链接

ZTE HACS

Anti PCDN

⚙️ Configuration

The script exposes a global CONFIG object at the top, allowing users to fine-tune it according to their specific network environment:

const CONFIG = {
    calcMode: 1,            // 1: Absolute multiplier mode (Uplink/Downlink), 0: Traditional percentage mode
    ratioExtremeUp: 10,     // Extreme upload trigger threshold (default > 1000%, triggers red ⚠️ alert)
    ratioWarnUp: 0.07,      // Heavy upload trigger threshold (default > 7%, triggers red highlight)
    ratioExtremeDown: 0.01, // Extreme download trigger threshold (default < 1%, triggers blue download multiplier display)
    
    // Chinese mapping dictionary for physical ports and wireless bands (can be customized based on your router model)
    portMap: {
        "eth1": "Port 1",
        "eth2": "Port 2",
        "eth3": "Port 3",
        "eth4": "Port 4",
        "wl0":  "Wi-Fi 2.4G",
        "wl1":  "Wi-Fi 5.2G",
        "wl2":  "Wi-Fi 5.8G"
    }
};

⚠️ Notes

  • This script is a pure frontend data reorganization tool. It does not involve modifying the Xiaomi router's underlying firmware.
    Utilizing the Tampermonkey environment, the script makes concurrent requests to the router's vue_home_device_data_no_update_sess and vue_client_data APIs. To eliminate the lag caused by the official frontend's polling refresh, the script internally implements an independent timer via performance.now(), deriving highly accurate instantaneous traffic data. All UI modifications are executed via DOM Mutation on top of the original page's CSS framework, ensuring a native feel and seamless compatibility.

Authored by Brother Tech

Star History

Rating: 0