This paper describes an approach to discover the functional structure of a typical commercial building with Swarm Intelligence. We use a Swarm Algorithm to analyze a typical logfile and group all sensors and e?ectors in a building into several clusters. These clusters represent the functional structure of the building. The goal is to find a structure in the data, which can be used to optimize the effectors behaviour.