It was a long quest. Starting with the introduction of the first version of the budget band from Xiaomi, we have been flooded with requests from you, the users of Sleep as Android, to make good use of the band.
Unfortunately, there was no documented protocol which we could use and the task seemed repeatedly possible and impossible with the efforts of various independent developers who seemed to crack the Bluetooth protocol that Mi Band used.
But Xiaomi always stroke back and changed the protocol.
After a long long long and seemingly impossible quest to get Mi Band talk to Sleep as Android, we got a word from Zdenek Horak, the author of Tools & MiBand (called MiBand Tools then) that he might be able to get this relationship working. But even for him, it was not an easy task, and even Zdenek felt at times that it’s an impossible thing.
But he didn’t give up. And finally, here we are.
Today, we can announce that Sleep as Android supports Xiaomi Mi Band 1&2!
How to:
For the integration to work, please buy & download the amazing Tools & Mi Band – the best Mi Band app on Android – Sleep as Android gets a full featured Mi Band support.
UPDATE: Sleep as Android is also supported by Notify & Fitness for Mi Band.Thanks Matteo!
Motion tracking (sleep phases tracking)
Enable Settings > Wearables > Use wearable.
Heart rate measurement
You need to enable heart rate in Tools & Mi Band:
Go to Tools & Mi Band > Navigation drawer > Heart rate > Settings and set the interval at which you want heart rate to be measured. This will then send heart rate to Sleep as Android at selected rate during sleep tracking.
You also need to enable heart rate monitoring in Sleep as Android:
Enable Sleep as Android > Settings > Wearables > Heart rate monitoring.
And battery life? With a full charge, you get to 95% in the morning after a whole night’s track. So we are probably better off than the Pebble (RIP)…
CAUTION: Sorry Mi Band 1 users, the integration only works with the Mi Band 2 with the newer firmware. For Mi Band 1 it is not technically possible. No access to its data.Mi Band 1 has been integrated as well! Please see Now Sleep as Android talks Mi Band 1+2 (-1S)
156 thoughts on “Sleep as Android talks to Xiaomi Mi Band 1&2”
Could you extend the documentation to include that you need to setup heart rate monitoring in the Mi Band tools as well as in the SaA app? Also, would it be possible for Mi Band tools to automatically start heart rate monitoring when sleep starts in SaA? Otherwise the Xiaomi band will monitor my heart rate all day. I know I can set a time interval in Mi Band, but this would only be an approximation of my sleep recording times.
Hello, to change the heart rate settings in Miband Tools to start only with Sleep, please contact their author.
Regarding what needs to be set up, I have updated the docs.
In tools & miband app it states that it is possible to snooze an alarm in sleep as android with just pressing the miband button. I turned this function on but it doesn’t trigger anything when the alarm rings. Is there a solution?
Hello, could you please contact the author of Miband Tools about this? He implemented our API to do this…
Dear Jiri Richter and SaA (Sleep as Android) Team,
Great work! I love the application, it helps me to wake me up in the morning on time.
About this article, I have a question…
You said it need MBT (Mi band tools) continuous HR reading to work. But I notice there’s already HR sleep assistant on Mi fit official app.
Why SaA app can’t read from Mi fit official app?
Should I enabled both?
Or on MBT only?
Best Regards.
Please enable only the MBT heart rate….we cannot read directly from Mi Fit because we don’t have knowledge of the Mi Band protocol. Mi Band Tools does.
What about heart rate measurement option in Sleep as android? “Mi band” is listed in description of the switch which turns it on (Settings=>Smartwatch=>Heart rate measurement), but still we need to set up heart rate measurement in Mi band tools. Why?
This is because Mi Band Tools is the middleman who has deciphered the Heart rate protocol from mi band. So effectively Mi Band Tools is the provider of the heart rate data, and Sleep is the receiver.
You control both sides of the relationship. In Mi band tools you enable sending HR data, in Sleep receiving HR data.
In tools & miband app it states that it is possible to snooze an alarm in sleep as android with just pressing the miband button. I turned this function on but it doesn’t trigger anything when the alarm rings. Is there a solution?
Please contact Miband Tools author about this as they’ve implemented the functionality
Hi, with the Mi band 2 wearable on, do I need to actively initiate the sleep, or is it enough that my alarms are set in the Miband tools app?
Hello, Sleep as Android needs you to manually start sleep tracking.
You can set sleep as Android to track your sleep between certain hours automatically.
Hi,
Do you think Mi Band 2 does a good work on the sleep tracking? I’m asking because i already read somewhere that the data showed by the Mi Band 2 are not much accurate.
Please, someone answear asap.
Thanks
Best regards
Hello Francisco, Mi Band 2 is very accurate. In fact it is accurate the same as any other band or smartwatch. At the heart of the band is a motion sensor called accelerometer which is a really well produced and standardized component. Nothing can go wrong there. Sleep as Android gets raw data from the accelerometer and works with them.
What have you most probably read is that the processing done on the data by the Mi Fit app is tad crappy. We circumvent Mi Fit and get directly at the raw data, so this inaccurate step is out of the way.
Will Mi Band Tools only use the Optical Heart Rate measurement for sleep tracking, or the motion sensor of the Mi Band 2 aswell?
Hi, it uses both sensors!
Hi, just to confirm I understood well: there is no need to place the phone in bed as the phone accelerometer is not used while wearing Mi Band 2?
Yes, exactly as you say.
Hi. Could I use SaA in this way: setup a morning alarm in app, sync it to mi band, turn off Bluetooth and do not use app at all. And in the morning sync mi band with the app?
Hello, this is not possible since we are unable to store any data on Miband. We can only connect to the data stream that flows out of the miband.
Hi, the sincronisation with MiBand 2 allows alarms too? I would like that the miband vibrates before the alarm sounds 🙂
Hi, yes, miband integration also works with alarms.
Please mention somewhere that all this is impossible without Google Play Services being installed. Would have saved me a lot of hassle.
Hello Pikaro, on our side we do not need Play Services to track sleep, however Miband Tools seems to need it since they need to have strong anti-piracy checks that use Play Services. Miband Tools is a heavily pirated app and since it’s a sole income for its developer, it needs to deal with it.
Hello, I’ve got a problem. I tried so many apps using my MiBand 2 (Mifit, MibandMaster, GadjetBridge, and now MiBand Tools). I don’t understand how your apps works. Indeed, there is a big difference about the deep sleep between all these apps:
– Mifit: 32min deep sleep (for 6h00 of sleep)
– Miband Master: 1h27 deep sleep (for 6h of sleep)
– Sleep As Android: 3h deep sleep (for 6h00 of sleep)
Can you explain me how is a such difference possible ? And each night it’s the same problem. Even if we don’t care about MibandMaster, the difference between the official mi app and SaA is impressive..
Thank you in advance
Hello, this is because every app uses their own take on the sleep phase detection algorithms. They are based usually on Sadeh / Cole-Kripke algorithms, but as they are pretty old and not perfect, most probably each app has some modifications of their own. We believe that our modifications of the algorithms are realistic, but of course there can be no real comparison as the algorithms are proprietary.
that’s great if sleep as android working on mi band we also need to try this . it enables more functionality of this band .
Hello, just one question:
Enable Sleep as Android > Settings > Wearables > Heart rate monitoring.
you mean the BETA Feature?
Yes…
Alarm clock sounded, millet bracelet 2 will follow the vibration.
Hi. Is the beta still required? The heart rate seems to be getting picked up from My Band without Beta “heart rate monitoring” switch enabled. Thabks
Hi, the beta is still required…the sensors on miband however light up according to heart rate settings in the Miband Tools app.
Yesterday I saw the millet bracelet 2 on this website, but the seller is in China and I want everyone to give me some advice.Here is the link:http://menghu.ebcoo.net/product/new-17-original-xiaomi-mi-band-2-miband-2-1s-1a-smart-heart-rate-fitness-wristband-bracelet-tracker-oled-display-mi-band-2/
No problem on that….the mi band is actually manufactured in China so no wonder.
I don’t really get what SaA adds to the existing T&MB functionalities. Since I’ll have to pay for T&MB, why not use the alarms (and smart alarms) available on that app? Could you clarify what are SaA differentials?
Hi Gabriel,
if you want to use just smart alarm, then you’re good to use just Miband Tools. If you want sleep tracking, statistics, charts, goals, jet lag prevention, lullabies, sleep advices, noise recording, anti-snoring and other sleep-related functions, you need Sleep as Android.
Hi there, and thanks for your ambitious work.
Currently in SaA, when I try to enable heart rate monitoring and say OK to the BETA message, I get a blank page and a pop-up saying, “To view this content, please install and set up a web browsing app.”
I’m using a Nexus 6P, Mi Band 2, SaA premium version 20170926, MiBandToos 3.5.1, Android 8.1.0, Chrome 63.0.3239.111.
Any advice for getting heart rate monitoring to work?
Thanks again!
Please opt-in to beta testing at the following url https://play.google.com/apps/testing/com.urbandroid.sleep
Hi,
Recently, from time to time, heart rate data are only available for a part of the night time and then the red line becomes unavailable and no data are available anymore. What could be causing this?
Not sure — this is handled by Miband Tools, please contact Miband Tools author.
Thanks to both you and the mi band tools author! I bought a mi band expressly for this and so far have been mostly happy. Question: Are there any requirements for heart rate monitoring frequency or time periods? The first night I had mi band tools configured for 1 hour HR measurements 24 hrs / day. Sleep as An, pdroid worked perfectly, plotting heart rate and sleep.
Then I went to 30 minute measurements for the 12 hours / day that covers sleeping. Sleep as Android no longer shows any heart rate information, though it is recorded as expected in mi band tools. Thoughts? Advice on how to fix? Was perfect the one time it worked …
Not sure why it doesn’t work now — please send me a debug log (menu > report a bug).
Regarding the best frequency, that would be at most 5 minutes to have accurate awake detection.
Do you know what frequency for heart rate monitoring is best in Tools & Mi Band? I’m using 2 minutes, but not sure how that affects the battery or what the ideal settings from the Sleep as Android side is…
5 minutes for reliable awake detection.
Hi ! I have a Samsung J7 and a Miband 2. I did everything but alwasy when enter “Enable Sleep as Android > Settings > Wearables > Heart rate monitoring” it says “This feature is only available in the latest BETA version. BETA means more features but higher chance of bugs. Start receiving BETA versions from Play Store?”. Than when I click YES >>> it goes to a white screen, with the message “To view this content, install and configure a web browsing app”. When I click OK, it goes to the same white screen and nothing happens. How can I solve it ?
Sleep as Android version > 20171223
Android Version> 6.0.1
mobile> Samsun Galaxy J7
Lucas Moreira
Hi, this will be fixed in the next beta. Thanks for noticing!
Me too.
Sleep as Android version > 20180105
Android > 7.0
tel > Galaxy S6
Does it offer better measurements than motion detection done only by SaA?
Yes, definitely, tracking motion with a wearable is the most reliable way to track sleep.
Hello Jiri. I just purchased the Mi Band 2. I live in the Caribbean island of Saint Lucia. I really want to monitor my sleep habits, but I can’t buy the highly rated Tools & Mi Band app in the Play Store because “it is not available in my country”.
I can see that this app is heavily pirated as you pointed out, there are so many “cracked” versions out there.
I would like to buy an official version of the app. How would you advise me to do that? I would be very grateful for your help. Thank you.
Hello Andy, unfortunately I have no idea – could you please ask the author of Miband Tools at info@mibandtools.com?