Heart rate monitor/overlay for Mi Band 7 watches.
- Python 3.10+
- Mi Band 7 / Smart Band 7
- Bluetooth adapter
git clone https://github.com/keydevelops/M7Monitor.git
cd M7Monitorpip install bleak cryptographyYou need the auth key from the Mi Fitness app:
Follow this guide: Huami/Xiaomi server pairing
Copy the example config and edit:
cp .env.example .envEdit .env and set your AUTH_KEY:
TARGET_NAME_KEY=Smart Band
AUTH_KEY=YOUR_AUTH_KEY
OVERLAY_HOST=127.0.0.1
OVERLAY_PORT=8765
DEBUG=False
DISABLE_COLORS=Falsepython main.pyYou should see:
[web] overlay: http://127.0.0.1:8765/
[web] state: http://127.0.0.1:8765/api/state
[state] scanning
[state] connecting
[state] authenticating
Returns the HTML overlay page.
Returns JSON with current state:
{
"status": "polling",
"heart_rate": {
"value": 72,
"timestamp": "2026-06-10T11:09:46.530Z",
"source": "activity-fetch",
"age_seconds": 5,
"stale": false
},
"stale": false,
"last_error": null,
"settings": {
"debug": false,
"disableColors": false
}
}Health check endpoint (returns ok).
I don't think so. But I think Xiaomi changed the protocols or something like that. I don't have them, so I cannot test it.
Thanks to patyork for the miband-7-monitor implementation.
Thanks to Freeyourgadget for the GadgetBridge app.
MIT License - see LICENSE file for details.