English | 简体中文
Mi-Stat_Max (Author: Brother Tech / 哥哥科技) is one of the most important branches of the Bro-Stat series — a xMonkey Script enhancement plugin built specifically for the Xiaomi router Web management dashboard, paired with a dedicated Home Assistant integration for smart home connectivity.
Now it's also avaliable in a Mobile Phone App!
Covers the full MiRD router lineup, including the Xiaomi BE3600, BE6500 (including Pro), 10 Gigabit, BE5000, BE7000, AX6000, and more!
Theoretically supports all Wi-Fi 5/6/7 routers running Xiaomi's stock firmware. Nearly all AX-series and newer models deliver comprehensive data. ISP-customized models may only return partial data, but broad compatibility is maintained throughout.
This is far more than a UI enhancement plugin. Driven by Brother Tech's carefully crafted algorithms, it thoroughly processes the raw, dynamic, discrete data the router exposes — producing values as close to ground truth as possible. It corrects the firmware's fake/misleading WAN speed figures (which are actually aggregated from LAN-side MAC statistics rather than measured at the WAN port directly — and the public network always matters more than the internal one), accurately attributes per-device traffic share, and weaves calculus and signal processing directly into the script's logic. Only by reading the source code can you truly appreciate the ingenuity. For a broader and more accessible overview, see the Design Blueprint.
Real-time Monitoring: Total WAN traffic (3s refresh), per-device speeds (3s interval), and official per-device traffic subtotals since boot — with historical records accessible at any time. Note: Dual-WAN mode defaults to an aggregated sum, a current limitation rather than a deliberate design choice.
Calculus Engine: True WAN throughput (derived via differentiation) and per-device traffic (via ∫ integration), shown in a dual-track display alongside official router stats — works right when you open the page, no setup needed.
Data Scopes: Simultaneously tracks and compares: Official hardware readings (current session only), live device data, and cumulative totals since the page was opened.
Core Features: WAN/LAN Ratio with 3-source smart arbitration; event-driven traffic calculation; faster true WAN speed display; unified unit conversion; statistics ready the moment you open the page — no background monitoring session required.
Dashboard UI: Shows device name, uptime, IPv4, and connected interface. High-precision upload/download speeds and ratios (dual-color indicators), per-device upload history and current-session download share against total household traffic (independent red/blue progress bars), and live speed bars.
This script rebuilds the UI layout of the "Network Management" and "Connected Devices" pages through a self-contained panel. It introduces trapezoidal integration algorithms, an anomalous traffic radar, and a dual-track traffic alignment display — a purpose-built dashboard for network engineers and power users. Theoretically supports the full Xiaomi Wi-Fi 6/7 router lineup.
Router Web UI Enhancement × Mi Home integration linkage (by Bro-Tech / 哥哥科技). Home Assistant plugin integration & UI enhancement, Mi Home companion — full MiWiFi series supported! Separately tracks uplink and downlink traffic per device, displays traffic ratios and upload/download proportions, and actively fights P2P/PCDN upstream leeching. Supports both 1000/1024 base systems and Mbps/GiB units. Enables side-by-side LAN and WAN traffic comparison at the global level. Flat device list for instant big-screen visualization. Everything you need right here — no more jumping between menus...
-
🏠 Home Assistant Integration: Works with the dedicated Brother Tech hub integration to push real-time status updates via Webhooks — cleanly sidestepping the web UI's single-session constraint and enabling stable concurrent monitoring across multiple endpoints. 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 unusual upload/download ratios and visually flags abnormal uploads, helping pinpoint devices potentially involved in PCDN/P2P upload bandwidth theft.
-
Precise Unit Conversion: Strictly differentiates between transfer rates and data volumes. Supports both decimal (1000-based) and binary (1024-based) units, including Mbps and 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 Traffic Counting ⏱️ & UI Grid Refactoring 🖥️:Fully mobile-friendly
-
Dual-Track Traffic Comparison: In addition to displaying the cumulative traffic totals reported by the router, the frontend independently samples transfer rates at high frequency to estimate traffic usage 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. Special Note: The “high-precision” traffic data here is derived from the official per-MAC cumulative counter, which tracks traffic for each device. However, it has been calibrated to account for issues such as official data rollover and reset, and—unlike the app’s weekly reports—distinguishes between upload and download traffic. The front-end sampling serves as an independent reference to ensure that even during system glitches, users can still view approximate traffic data; the sampling frequency itself does not affect the “high-precision” values.
-
Event-Driven and Group Time: A new sample is recorded whenever a change is detected in either upload or download speed, so cached readings aren't mistaken for fresh samples. This approach effectively mitigates the issue of varying refresh times across different interfaces and resolves the fallacy that higher polling frequencies lead to less accurate readings when the polling frequency exceeds the refresh frequency. Additionally, the Group Time mechanism significantly reduces the chance of overlap between upload and download sampling frames.
-
Customization Support: Supports configurable 1000-based Mbps and 1024-based MiB/s displays through script variables, in line with common networking conventions.
-
🛡️ 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.
- Trace-less injection. Does not break the native Vue state machine, ensuring browser rendering performance.
-
🌈 Event-driven: Optimizes 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.
Before using this script, make sure your browser has a userscript manager extension installed, such as:
- Tampermonkey (Recommended — supports Chrome, Edge, Firefox, Safari)
- Violentmonkey
- Greasemonkey
-
Click here to install the full version of Mi-Stat_Max:
Install from GitHub Install via Greasy Fork
Install from ScriptCat (recommended for China — no VPN required)
Brother project fully upgraded with smart integration ⇨
- Click "Install" or "Update" in the Tampermonkey popup.
- Log into your Xiaomi router's web management dashboard, enter the admin password, then refresh the page after logging in and navigate to the BroTech Panel (哥哥科技面板). The script activates automatically.
Important
Alternative entry point: If it isn't working, check the left sidebar navigation for 🚀 哥哥科技面板 (BroTech Panel) and open it from there — functionality is essentially identical.
Make sure the Tampermonkey extension is running correctly. The extension icon in your browser should show a number. See the image below for how to enable userscript injection.
Note
Via Browser (mobile): Script/plugin features not working?
| Normal Xiaomi Plugin | ZTE Plugin Reference | This Plugin |
|---|---|---|
![]() |
![]() |
![]() |
The script exposes a global CONFIG object at the top for fine-tuning based on your network environment:
const CONFIG = {
readSaveData: 1, // [History] 1: load from router backend (inherit baseline) | 0: fresh start | 2: load from local long-term history [auto-saved!]
calcMode: 1, // 1: Absolute multiplier mode (Upload/Download ratio), 0: Traditional percentage mode
ratioExtremeUp: 10, // Extreme upload threshold (default > 1000% — triggers red ⚠️ alert)
ratioWarnUp: 0.12, // Heavy upload threshold (default > 12% — triggers red highlight)
ratioExtremeDown: 0.01, // Extreme download threshold (default < 1% — triggers blue download multiplier display)
lanRefreshInterval: 3, // LAN refresh interval (seconds). Also used in some cases to compensate for traffic between the evaluation point (0) and wake-up
wanRefreshInterval: 3, // [WAN] refresh interval (seconds). Usually the program's main clock cycle
周期类型: 'W', // (cycleType)'M' (monthly), 'W' (weekly), 'D' (every N days). Any other value disables periodic reset + auto export
周_天设置: 5, //(cycleDay/Date) M: day of month (1-31); W: day of week (0-6, Sun-Sat); D: interval in days (e.g. 7)
基准日期: '2026-09-30', // Anchor date (D mode only): midnight of any past cycle start
报告时间: 720, // Reminder time: offset in minutes from the cycle start (e.g. -4320 = 3 days early). Relative to the next cycle start after the given date
自动导出: +1020, // Forced export: offset in minutes from the cycle start (e.g. W mode + day 6 (Sat) + -180 = force export and reset on Friday 21:00)
时区补偿: 28800000, // Timezone offset in ms. Defaults to UTC+8
portMap: {
"eth1": "Port 1",
"eth2": "Port 2",
"eth3": "Port 3",
"eth4": "Port 4",
"wl0": "Wi-Fi 2.4 GHz",
"wl1": "Wi-Fi 5.2 GHz",
"wl2": "Wi-Fi 5.8 GHz"
}
};This is a pure frontend data reorganization tool — it does not touch the Xiaomi router's underlying firmware or core configuration.
Running under Tampermonkey, the script deriving precise, real-time traffic figures. All UI changes are applied via DOM Mutation on top of the original CSS framework — native feel, no compatibility compromises.
Statement: “Bro Software” and badgeware share certain similarities, but they are not the same thing. Badgeware generally requires an appropriate attribution mark to be added prominently when the software is integrated, often with that mark appearing throughout every interface of the resulting work.
“Bro Software” is not necessarily more restrictive. He is closer in nature to a complete, standalone piece of free software than to underlying infrastructure, a framework, an open-source project, or a reusable library. This distinction allows the relevant portion of the work to be identified much more clearly: within interfaces substantially built from or primarily powered by my work, all references to my name must be fully retained, regardless of whether any particular reference technically constitutes “attribution” in the legal sense, and no such reference may be altered or tampered with in any manner. That said, I have no interest in hijacking your project or plastering my name across every page — strong as these requirements are, they do not bleed into every corner of a larger work. However, once a given page is primarily built on my code, I am effectively its principal author: attribution must appear there no fewer times than it does in the original work, and must be present in every page where my work is the predominant substance.
For the avoidance of doubt, the intended implementation may be understood as follows:
-
Where the overall framework remains substantially the same and the original page design can reasonably be preserved, the attribution must be retained in its original form.
-
Where preserving the original presentation is genuinely impracticable, the attribution should not be subjected to unnecessary or excessive redesign. It should be retained in an equivalent manner to the greatest extent reasonably possible, and its prominence must not be reduced in any respect.
-
Once my code is used, the number of appearances of “哥哥科技” in the end-user interface of your work must NOT be lower than the number of appearances in my original complete work. In all cases, at least one page of the resulting work must contain the attribution.
-
Where my code is used in multiple distinct areas that are substantially powered by or built upon my work, the corresponding attribution should be retained or added in multiple locations as appropriate. There is no upper limit on how many times attribution may be required.
-
Attribution must not be hidden away solely in deep or secondary menus that users rarely visit. It must be placed near the relevant interface, framework, module, or area that primarily uses my code, in a location that is readily visible to users, or at minimum no less readily visible than in my original design.
Authored by Bro-Tech





