Bluetooth mouse stops working almost everytime I wake my mac from sleep [duplicate]

I use my mac (yosemite 10.10) at work with bluetooth mouse and at home with just the trackpad. Whenever I bring my mac back to work and start it up, >90% of the times it can't find the mouse. Turning bluetooth on/off, trying trickery with turning mouse on and off and all that doesn't work. Restarting blued didn't work. Removing mouse from bluetooth settings and trying to re-pair didn't work (could not find the mouse). Changing the batteries didn't help. The only thing that works, is rebooting the mac. After this everything works as it should.

I find this not to be the correct solution. I mean this can't be a hardware fault, can it? And if not, resetting/restarting some piece of software should do the same trick as rebooting the mac.

My mouse is apple magic mouse. I have no bluetooth keyboard.


I've had issues reconnecting my bluetooth keyboard & trackpad since upgrading to Yosimite. I run this script via custom Automator Application:

  1. Search for (Spotlight search) and run Automator
  2. Click "New Document" at bottom
  3. Choose "Application" for new file type
  4. Click on "Utilities" from list
  5. Double-Click "Run AppleScript"
  6. Replace (* Your script goes here *) with:

    do shell script "kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport; 
    kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport" with administrator privileges
    
  7. Press play to test (will prompt for password)
  8. File->Save to desktop or wherever

Run the automator app whenever bluetooth devices won't connect