MiBand 2: Add support for custom Notifications like MiBandTools
Well is it planned to add the custom Notifcation API of the MiBand 2 to GB? For a long time many people thougt that the MiBand cant handle Custom Notifications because firmware limitations but since one or two months the App MiBandTools Reversed Engineerd the API.... https://play.google.com/store/apps/details?id=cz.zdenekhorak.mibandtools
For Example you can write custom Text to the MiBand with a custom Icon....
I am useing the MiBand 2 and i would be a nice feature....
Can you capture some Bluetooth dumps with example notifications and post them here (together with the information what the notifications contained)?
I also would be interested in this feature and would have provided a dump but my current system (crdroid) doesn't seem to support it. I would donate the costs of a license for MiBand Tools to cpfeiffer, would that help?
Well i could send you many dumps but someone need to tell me how ;) Sry :S I am useing Linux for Years but this is a thing what i have never done before.... :)
Do you know if one has to enable such text notifications first? I have code that sends a text notification to the band, but it does not display it. I'm using firmware 18.104.22.168.
Yes, one has to enable it in MiBand tools. One can also select what to display and from which app. For example you can add the k-9 email app and tell MiBand tools to display $contact and $content in all k-9 notifications. They display in message parts of 18 characters, each separated by a vibration and an icon. MBT lets you chose the icon and the pattern of the vibration. I'm not sure but I think I read that it is a limitation of the Mi that the messages are split up that way.
Can you do a btsnoop when enabling it? I'm not sure if it actually needs to send something to the band in order to enable this feature.
Note that the commit does not work, at least on my band. There must be something else to enable this generally (so I need a btsnoop of that).
Well, I setup a backup device to be able to make a dump. I hope this helps.
What I did: I added the default Android email app to the app selection in MiBand Tools, then I sent a test message with the standard settings ($title $content) from MiBand tools. Then I did the same with the Android SMS app. After doing so I changed the SMS notification settings to $contact and sent a test message from the MBT app again.
Still unsuccessful. I read that the feature is only available when you change the language in Mi Fit to Chinese. Did you do anything like that?
Mi Fit (or possible Mi Band Tools probably "unlocks" this feature on the band by sending some command (triggered by changing the language before synchronizing with Mi Fit, for example).
I don't have the Chinese firmware. And I didn't install any font. My firmware version is 22.214.171.124, installed via the PlayStore version of MiFit, which is English. Language in MBT is German. Should I provide the firmware file?
I made a firmware upgrade now with GB, runs wonderful BTW. But I haven't installed the English font I found in the new apk and text notifications still work. I guess that means that the font was already installed? Maybe, I should have mentioned that I bought the band used and updated it twice in the meantime.
If you need more precise dumps with real test emails, I could provide them outside of Github. Andreas has my email address.
@girlwithnoname can you test current master and see if text appears when you get a notification? Just test with the Debug view, for example.
I have all the firmware files. The fonts are actually separate from the firmware. Gadgetbridge does not support sending these to the band, atm.
My date/time display is English, so I suppose I must have an English font, or at least part of it. There must be something missing. So if it works for you, our implementation is correct at least, and I only need some other configuration. It oculd very well be that it won't work for you right now, since I currently do not send some configuration flags. Need to find out what they mean -- I don't see any effect on my band at least.
Done. I don't see any text but there is a difference now: I now see two icons after another. The general notification icon followed by the email icon as chosen in MiBand Tools. I've just tested this on my main device, MiFit and MBT are installed, too.
Thanks for testing. The two notifications were expected.
Now I send another config option now, can you checkout the mi2-text-notifications branch and test again?
Still no text, but now I only see the email icon.
But hey, with SMS debug test I see text :)
I just noticed that I don't receive any real email notifications anymore both when only GB is installed and with the other apps active. The k-9 settings option also has vanished from GB settings. Plus the connection is now very unstable.
K-9 settings + K-9 specific receiver have been removed a few versions back. It is now handled by the generic notification receiver. If you do not receive notifications at all you have to reboot your phone. There is an old Android bug regarding notification listener services.
Thanks, that did the trick.
Need some info: how this works with Mi Fit or MBT:
Which icons are visible together with the text? Is it always the generic "message" icon?
Up to now, I only managed to display a message with that message icon. Prior to that, we can easily vibrate and display other icons, in order to announce the text message.
Initial support is done for 0.18.0. There's certainly room for improvement, like
- transliteration of non-ASCII characters
- the choice of text content to display
- the icons to display
but we can have new issues about these.
Hi everyone.... Well i will make my promise become true.... But who has to get the Money?
Hi, i would really be happy to use this cool feature.
Since MiBand2 firmware version 1.0.39 is recommended ( https://github.com/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-Firmware-Information ), i downloaded the MiFit App via APK Mirror (v2.3.0), extracted the archive and then flashed the following files from the /assets/ folder via GadgetBridge (v0.19.4 from F-Droid Store) to my MiBand2:
In GadgetBridge i activated text notifications under "Mi Band Settings", but it doesn't work at all. I used the debug menu to send a test sms (GENERIC_SMS), but it doesn't work (no text, only symbol). I already rebooted the phone multiple times, no success so far.
Did i miss anything that has to be done as a prerequisite for text notifications to work?
Edit: OS is LineageOS 14.1
I am a new user of GadgetBridge and I will firstly congratulate you for the great job you did and are doing :)
Just to know is it possible to choose to display only the id of the sender and not the text of the SMS ?
Good bye and thank you.
Can we send a custom text directly to the Mi Band 2's screen by writing data to a specific characteristic (BT LE)? It seems possible, I just need to know which characteristic to write. Can someone help me with that? :-)
Deleting a branch is permanent. It CANNOT be undone. Continue?