I see the "detect displays" icon pop up when I hold down the option key, but both the TV and the computer monitor are pitch black when I plug the HDMI cable in, meaning I can't now navigate the cursor to the "detect displays" button. So frustrating! I'm tempted to buy an AppleTV and just stream over AirPlay... But, of course, that's another $100 for a functionality that should come bundled with a $2K computer...
PROBLEM SOLVED!!! (In my case, at least)
My Apple tech support guy came back a day earlier than expected, said to remove a couple of plist files, and it now works perfectly with HDMI, my projector, my external monitor, etc.
I had already removed one of the plist files a few days ago (which in itself hadn't worked), but when I removed the other, it did. I would suggest removing both.
Go to Finder.
In the root directory (MacBookPro or whatever your HD is called), go to Library, go to Preferences, find com.apple.windowserver.plist and put it into Trash
In your own user directory, go to Library (in Finder, click Go menu and hold Option key down to get to Library), go to Preferences, go to ByHost directory, find com.apple.windowserver.OE35739etc,etcxxxxxxxxxxx.plist, and put it into Trash.
You do not have to empty Trash.
The HDMI should be working now, and permanently so.
If it isn't, post it here and I'll let the Apple tech guy know.
This fixed the same issue on my macbook - thank you so much, such an annoying thing!
Yosemite v 10.10.2 (14C109)
Model Name: MacBook Pro
Model Identifier: MacBookPro10,1
Processor Name: Intel Core i7
Processor Speed: 2.3 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 6 MB
Memory: 8 GB
I found a way to fix this. Before you plug the cable in, check "Show mirroring options in the menu bar" under System Preferences>Displays. When you plug the cable in, you will find the AirPlay icon in the bar on the top right. Click on this and it will show that it is checked off as whatever device you are plugging into (ex. mine said Sony TV), but instead of this you want to check "Built-In Display."