[General Accessories] Bonoboo:
Export all statistics into HTML and/or CSV-table

UPD: solution not works with Mi Fit app 2.x version, only with 1.x

I'm not maintain app anymore, sorry.

Also check other useful additions for Mi Band

All export logic taken from PC-app by [MENTION=2986005]xmxm[/MENTION]

It's same export, but directly on phone.

Important

– Before update remove previous app / profile

– For Tasker: don't forget remove and place again folder /data/miband

– To disable app you need delete or "freeze" it

– If you want change settings: clean app data or delete it and install again

– App does NOT drain battery

What is this

It's Android application / Tasker profile that generates files with all your activity and sleep statistics.

Available two data formats. You can export to any or both.

– CSV - table, can be opened in Excel / OpenOffice / OfficeSuite. Delimiter - comma.

– HTML - web-page, can be opened in any browser on your PC / phone. Contains table and interactive charts.

Path to files configurable: it is important to upload files into Dropbox and then into other services, like awesome FitnessSyncer

File will be updated automatically after 30 seconds after starting Mi Band application.

So after each synchronization you will always have fresh data.

How it works

Created using Tasker: via App Factory project exported into standalone APK.

When you first start the application extracts all needed files into /data/miband (and check this)

Waiting for manual entering the variables: type and the path to file.

Running shell-script to parse app database.

Monitoring of launch Mi Band app and then 30 seconds export files.

Available columns in CSV

Date

InBedMin

DeepSleepMin

LightSleepMin

SleepStart

SleepEnd

AwakeMin

DailyDistanceMeter

DailyStepsMeter

DailyBurnCalories

WalkDistance

WalkTimeMin

WalkBurnCalories

RunDistanceMeter

RunTimeMin

RunBurnCalories

WalkRunSeconds

DateUS

Activity

BedHour

BedMinute

AwakeHour

AwakeMinute

How looks HTML-pages

Requirements

– Root to access apps data

Installation

1. Download and install application below post (Mi_Band_Export_Stats.apk)

2. Run it

3. Enter without slash at the end path where save file (by default in /sdcard)

4. Enter desired file type: all (both), csv or html

5. Allow root-access

6. At selected path will be created file (and overwritten when you run app again)

7. Now always after 30 seconds after launch Mi Band app stats will be automatically exported

8. HTML: JS-files should always be near .html for it's correct displaying. Also internet required for rendering

9. Important: on Android 5.0 and higher you need enable Settings > Accessibility > Mi Band Export Stats

If files not appears or empty

Check files near

JS-files should always be near .html for it's correct displaying.

Check path /sdcard

On some firmwares you need change it to different, that points to internal memory: check via any filemanager.

Check additional folder, if you entered it

It must be created manually.

Implementation of self-extracting necessary files may not work on some ROM's

App will show notification about this and then you need to:

1. Check folder /data/miband and files in it

2. If it absent or empty: download below post file Mi_Band_Export_Stats.zip

3. Copy folder miband from ZIP to /data

4. Set permissions on folder and all files inside: all 9 ticks (chmod 777)

5. For devices on x86 CPU (Intel): delete inside folder file sqlite3, then rename sqlite3_x86 into sqlite3

6. Run application. Now file must be created

Installation if you use Tasker

Also useful: Gathering statistics for use in Tasker

1. Download profile below post (Mi_Band_Export_Stats.zip)

2. Copy folder miband from ZIP to /data

3. Set permissions on folder and all files inside: all 9 ticks (chmod 777)

4. For devices on x86 CPU (Intel): delete inside folder file sqlite3, then rename sqlite3_x86 into sqlite3

5. File Mi_Band_Export_Stats.prf.xml copy to /sdcard/Tasker/profiles

6. Tasker > tap on the tab Profiles > Import > Mi_Band_Export_Stats

7. In task present 3 actions for different formats. Default – export to both, other disabled

8. After run task files will be created in /sdcard, you can change path in actions

9. HTML: JS-files should always be near .html for it's correct displaying. Also internet required for rendering

10. Important: on Android 5.0 and higher you need enable Settings > Accessibility > Tasker

Changelog (99% it's xmxm's work, not my)

5.6.1

– now work on devices with с x64 CPU (thanks @signaleleven)

– auto-adaptation for x86 CPU (different sqlite3 binary already inside app)

– fixed auto-extracting files on Android higher than 5.0

– notification if auto-extracting failed

– export base the same

5.6

– main change: now using new sqlite3 binary that returns correct time

– this fixes wrong sleep start/end time in CSV-file and sleep graph

– new graph design and controls

– added better FitnessSync support:

– this is new columns in CSV: DateUS, Activity, BedHour, BedMinute, AwakeHour, AwakeMinute

– fixed not exporting if tap on app shortcut (3176 / 1216)

5.3

– brand-new awesome HTML-graphs: details at xmxm's thread

– auto-choose language of graphs, depends from locale on phone

– in CSV added column with total walking / running in seconds

– exported files slightly renamed, better delete all your current

– version number now will be synced with PC-app

1.4

– Fixed: month was calculated incorrectly in HTML version

– Fixed: sometimes data had extra rows with zeroes

– Fixed: all localization settings are moved out into single file

– Daily goals added. These are shown as trendlines on charts and sleep/steps columns in table will have green arrow if you passed daily goal and red arrow if you did not. By default the goals are set for 8 hours of sleep and 8,000 daily steps, but these could be changed inside config.js. They can also be changed dynamically in UI with corresponding -/+ buttons

– Data grouping data - click day/week/month buttons to group by these periods. Most columns Week and Month grouping show averages, but Walk distance and steps also have totals counters

1.3

– HTML: fixed creating empty file in some cases.

1.2

– HTML: default sort by date in reverse chronological order

– HTML: manually sortable columns

– HTML: added columns with the number and day of the week

– Added ability for simultaneous export into HTML and CSV

– Added information if application not creating file (above)

1.1

– Added export to HTML, you still can select CSV

– Removed ability to change file name

1.0

– Initial release