I know this has been done many times online, but I think this shows the best, easiest, and cheapest of some of the different ways I have found.
Most of this deals with the electrical box. I didn't take pictures of the cable build, so it is all in one step, but there is a lot there.
Also the software and a MP3 is at the end.
Let me know if you have any questions.
I will also say that I got the hot/neutral backwards. You don't want to be switching the neutral on and off and constantly pushing electrons down the other lines (the hot). Any leak, insulation damage, or whatever else will results in leaking electrons... and this is never good. So make sure the lines that are being switched are the hot lines, not the neutral.
I have keep this the same (wrong) way so as not to cause more confusion with the colors. If you are doing this I am going to assume you can make this switch without too much problem. Just make sure you are switching the hot, not the neutral.