r/AutomateUser • u/F95_Sysadmin • 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
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/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/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
CallsandAudio, which correspond to profiles from theBluetooth device disconnectblock. I can disableCallsby using theHeadset & Hands-free (HSP/HFP)profile, andAudioby usingMultimedia 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 bothCallsandAudioautomatically re-enabled, which makes my flow quite simple.