Page 1 of 2
Connecting Smartband
Posted: 06 Jun 2018 10:40
by digitalstone
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?
Re: Connecting Smartband
Posted: 06 Jun 2018 14:38
by Desmanto
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.
Re: Connecting Smartband
Posted: 06 Jun 2018 19:12
by digitalstone
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

Re: Connecting Smartband
Posted: 06 Jun 2018 19:30
by digitalstone
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

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.
Re: Connecting Smartband
Posted: 07 Jun 2018 17:37
by digitalstone
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?
Re: Connecting Smartband
Posted: 07 Jun 2018 18:16
by Desmanto
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)
Re: Connecting Smartband
Posted: 07 Jun 2018 18:47
by digitalstone
Dude, don't ever say oops again. You're spending so much time on being a huge help already.
For your answers: thanks!
Re: Connecting Smartband
Posted: 07 Jun 2018 21:37
by digitalstone
Big chances are that i was too quick...
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
Re: Connecting Smartband
Posted: 08 Jun 2018 15:59
by Desmanto

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.
Re: Connecting Smartband
Posted: 08 Jun 2018 18:15
by digitalstone
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?