Gadgetbridge: Feature request : Using Mi Band 2 function button

Created on 2 Aug 2017  Â·  22Comments  Â·  Source: Freeyourgadget/Gadgetbridge

Hello, I know a proprietary app called "Mi Band 2 Music Control" that allows using the Mi Band 2 button to change the volume, play/pause or skip a song. That's pretty cool to be able to manage music without reaching the phone, but as I said, that app is proprietary, not cool...
It would be great to have such functionality in Gadgetbridge !

I have almost zero knowledge in java and even less in java android development so I doubt I could contribute much, but I found an app on Github that detects pressing the Mi Band 2 button : https://github.com/yonixw/mi-band-2

It would be awesome to be able to use the Mi Band 2 button for music or other purposes !

Thank you

android integrationnotifications device mi band 2 feature request help wanted

All 22 comments

@ogbaba
Hello, that is a feature i would be interested in too.
Detecting the button press is no problen we get a notification from the corresponding address (i think it was characteristic wiith UUID 0010) with the value 0x04 if i remember correctly.
The real question is how can we use this one value to control something, maybe with double tap or something like it.

That is not difficult to implement. Gadgetbridge already detects the button. We just have to design an activity chooser to define double/triple tap etc

We had some proposals for this already:

  • manage this as Bluetooth media buttons events
  • SimpleTap: Pause/Start/AcceptCall
  • DoubleTap: Skip/Next/RejectCall/SnoozeAlarm
  • dismiss notifications
  • repeat last notification
  • send to LibreTasks/Easer/Tasker

A custom http post call would be awesome: light switch on your arm

I would also love this feature, even if it's just a single BT/button event I could manipulate with something like Tasker.

@kcbleeker My problem is: Tasker is not oss and libretasks is not a very powerfull alternative

Sure, I'm not asking for Tasker integration :) Just some kind of generic input I can catch from Tasker, be that a media button event or whatever

huh? Isn't that implemented already?

It currently sends a broadcast, so you need an extra app to handle these broadcasts.
Some options could be implemented in GB directly, e.g. dismiss phone call

For everyone using openhab, please take a look at https://github.com/mueller-ma/openhab.android/tree/385-gadgetbridge-broadcast

@mueller-ma : the branch you mentioned isn't merged into the openhab android app yet is it?

@aHcVolle I closed the PR, because I'm not happy with the quality of the code. But I can upload a apk with of that branch.

hey, this would be great! thanks in advance.

openHAB App with support for gadgetbridge broadcasts: mobile-debug.zip

thanks I'll have a look

@ashimokawa the current implementation isn't very flexible, because it only lets you select one number of button presses that will trigger an event, limiting its possible uses very much.

I think the simplest way to extend it would be to have several configured broadcasts instead of just one: this many buttons presses = this particular broadcast.

It would definitely help usability to have an activity chooser instead of manually figuring out the appropriate broadcast, but this may be more complicated to implement, although it would probably help to simply have a set of "demonstrative" defaults that would send intents to control music, or dismiss notifications (I know that this one would make some people buy the Bip who otherwise wouldn't).

A set demo defaults would be a good idea, I still haven't figured out how to use broadcasts to control music and do things…

Is somebody knowledgeable with android broadcast intents subscribed to this issue?

I'd like to use the Mi Band 2 Button feature to make my phone ring (so to find my phone by pressing the button on my Mi Band 2). Is there some simple & free & preferably open source app that can do that?

Is this Tasker app that I've read and heard about a few times including in comments above mine able to do that?

kaefert I'm using the current implementation to turn my phone torch on and off with my MiBand 2 and Tasker. Tasker can definitely make the phone beep based on a trigger, or do other things like turn the screen on, or multiple actions at once or in sequence.

Thanks for the information. I just wanted to install Tasker to try it out and saw that it wasn't just proprietary but also non free money wise.

So I'm gonna try to find some alternative with the same feature. The first I found and tried was Easer but I wasn't able to make it work yet. https://github.com/renyuneyun/Easer/issues/121

Any progress on this (multiple broadcadts)?

I was able to perform an action (play/pause music) using Gadgetbridge, Mi Band 2 and Easer. I described it here: https://github.com/Freeyourgadget/Gadgetbridge/issues/979#issuecomment-429465460

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gianlucapir picture gianlucapir  Â·  7Comments

Jiack214 picture Jiack214  Â·  4Comments

MagicFab picture MagicFab  Â·  7Comments

NeverUsedID picture NeverUsedID  Â·  5Comments

UncleInf picture UncleInf  Â·  3Comments