Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

FocusAndEarnIt

macrumors 601
Original poster
May 29, 2005
4,577
938
My MacBook Pro (M1 Pro 16") aggressively connects to my headphones (which are actually hearing aids but running on Bluetooth 4 protocol [brand: Phonak], let's just treat them as normal headphones for simplicity's sake) as soon as I come in range of my MBP. The headphones can accept multiple connections to bluetooth simultaneously (2), but only one can play at a time. The headphones are paired to my phone and to my Mac. I also don't have the choice to disable bluetooth on my Mac completely as I need it for other things. This behavior is super annoying as whenever this happens the MBP is usually not even in the same room.

To make matters worse, when it connects to the hearing aids, the hearing aids soften environmental sounds so it can help me "focus" on hearing the sound that's coming from the Mac (of which there is no sound). It effectively just dampens the sound that I hear whenever it connects to my Mac and I have to manually disconnect them. I share these details to show how severe of a problem it is for me.

So far I've tried (with no success) to:

  • add the headphone MAC address to /Library/Preferences/com.apple.Bluetooth.plist IgnoredDevices and rebooted
  • change the value of /Library/Preferences/com.apple.Bluetooth.plist DontPageAudioDevices
  • look for the "options" button in the bluetooth settings (System Preferences), but there's none

Anyone have any thoughts on how to prevent auto-connection? The only solution I effectively have is to delete the pairing on the Mac end of things and manually reconnect it every time I want to use bluetooth with my hearing aids/headphones.

NOTE: For those informed about hearing aids: these are NOT made for iPhone hearing aids. They do not run on bluetooth LE. They run on full fledged bluetooth 4 and hence prefacing treating the hearing aids like a normal set of headphones, which is how the Mac treats them. The Mac sees them as headphones, not as hearing aids.
 

FocusAndEarnIt

macrumors 601
Original poster
May 29, 2005
4,577
938
Here's my workaround... not automatic, but uses homebrew + keyboard shortcuts

1. install blueutil after installing homebrew. Instructions to install homebrew here.
2. You may need to add homebrew to your path:
Code:
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> $HOME/.zprofile
3. Install bluetutil:
Code:
homebrew install blueutil
4. Use AutomatorQuick ActionsRun Shell Script
5. IMPORTANT: Set Automator to receive no input and work in any application
6. Create two SEPARATE scripts (two separate files in Automator) that contain blueutil commands to pair and unpair to your bluetooth device

To pair:
Code:
# pair
/opt/homebrew/Cellar/blueutil/2.9.0/bin/blueutil --pair XX-XX-XX-XX-XX-XX

To unpair:
Code:
# unpair
/opt/homebrew/Cellar/blueutil/2.9.0/bin/blueutil --unpair XX-XX-XX-XX-XX-XX

** Note that for this to work in Automator, you need to spell out the entire path to the blueutil file. In Monterey, this was the path that I found. Any updates to blueutil (eg, version number or otherwise) may require an update to the path.

** XX-XX-XX-XX-XX-XX is the MAC address for the bluetooth device. You can find this by pressing the option key on the bluetooth menu in the Mac menu bar.

7. Set up keyboard shortcuts to the Automator quick actions in one of two ways:
- 1. with System PreferencesKeyboardShortcutsServices. The new actions should be under General if you set to receive no input.
- 2. Personally, I use BetterTouchTool and configured the shortcuts that way. You need to be able to find the Automator quick action, which was found in /Users/your-user/Library/Services/

Now when you turn your bluetooth device on, simply use your keyboard shortcut to pair. And when you're done, turn it off and run the unpair action.

While not entirely ideal, it does streamline the process a bit. These instructions were modified and updated from this thread on StackExchange.
 
Last edited:

FocusAndEarnIt

macrumors 601
Original poster
May 29, 2005
4,577
938
Although I'm basically talking to myself, I put this additional bit here in case it helps someone else too in the future.

To automate things a bit, I came up with a solution that automatically removes my headphones from my bluetooth connections every time my Mac goes to sleep or closes its lid. For me, this works. Others may not like this.

This was inspired by this post. But the software that made this possible (ControlPlane) is no longer available...

But - I got a hold of ControlPlane via wayback machine: https://web.archive.org/web/2020041...app.com/2017/11/03/the-state-of-controlplane/

Still working for what I need it for in Monterey.

I made an AppleScript app - very simple -
Code:
do shell script "/opt/homebrew/Cellar/blueutil/2.9.0/bin/blueutil --unpair XX-XX-XX-XX-XX-XX"

I saved this script as an application. The sole purpose of this app is to unpair the bluetooth device.

Then using the principles of that post explaining how to use ControlPlane, I set it up to run the app every time I close the lid or when the Mac goes to sleep.

Now, if I forget to manually disconnect the headphones, my Mac will automatically do it for me when I walk away from it or close the lid. It's working beautifully.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.