Using relays to control the switching of a mains powered fan and lamp. Goes with this blog article... http://raspi.tv/2012/pi-controlled-li...
A Python program reads a temperature sensor and if too hot, switches on the fan. At the same time, it reads a light sensor, and if too dark, switches on a light. All controlled through GPIO ports on the Raspberry Pi. Don't try this unless you really know what you are doing with mains electricity. Danger of death.