Connecting Smartband

Post your questions and help other users.

Moderator: Martin

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Connecting Smartband

Post by digitalstone » 06 Jun 2018 10:40

So the Mi Band 2 just came back in retail and i decided to go and buy one for a couple of bucks.

Now i'm trying to connect Automagic with it which seems to work according to the Bluetooth settings inside Android.
And when i execute an action "connect/disconnect bluetooth device" by itself (when you edit the block and execute it), it executes successfully.

Yet when i try to choose a device from another action of the wearables category with the [...] button, Automagic shows the screen message "no device available".

Am i missing a step here?
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Connecting Smartband

Post by Desmanto » 06 Jun 2018 14:38

You abandoned waiting for the Mi band 3 with NFC?

I can find the MB2 when using LP 5.1. But can't find it anymore in Oreo 8.1. There is no way we can connect the band directly to Automagic (even you can search it in the action). I have to use the Mi Band 2 Func button first, connect it. Then use the single, double, triple tap to send intent to Automagic to make it work. Lift wrist also work but will drain more battery. Probably this should be requested as feature.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Connecting Smartband

Post by digitalstone » 06 Jun 2018 19:12

No the wait for the MB3 with NFC continues.
But i thought it'll be nice to already get used to, and get to know some concepts (and hopefully create/test already some flows with it).
All with the price for a cheap dinner for 2 :-)

So if i'm understanding this correct: The OS needs confirmation & directions on BT-activity in order to pass the BT information to the application/activity?
And for this step i need an app like Mi Band 2 Func button?
And how has "wrist lift" have to do with this?


P.S.:
Is it just me? I always found Bluetooth a bit tacky. It never seems really clear on how connection is being established/maintained.
There always seem to be a lot of loose ends/links in the chain depending on what devices you're trying to interface.
Whenever i achieved any BT-connection, the initial response always was: "Oh wow, it worked". This response shouldn't be normal :|
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Connecting Smartband

Post by digitalstone » 06 Jun 2018 19:30

digitalstone wrote:And how has "wrist lift" have to do with this?
Never mind this bit. I've read the app description of the Mi Band 2 Func Button.


--EDIT--
So i've installed Mi Band 2 Func Button, but completely fails to maintain a stable connection.

It is in a constant loop like:
Connected! Battery: 83%
[5 seconds of stability]
Failed to connect!

--EDIT 2--
Got it.
Found the Mi Fit app somewhat confusing with all it's bells and whistles.
So i froze it with Titanium :roll: I thought it wasn't necessary...
But i figured that (of course) the Mi Fit app must function as an interface between the MB2 and Android.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Connecting Smartband

Post by digitalstone » 07 Jun 2018 17:37

The left-over questions i would like to ask are:
- Is the 'AndroidWear' category of triggers, conditions and actions usable with ONLY certain smartwear's applications?
- If so, should Tasker actually be installed for "Mi 2 Band Func Button" to work with (and from there to send some type of intent, or perhaps http-request workaround with 127.0.0.1, to Automagic) or is there an alternative?
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Connecting Smartband

Post by Desmanto » 07 Jun 2018 18:16

Ooops, I forgot your post. One hidden thing you need to do is you must open Mi Fit before using Mi Band 2 Func button. Yes, as you have found out.

Those wearable action are for android wear, not for smartband with its own proprietary OS such as Mi Band 2. No tasker needed, Automagic can received the intent broadcast directly using Trigger General Broadcast. Just fill in mb2_tap1, mb2_tap2 etc in the General Broadcast. Each tap require one Trigger. (you can put them all in the same flow and split it using multiple parallel expression)
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Connecting Smartband

Post by digitalstone » 07 Jun 2018 18:47

Dude, don't ever say oops again. You're spending so much time on being a huge help already.

For your answers: thanks!
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Connecting Smartband

Post by digitalstone » 07 Jun 2018 21:37

Big chances are that i was too quick... :oops:
Which field does the "mb2_tap1" etc have to be applied to?

I've tried multiple possible solutions.
But my best guess right now (and still failing) is:
Action field: mb2_tap1
Action Intent Extra's: value=getString("command")

Nothing happens when i tap the Mi Band 2
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Connecting Smartband

Post by Desmanto » 08 Jun 2018 15:59

:D I probably miss the post when I close the tab, thinking I have replied to all. Kinda busy lately after I change my phone, several adjustment need to be made to several flows.

The trigger General Broadcast only need to have the mb2_tap1. No other parameter anymore, no extras. The flow just got trigger when the MB2FB send the intent. If the flow doesn't get triggered, most likely it is the connection that hang up or the app itself frozen. Try to force stop it or disconnect and connect again. I have a lot of force close when using this app. And I can't test it anymore in Oreo 8.1, as one of the function from this app is obselete in Nougat above. Installs fine but always force close when opening.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Connecting Smartband

Post by digitalstone » 08 Jun 2018 18:15

Now it's my time to go 'woops'.
I forgot to let the Func Button application send a broadcast (Send Command to Tasker).
But... it's completely working now. And i got a way better understanding of broadcasts... Bluetooth as well, since i've been looking up all sorts of info about it.
Thanks, this was a good one!

What phone do you have now? Does it have Oreo and was it necessary to make that switch so bad that you need to adjust all sorts of flows?
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

Post Reply