A method of operating a gateway device in a control network, the method comprising: storing on the gateway device: an address of a gateway registry, and a serial number of the gateway device, and a key; using the address of the gateway registry to communicate between the gateway device and the gateway registry; sending, from the gateway device over the remote network, a request to the gateway registry specifying the serial number of the gateway device; in response to the request, receiving in the gateway device, from the gateway registry over the remote network, a response including an address of a gateway server that has an account associated with the gateway device for managing a set of local management devices connected to a local network located at the location associated with the gateway device; wherein the gateway registry is included on a first server and the gateway server is included on a second server located physically separate from the first server, and in response to the request, receiving in the gateway device, from the gateway registry over the remote network, an identification of the account associated with the gateway device for managing the location The gateway device of claim 1 , wherein the logic for managing the set of local management devices comprises automation logic that initiates actions with respect to the local management devices upon certain conditions.