Firmware Hero
0

OpenHub2

It turns the hub into a network Zigbee coordinator for Home Assistant (ZHA) that works with any Zigbee brand, not only Xiaomi/Aqara, and it keeps working without the Xiaomi cloud.

  • Custom firmware
  • Alpha
  • Medium brick risk
  • Reversible

Source code

This project hasn't been claimed by its maintainer yet, so its details come from the community. Is it yours? Claim it

Before you start

How hard is it?
EasyCopy a file or use a web page. No extra software.
What you need
  • Comfort with the command line
  • A computer
Can it break my device?
Small chance of trouble, with a way to recover.
Can I undo it?
Yes. You can go back to the official software.
Get itOpens github.com

Did it work for you?

Did OpenHub2 work on your Xiaomi Smart Home Hub 2?

No reports yet.

One-tap reports from owners. Bricked reports are checked before they count.

Compatibility

Devices: Xiaomi Smart Home Hub 2.

No compatibility information yet.

Getting started

From the project's README ("Install"):

Quick start (no Xiaomi app)

The hub can be configured without the Mi Home app by exploiting the setup access point, where the miio token is revealed in cleartext.

  1. Network reset: hold the hub button ~10 s until the LED blinks orange, then wait for it to blink blue (setup mode).

  2. Connect your PC to the hub's open Wi-Fi (lumi-gateway-mgl001mibt…).

  3. Build (Go 1.26+): make && make ohinstall.

  4. Run the installer: build/ohinstall -ssid "YourNetwork" -password "YourPassword" The installer discovers the hub, reads the token, recovers the gateway key over LAN (via asyncdevicefeedbacklog), opens a root shell, deploys all files via SSH, asks for a password and configures Wi-Fi. No Xiaomi app or cloud account needed.

    If automatic key recovery fails on your firmware, pass it manually with -key (get it from cat /data/miio/device.conf over SSH, or via XiaomiGateway3).

    Use -no-deploy to skip SSH deployment and do it manually.

  5. In Home Assistant: Add integration → ZHA, radio type EZSP, path socket://:8888.

  6. Open http:/// in a browser for the web panel (same password as SSH).

Manual install

If you already have root access (telnet or SSH):

  1. make → produces build/gatessh, build/zbbridge, build/ohweb, build/btproxy.
  2. Copy to the hub:
    • build/gatessh → /data/gatessh/gatessh
    • build/zbbridge → /data/openhub2/zbbridge
    • build/ohweb → /data/openhub2/ohweb
    • build/btproxy → /data/openhub2/btproxy …

Read the full instructions

Risk and recovery

Brick risk
Medium
Reversible
Yes
Requires opening the device
No

From the project's README ("OpenHub2 userland"):

An open root filesystem for the hub's spare rootfs slot (A), built with Buildroot 2026.02 from userland/ by GitHub Actions (artifact openhub2-rootfs, about 2.6 MB of the 16 MB slot). It keeps the stock 4.9.84 kernel and its Wi-Fi modules; the proprietary modules are not shipped but copied from your own hub.

Boot: feed the hardware watchdog, mount /data, load the Wi-Fi modules, join Wi-Fi with wpasupplicant using the factory MAC, NTP, then the same OpenHub2 binaries from /data (gatessh, zbbridge, btproxy, ohweb).

Safety: "try once" boot. The U-Boot environment gets a small chain of variables. Every boot of OpenHub2 first saves the stock system as the next choice; only a healthy boot (Wi-Fi address and SSH up) re-arms OpenHub2. A failed or hung boot (the watchdog reboots, the kernel uses panic=5) therefore comes back as stock without any intervention.

LEDMeaning
purple blinkingOpenHub2 booting
green (or the color chosen in the panel)OpenHub2 up and healthy
redboot not healthy after 3 minutes, next boot is stock
orange blinkingswitching to stock

Back to stock: press the hub's button three times quickly, use Switch to stock in the panel, or run userland.sh disable.

Install, from the stock system with OpenHub2 already set up:

copy the rootfs.squashfs artifact to /data/openhub2/ first sh /data/openhub2/userland.sh prepare # stock modules, Wi-Fi config, factory MAC …

Read the full instructions

Credits, license and support

License
MIT