The main goals of smart grids are to provide an interface for fair transaction of electricity and to optimize the power flow in electric power networks with less required extra energy storages, particularly in case of integration of renewable energy sources (e.g. photovoltaic and wind) and the plug-in Hybrid Electric Vehicles. Currently, the control principles in smart grids are mainly market-oriented (e.g. agent-based control and event based control), which do not really take into account the constrains of electric power networks. Moreover, the response time of coordination and control via ICT infrastructure might be significant (few seconds to several minutes). Therefore, the architecture and control principles of smart grids have been enhanced and presented. Particularly the concept of virtual agent has been introduced, which interacts the business model of smart grids (e.g. agent based control) to optimize the power flow. Additionally the time shift-able sources/loads of office buildings (e.g. plug-in hybrid electric vehicles) are treated as another means of grid control. The evaluation results verify the architecture and control principles which are presented in this paper.