For one, read up on how to bleed our cooling system as that's undoubtedly one issue you have.
How long have you had car? If you'd lost a bit of coolant, you'll want to find a leak...and, btw, your thermostat is broken...broken open. Not an emergency, but not good for your car.
As far as losing power only when heat is on, that's an odd one...but I think that sound you've got is a bad pulley...and if I'm right, you should replace all three pulleys (2 tensioner and 1 idler) and check the other pulleys.
Tim is right...of course...that you should get codes read. You could try your regional forum and ask if anyone can swing by and read your codes. You might get more offers if you also post a photo of Marisa Tomei and pretend it's you...almost all the guys here think she's beautiful and would do anything for her. I won't tell!
Debut Radio Show Tuesdays from 1-2-ish p.m. EST on Hamiltonradio.net The Mechanical Animals
call in for car repair help! 609-503-4058
A recent set--NSFW audio: https://youtu.be/_dcxcZfD6dg
Mangofy your E46!