macOS switches to Bluetooth headphones automatically

Presumably since the last update to macOS 10.2.2, the system started to switch to my Bluetooth headphones automatically every time they come in Bluetooth range. That means that my Macbook switches audio output every time I come home (I use them on my iPhone as well). Even if I explicitly set the audio output to "Internal Speakers" on the Macbook, it will still behave like this.

This is very annoying for several reasons, mostly because the Macbook does't seem to be very good at switching BT audio off when no audio is playing, which results in my headphone's battery being empty pretty much every day now.

Does anybody else have this problem? Any solutions?


You can consider setting your Mac not to auto-connect to Bluetooth headphones, using this command in Terminal:

sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist DontPageAudioDevices 1

This will not interfere with Apple Magic Mouse, Keyboard or Trackpad. Only audio devices will not be auto-connected.