1. A method for controlling at least one device in at least one building, the method comprising: selectively transferring, by a control system comprising a server and a number of gateways, at least one application from the server to a particular gateway of the gateways or from the particular gateway to the server based on at least one transfer rule; and controlling, by the control system, the at least one device via the at least one application.