Disconnect a specific bluetooth device

chaoscreater

Active member
Hi guys,

I need help creating a macro for disconnecting a specific Bluetooth device. This bluetooth device is a Redmi Watch Lite 2, which is not an audio device. When I turn on bluetooth on my phone, it automatically connects to this device and there isn't a way to stop this auto-connection from happening, unless you unpair the device. I don't want to have to unpair and pair the device every time when I really need to use it.

In MacroDroid, there isn't an option to disconnect a bluetooth device. You can only disconnect a bluetooth audio device.

My phone is rooted and I'm using the Secure Settings plugin, which supports a setting for disconnecting bluetooth device. It works fine for a normal bluetooth device like an earbud or speaker, but it doesn't work for disconnecting my Redmi watch.

I'm well aware of using Constraints here, but that won't achieve anything that I want. I just want to absolutely disconnect specific bluetooth devices.
 
Last edited:

Dimlos

Well-known member
Most smartwatches connect via Bluetooth through a dedicated app, so changing the system's Bluetooth connection may not work properly.
Since they are basically designed to be used with a constant connection, it is difficult to connect and disconnect frequently.
 

Endercraft

Moderator (& bug finder :D)
I use the connect to device option to disconnect. You just need to connect to some random Bluetooth device that you will never use, and use the connect to device setting.
 

chaoscreater

Active member
I use the connect to device option to disconnect. You just need to connect to some random Bluetooth device that you will never use, and use the connect to device setting.
how will that actually disconnect? You can connect to multiple bluetooth devices at the same time on Android.
 

chaoscreater

Active member
Most smartwatches connect via Bluetooth through a dedicated app, so changing the system's Bluetooth connection may not work properly.
Since they are basically designed to be used with a constant connection, it is difficult to connect and disconnect frequently.
I'm not using the dedicated app, in fact I've disabled it and only enable it when I use it. I'm simply referring to the native Android bluetooth setting. Once the bluetooth is enabled, the watch connects to the phone automatically. There isn't an option to turn off bluetooth on the watch, whether it's via the dedicated app, or within the settings on the watch itself.
 

chaoscreater

Active member
OK, so in the Quick Settings, if you expand the bluetooth menu, you can actually disconnect a device the Redmi watch from there. Interesting that you don't see this in the main Bluetooth menu. I ended up creating a solution using UI Interaction.

The other thing worth noting is to disable the setting "Pair compatible device". This is on Xiaomi devices, not sure if this is a setting on other phones. There is a weird behaviour with this setting enabled. If you have a Xiaomi phone and a Xiaomi bluetooth device like the Redmi Watch, then this setting will actually turn OFF and ON bluetooth in order to keep your Redmi Watch connected.

In other words, if you disconnect the Redmi Watch from your phone, it will detect turn OFF bluetooth and turn bluetooth ON and it'll let the watch connect again. It's useful but also annoying at the same time, especially if you have macros that control bluetooth. Interest enough, the "Apps turning on Bluetooth" setting doesn't show anything about this, so it's hard to know why your bluetooth kept connecting to the Redmi Watch unless you pay attention to it. By turning off the "Pair compatible devices" option, this issue is gone.
 

MacroDroidDev

Administrator
Staff member
There is no Android API to disconnect any bluetooth device from an app I'm afraid. A2DP devices cannot be disconnected via a private API hack, so this is why only audio devices are presented as an option. I've looked for similar hacks for other bluetooth connection types but sadly never have found an alternative.
 
Top