Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

FocusAndEarnIt

macrumors 601
Original poster
May 29, 2005
4,624
1,063
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.
 
  • Like
Reactions: realjimsander

FocusAndEarnIt

macrumors 601
Original poster
May 29, 2005
4,624
1,063
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,624
1,063
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.
 
  • Love
Reactions: realjimsander

lucas

macrumors regular
Jun 6, 2005
122
34
Australia
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.
I just wanted to say you’re a legend for continuing to post your findings even without much engagement with the thread, very much appreciated.

I’m going to give this a shot once I get to work because it’s so damn annoying. I had Bluetooth turning off on sleep as a workaround previously but that sucks because you lose Apple Watch unlock. Unpair on sleep (and easy pairing) seems like a much more easy to live with compromise. I wish Apple hadn’t removed the “don’t let Bluetooth devices wake this Mac” setting, since it did exactly what I need
 
  • Like
Reactions: realjimsander

lucas

macrumors regular
Jun 6, 2005
122
34
Australia
Works a treat! Having to repair headphones every time the mac wakes is a pain, but less of a pain than the QC35s pairing to my supposed-to-be-asleep headphones and causing whatever my phone is playing to go silent.

FWIW, I used a more shell script focused approach using another tool from brew called sleepwatcher instead of control plane, and a ~/.sleep file that looks like

Code:
#!/usr/bin/env bash
if [[ "$(pmset -g batt | head -n 1 | cut -d \' -f2)" != 'AC Power' ]]; then
  /usr/local/Cellar/blueutil/2.9.0/bin/blueutil --unpair xx-xx-xx-xx-xx
fi

Which unpairs any time the machine sleeps while not connected to power (like when it's going in my backpack). Much better than disabling bluetooth completely on sleep

Also, getting the bluetooth MAC address can be done in the terminal with blueutil --paired, in an easier to copy/paste format (unless I missed the easy way to get it from the alt menu?)
 
Last edited:

realjimsander

macrumors newbie
Sep 30, 2023
1
1
I created an account here just to be able to thank you for this. This issue is SO annoying, and your solution is great. Like Lucas said, you're a legend, especially for posting the follow-up.
Same here... got a chuckle out of his "...I'm basically talking to myself...", just had to thank him for his persistence and following up here.
 
  • Haha
Reactions: FocusAndEarnIt
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.