The successful realization of smart grids and smart cities requires the integration and interconnection of buildings, being responsible for about 23% of the world-wide electricity consumption. Interoperability is a key challenge, since state of the art building automation systems have evolved separately and are not designed for such large scale systems. The use of IP communication can be a key enabler to solve this problem having smart grids and smart cities as first applications of the Internet of Things. Thus, the focus of this thesis is to design a novel system protocol stack for the Internet of Things that should mainly rely on open Internet standards and Web protocols. Furthermore, an integration concept for existing building automation system should be created and the proposed system should be evaluated regarding privacy and scalability implications.