One of the complaints I made in my Amazfit GTR (review) was that I cannot initiate music playback from the watch itself. I can control it once the playback starts, but there is no option to start music with Amazfit GTR. It’s something that all Huami devices share. I fixed this issue for Xiaomi MiBand 4 (review) before, I will fix it again for probably all Amazfit devices thanks to Tasker.
A different approach
I’m not going to lie, it took me a good while to figure out how to make it work on Amazfit devices. This should work for other Amazfit devices providing you have a compatible phone. My Xiaomi Mi9 (review) works great, but I was not able to use this method on Google Pixel 3 (review). Don’t jump to download section and just apply it, LogCat part may need modifications.
To start music with Amazfit GTR you will need Tasker and AutoNofitication app. If you have never heard about Tasker (Getting started with Tasker), this is an automation tool for Android devices and probably the best app you will ever own, and AutoNotification is a plugin to make it a little bit better.
Start music with Amazfit GTR and others
When I open Music option on my Amazon GTR, the watch checks the playback on the phone, and if media session is present, you will see the track information. Here is the catch, the method works on the ROMs that share this information in the LogCat. If you are unable to see LogCat entries, you will have to try something else.
I was able to pinpoint this action to Audio Manager: getStreamVolume isRestricted mode = 0
. It checks if there is a media stream present on your phone. Unfortunately, it is not specifically tied to Amazfit action. Android system uses it in other instances.
I spent a couple of hours testing other Bluetooth related events to find out if there is anything else I could use without much luck.
Plan B
There was no direct action that I could map, but I could use a combination of a Bluetooth event and media stream query to start music with Amazfit GTR.
Each time I’d press the Music option on the watch, Amazfit GTR would connect with my phone and query the media stream. If I can chain these two events – I can have a pretty solid trigger.
Unlikely but possible caveat
Neither of the triggers works on its own. So there could be a situation where these two could create a possible false positive and start the playback. This is possible if you open Amazfit app (before app exclusion kicks in) and in the same half a second time-frame, you will get a notification (Audio Manager query).
Tasker and AutoNotification
I need 2 LogCat triggers (note that your exact entrties can be slightly different):
Audio Manager: getStreamVolume isRestricted mode = 0
will start the playbackbt_stack [VERBOSE1:gatt_cl.cc(620)] gatt_process_notification
arms the playback trigger by setting a 500ms trigger window.
Note that you should use LogCat on your Android phone and press the Music menu on your Amazfit GTR to check if your entries are the same ( feel free to experiment with bt_stack
as you will have more than one to pick from.
When the Music menu is open, Tasker uses AM Arm Var profile to set %AMAmazfitTest
variable to 1
, then changes it back to 0
. This is a trigger window in which if media stream had been queried, it will start the music with playback control action.
Playback Action vs Intent
There are 2 ways to start music with Amazfit. You can simply use Media Control action in Tasker to simulate play action, or supply an intent and start a playlist of your choice.
If you can’t get Tasker to start the music playback, make sure that Google Play Music (or your selected player) isn’t kill by Android processes. On my Xiaomi Mi9, I had to enable Auto-start and remove battery optimizations for the music app.
Media Control
This method will continue music playback from the last session. Select Play action – and use simulate a button to start music playback on your Android phone. This should only trigger IF %AMAmazfitTest
is set to 1
.
Intent
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.
Disable Profile when streaming
To prevent further accidental false positives, I used AutoNotification to monitor the Media Playback. Once media stream is in progress, Tasker deactivates the triggering profile AM Play Music.
To clean up triggers further, you will note that I have excluded Amazfit app from the bt_stack
trigger. This app will extensively trigger the bt_stack
event.
Conclusion, comments and download
If you try this, leave me a comment in this Reddit thread. Let me know what Amazfit device did you use and share your LogCat triggers. This way other users will have an easier time implementing this. The only thing that is missing, is the ability to actually store the music on the Amazfit GTR – perhaps in the next iteration?
Project Download
Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.