This problem is killing me, maybe someone has a solution for it?
Basically, I'm using Apple Wireless KB and Magic Mouse in conjuction with an Asus BT-21 bluetooth mini dongle
http://grab.by/aUpE (It was stated that it's Mac complient on the packaging) that has been working for me since early version of Snow Leopard. I never had sleep issues so have never bothered with "Allow bluetooth devices to wake computer" because I have always used the power button to wake.
For some reasone the wake from power button in Lion is somewhat broken (have to tap it twice in order to wake, or else it immediately goes to sleep after attempting to wake) but now it gives me the Sleep/Restart/Shutdown/Cancel menu like on a real Mac if you disable "Allow power buton to sleep the computer" in Power syspref
So i tinkered with the Broadcom kext a little adding my bluetooth device and vendor ids and they're the following:
Vendor ID: 0x0a5c
Product ID: 0x2148
Adding these IDs to the IOBluetooth kext gave me and option to "Allow bluetooth devices to wake this computer" but here the problem starts.
If I try to put my computer to sleep it will instantly wake if I have the option ticked in Bluetooth syspref, a soon as I disable the option the sleep functionality is restored. Also for some reason if the option is ticked if I completely turn the computer off I can see the bluetooth dongle blinking blue, this has lead to my Magic Mouses' batteries draining from 100% to 5% overnight, the Keyboard is not that power hungry but the charge went down a little. Also when enabled my mouse pointer will randomly teleport about an inch in random dirrection when doing things.
I have tried plugging the bluetooth dongle to a non-powered 4-port usb2.0 hub from eBay, the computer sleeps if the option is enabled, however if I hit a key or click the mouse the computer won't wake, only the light appears on the usb hub. If now i type something on the keyboard and then hit the power button to wake everything I have typed will appear immediately as soon as the dcreen wake. meaning bluetooth was on and has awaken the keyboard, but the computer didn't receive a command to wake.
I have tried some _DSM injection to mimic Apple's hardware
http://grab.by/aUyC
but this has no effect ...
So I was wondering if anyone has a way to sort things out with wake using bluetooth devices? I'm really looking forward to using my bluetooth devices...
P.S. I have concidered getting an Apple bluetooth module to install in my machine, but I don't really want to unless I'm 100% sure it will give me normal functionality under Lion and not mimci the same thing that's happening right now.