With advances in numerous technologies, our world is moving towards an ``always connected" paradigm. Internet of Things (IoT) is a tangible realization in this new paradigm and enables connectivity from “anytime, anywhere for anyone” toward “anytime, anywhere for anything”. With IoT, objects (e.g., toothbrush, door, window, etc.) in our daily lives are able to be connected with each other. These connected objects can sense the environment, communicate with each other and even transport various information to cloud servers, allowing service providers to make better decisions and take more appropriate actions. Home automation is a promising application in IoT that provide users a more convenient, comfortable and secure living environment through connected objects. There are generally two steps involved to set up a home automation system. The first step is to establish physical connections between objects in the house and a gateway that is connected to the Internet. The second step is to set up logical connections between objects so that the system can provide service accordingly. Setting up physical connections in current home automation systems usually requires professional installation, which is expensive and difficult to modify once they are set up. In this thesis, we propose an automatic solution for both steps. In our solution, clustering algorithms are used, base on the received signal strength measurements, to group objects that are in the same control zone. In home automation, the topology of control zones follows certain patterns, which are different from the random topology in other applications such as the intelligent transportation system (ITS). Based on this observation, hierarchical clustering algorithm is adopted. Simulation and experiment results show that more than 90 percent of objects can be automatically set up.