There is currently a good range of real-time clock chips available for use in microcontroller systems. One interesting, low-cost example is the DS1307 from Dallas Semiconductor which has a built-in serial I2C interface.
Click below to download a PDF copy of this article from Elektor magazine.
These days a lot of options exist if you want to control home electrical appliances. This book covers a do-it-your-self system made from recycled components.