HomeTaskerStart Music with MiBand 4

Start Music with MiBand 4

Looks like Xiaomi left this job for me!

I made other “posting” plans for today, but after yesterday’s review of the MiBand 4, I figured out how to fix one of the biggest shortcomings of the sports tracker. Despite the ability to control music playback, you cannot start music with MiBand 4. I know how to fix that!

Fixing music playback on MiBand 4

To start music with MiBand 4 you will need 3rd party tools (maybe a future update will fix this flaw, but for now, we need a workaround). You will need to install these two apps:

MiBand Tools

This is a 3rd party app that takes data sent by your MiBand and stores it in its own database, in case you don’t want to use the MiFit. This app can do so much more, so take a look at other features. All I’m interested in, for now, is the ability to intercept touch gestures. This is going to be my “trigger”.

The app has the ability to launch the Google Play Music, but not to start it, so I need to refer to my good old Tasker.

Tasker

Since I’m going to share this with people who may not hear of Tasker as well, Tasker is a tool to automate your Android device. I have an entire section about Tasker alone. All you need to know is – we will use this app to make it play your tunes.

Making it work

MiBand tools can be used as a Tasker plugin. One of the Event options is “Gesture Performed” and this is going to be my trigger.

How to start the music with MiBand4? Simply swipe your finger right and then left when the display is on. MiBand tools will intercept this and passes it on to Tasker.

We can use this in 2 ways, but you can only pick one which suits your needs better

Continue the music stream

The task is super simple! The latest updates brought “Media Control” action. All you need is to use the “play” action [simulated only] and select the Google Play Music app in the options.

This will open the music app in the background and resumes playback of the last played song if stored in memory or starts a completely random song.

Play selected playlist

Before you start, note this won’t work with autogenerated playlists on Google Play Music – so if you want to start “Thumbs up” – you would need to make a copy of that list and name it in a different way.

I can use Android Intent action to send the query to Google Play Music to look for a specific playlist. For the ease of use, I will specify the playlist in a variable so you could change this at will.

Action: android.media.action.MEDIA_PLAY_FROM_SEARCH
Cat: Default
<no Mime Type>
<no Data>
Extra: android.intent.extra.focus:vnd.android.cursor.item/playlist
Extra: query:%playlist
<No package>
<No class>
Target: Activity 

The intent will open the music app and start playing the selected playlist. To wrap things nicely, add 2 second wait time and “Go Home” action to return to the default screen.

Other Media Players

I don’t use Spotify or other players, but from what I have seen so far both methods (with small modifications) should be ok for Spotify and probably other players too! Let me know what works for you, and share your experiences in this Reddit thread.

Conclusion

It’s possible to start music with MiBand 4, I just struggle to understand why this action isn’t available with MiFit. Thankfully, now you can do it yourself in less than 5 minutes. You can also put custom music controls in your NavBar so you don’t have to open the app or pull down the notification to stop the playback. If you like the idea of that – here is the tutorial for you. If you have any comments or questions you can leave it in this Reddit thread.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

New to Tasker?

Tasker Quick Start – Getting started with Tasker

0
From newb to not so newbie in 10 min

Best Tasker Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

How to wake on LAN computers and put it to sleep with Power Menu,...

0
How to Wake on LAN properly via Android, Alexa, Google Assistant and Web

7 awesome Bluetooth keyboard shortcuts for Android

0
7 unique Android shortcuts that you can add to any Bluetooth keyboard.

Smart overnight charging with Tasker

0
Still keeping your phone plugged in overnight? Try smarter overnight charging with this profile

One thing that Join app can’t do and how to fix it with Tasker

0
It's not possible to share the clipboard automatically between join accounts registered to 2 different emails. But you can fix this with tasker.

Essential Guides

Tasker: Seconds into DD:HH:MM:SS (dynamic)

0
It's time to.... ok it's a pun, but I will show you how to master time and convert seconds to DD:HH:MM:SS dynamically

4 ways to organise Tasker projects

0
Keep your Tasker tidy!

A better way to store Tasker credentials

0
The more clever way of managing credentials

Annoyed with dozens of AutoApps populating your app drawer? Here is a fix!

0
Clear your app drawer from the clutter in seconds

Putting AutoTools pie chart to a good use – SSID logger

0
Who wants a piece of the pie (chart)?