Same issue with the iMac 2011 (mid.).
I found out at the problem has been open from the year 2010.
And I really hate, when I'm trying to start my iMac from the sleep and Apple wireless keyboard, mouse and trackpad can't connect to my iMac and I need to force shutdown and start again. And losing all my open applications and so on...
So. What I did is this;
Set default hibernatemode from the 0 to the 3.
After this, contents of the RAM is also saved in to the disk ( /var/vm/sleepimage ).
And I also added line;
10 * * * *
/usr/bin/killall -HUP blued
...to the ROOT's crontab.
How to;
Check hibernatemode;
pmset -g hibernatemode
Default is 0 (suspend to RAM). Set this to 3 so Mac hibernates to RAM and disk.
sudo pmset -a hibernatemode 3
So, if You need to force Your Mac to shutdown, You do not lose anything. All open applications and content are as they were before shutdown (handy also when Your Mac is sleeping and power failure occurs). Exept VPN and other network connections.
Second thing is to set up the Bluetooth Daemon restart.
sudo -i
crontab -e
to add line in the editor press keys ESC and i < ESC + i >
type;
10 * * * *
/usr/bin/killall -HUP blued
To save the crontab file, press key :wq! < : + w + q + ! >
This will restart Bluetooth Daemon every 10 minutes.
Ps. checking status of the Bluetooth Daemon would not help. Tested. It seems to be running in the process list when iMac loses connections to devices and do not allow Bluetooth devices to reconnect.