1. A method of controlling devices connected to a controller, the method comprising: receiving, from a server, a service rule comprising a first trigger condition and a first device executing action which is an action to be performed by one of the devices according to whether the first trigger condition is satisfied; selecting one of the devices connected to the controller based on the received service rule; modifying the received service rule to control the selected device based on a specification of the selected device, wherein the modifying includes changing the first trigger condition to a second trigger condition and changing the first device executing action to a second device executing action, and the modified service rule includes the second trigger condition and the second device executing action which includes information about an action to be executed when the second trigger condition is satisfied; and controlling the selected device according to the modified service rule.