Making audio failover properly from one device to another

view full story

http://askubuntu.com – I'm using a Motorola S305 Bluetooth headset with my laptop. It works great. I'm only having two annoying "problems" with it: When I turn it on, I have to manually go into Sound/Output and select it in the device list. When I turn it off, my computer automatically selects HDMI output from the output list instead of "Internal Audio Analog Stereo," so I don't hear any sound until I go into Sound/Output and select "Internal Audio Analog Stereo" instead of HDMI out. How can I automate things so that when my Bluetooth headset turns on, it is used for sound output, and that when it's turned off, (HowTos)