Last January I installed a ceiling fan in Brad's room (my old 'library') and set both the fan and the fan lights up to work under the home automation system I have installed in the house. I've had an inquiry or two since then about which modules I used and how the bits and pieces fit together so I figured I'd cover things both at HomeWreckers and on my pages.
The basic disclaimer applies: I'm not a licensed electrician and this article is provided as an overview only; if you don't know what you're doing in home electrical work, hire a licensed electrician to do the work for you.
The setup I've used successfully throughout the house is to tie the fan motor to a relay module and the fan lamp to a dimmer module; I then control each of those though a transmitter mounted in place of the wall switch. I've made no attempts to match a module that can control motor speeds up with a fan motor; the simple on-off action of the relay module along with the fan's own three speed switch has worked fine. The relay modules are available here.
For the lamp portion of the show, I do use a dimming module; that allows the boys to have a 'night light' when the lamps are dimmed to less than 10%. Lamp modules are available here. I have both of the modules installed in a rated box in the attic near the fan mount.
The typical bedroom locally has only one switch to control the overhead, but they also drop the neutral into the box. That allows me to use a transmitter that can not only turn the light and fan on and off, but to dim and brighten the light.
...and while the original article shows Brad programming his evening lighting sequence; that is running on a stand alone controller for the entire house that allows preset functions to occur based on the time of day and dawn/dusk events. None of that is needed for a basic setup.
In the master bedroom, there were switches for both the fan and the light; I replaced those with a wall mounted dimmer and a wall mounted relay. Additional control from the headboard of the bed comes from a mini-controller.
That's a basic overview of what can be done...