Xiaomi Band data export: 41 days of zeros

2026-12-02来源 dev.toEnglish

The band has no public API, so I read it through the Mi Fitness cloud with miband-bot. It worked for 92 days. Rows stopped after 13 October, and my daily cron reported success for the 41 days after that.

What does the Mi Fitness API return for a Band 10?

Ten tables, and the shape is not what "export my health data" suggests. You get daily aggregates plus per-metric sample tables, never a raw sensor stream.

Table Rows Days covered
heart_rate 9,220 42
blood_oxygen 2,235 41
stress 2,833 27
sleep_daily 54 54
sleep_stages 92 55
steps_daily 35 35
calories_daily 35 35
weight 1 1
steps_detail 0 0
workouts 0 0

Coverage differs per metric inside one 92-day window: 42 days with heart rate, 54 nights with sleep, 35 days with steps, and only 32 days carrying all four. A daily table built with an inner join loses two thirds of the window.

How often are heart rate and SpO2 sampled?

Heart rate arrives at a 60-second interval for a median 250 rows per day, up to 529, but 1,329 of the gaps are 600 seconds, so the band records in bursts rather than continuously. Blood oxygen points are 600 seconds apart, median 86 on the 27 days that have them, range 93 to 99 percent. Stress is 300 seconds. Nothing here is a uniform series, so do not interpolate across a gap and call it rest.

Which tables never come back with data?

steps_detail and workouts returned zero rows in 92 days. The client defines both schemas, the request succeeds, and the cloud answers empty. weight returned a single row with a BMI of 0.0, meaning the field exists and is not populated. Treat an empty table as normal output, not as a failure to be retried.

Why did the sync report success for 41 days?

The job asks for the last two days. An empty answer is a valid response, so every run wrote no rows, logged Sync completed successfully, and skipped the email with No data yet. Exit code, log line and status file all agreed the pipeline was healthy while the dataset had been frozen since 13 October.

How do I tell a quiet device from a broken client?

Probe the cloud for the same dates directly. 10 October returned a heart rate average of 53 bpm and a 454-minute sleep record, 13 October returned 52 bpm and 357 minutes, and 20 October, 10 November and 20 November all returned zero. The token, the region endpoint and the client were fine; the phone had stopped uploading from the band. This is the failure mode silent cron success describes, and the fix is the one cron job monitoring recommends: alert on max(timestamp) in the data, never on the process exiting zero.

What would I check first next time?

One query per run: the newest heart rate row, plus how many of the last seven days have any rows at all. If the newest row is over 48 hours old, the alert fires and names the device upload as the suspect, not the script. I had the health check watching services and disk, which is why 41 days passed without a word.

All counts come from my SQLite copy of the cloud data, queried on 23 November 2026 over the window 14 July to 13 October, plus a direct probe of the same dates on the same day.

Would you rather lose 41 days quietly or get one alert you have to dismiss?

Originally published at agentjournal.dev.

原文:https://www.a8q9.cn/en/article/xiaomi-band-data-export-41-days-of-zeros-3d14b9.html

相关文章