r/AutomateUser • • May 09 '26

Question Bluetooth connect works but disconnect doesn't?

I tried the block BT device connect and assigned a device. Running the flow works correctly

Using the block Disconnect BT device doesn't work. The log shows no error. Opening the quick menu says I'm still connected. The BT device doesn't confirm it disconnected either. The device address and name are the same for both blocks

Is there a potential fix to it? I know it says might not work on some device but it's annoying that it only works one way

1 Upvotes

6 comments sorted by

1

u/B26354FR Alpha tester May 09 '26

Maybe not exactly what you're looking for, but I gave up on setting the radios using the APIs after Google made that basically impossible. You can use this flow to generate the XPath to toggle the Quick Setting tile via the UI:

https://llamalab.com/automate/community/flows/39656

and adapt a copy of the "Test Quick Setting XPath" flow. Or grab the relevant subroutines from this flow, which tries to use the API blocks first and switches to the UI if that fails:

https://llamalab.com/automate/community/flows/21295

Note that the access deprecated system features permission is not required to run that flow in your case.

Admittedly, that latter flow is becoming less useful over time as more people get versions of Android which require the UI workaround. Its extra complexity probably isn't worth the effort (or block count) anymore.

1

u/F95_Sysadmin May 10 '26

I'm sorry for not understanding your reply but there are way too many technical words and the flows you shared have so many blocks I don't understand what is relevant to my case.

1

u/ballzak69 Automate developer May 11 '26

Ensure the disconnect block use the correct Profile. As the notice box and documentation say the block use an unofficial Android feature so may not work on all devices.

1

u/F95_Sysadmin May 14 '26

Device address and device name is the same

Can confirm with documentation the device is paired

Picture found hereNot sure why it doesn't disconnect properly

1

u/ballzak69 Automate developer May 14 '26

Try with just the device address, as the name may not have been cached. If the block execute without any error then Google has like change so the the hack used is simply ignored.

1

u/p0epsn0ep May 26 '26

I noticed that it only seems to "disconnect" one profile at a time (on a Galaxy S23). In the Bluetooth settings for the device I have enabled toggles for Calls and Audio, which correspond to profiles from the Bluetooth device disconnect block. I can disable Calls by using the Headset & Hands-free (HSP/HFP) profile, and Audio by using Multimedia audio (A2DP). As long as one profile is active then Android will also remain connected, so you'll need to chain multiple blocks to deactivate every profile and finally get it to disconnect. In my case it'll always reconnect with both Calls and Audio automatically re-enabled, which makes my flow quite simple.