This paper presents CCDM, a new architecture for management of devices, which collect environmental information and give effects to the environment. CCDM provides easy management of devices and distributed execution of gateways for sudden network disruptions. We separate the management system to the control plane and the data plane. CCDM’s easy management is achieved by a logically centralized controller. The controller handles the control plane. All the policy of device management and network information are stored to 2 kinds of scripts; service scripts and resource scripts. The controller transforms the policy to work distributedly at each gateway. Data plane is the data communication between devices and gateways. Gateways, which operate devices directly, works at distributed manner based on the policy on the controller.