A mobile terminal comprising: a camera; a memory configured to store information; a touchscreen configured to display information; a communication unit configured to perform wireless communication with at least one device; and a controller configured to: cause the touchscreen to display an image of a preview image obtained by the camera or a previously stored image, wherein the displayed image includes a plurality of devices (902, 904, 906, 908) and corresponds to a specific indoor area where the mobile terminal is located; detect a user's selection of at least a part of the plurality of devices (902, 904, 906, 908) to be connected to each other, wherein the user's selection is detected as a continuous drag input that is started at a region of the display unit to select a first device of the plurality of devices (902, 904, 906, 908); establish a network in which the selected plurality of devices (902, 904, 906) selected by a drag trace are connected to each other; detect that the continuous drag input is terminated at the region of the display unit to determine that the continuous drag input forms a closed loop; when the continuous drag input forms a closed loop, generate set information in which the selected plurality of devices (902, 904, 906) selected by the closed loop drag input are connected to each other, and store the set information including connection information on a state in which the selected plurality of devices (902, 904, 906) is connected to each other and operational state information on the operation states of the selected plurality of devices (902, 904, 906) at the time of storing the connection information; and cause the selected plurality of devices (902, 904, 906) to operate according to the operation states at the time of storing the set information in response to a selection of the stored set information. a camera; a memory configured to store information; a touchscreen configured to display information; a communication unit configured to perform wireless communication with at least one device; and a controller configured to: cause the touchscreen to display an image of a preview image obtained by the camera or a previously stored image, wherein the displayed image includes a plurality of devices (902, 904, 906, 908) and corresponds to a specific indoor area where the mobile terminal is located; detect a user's selection of at least a part of the plurality of devices (902, 904, 906, 908) to be connected to each other, wherein the user's selection is detected as a continuous drag input that is started at a region of the display unit to select a first device of the plurality of devices (902, 904, 906, 908); establish a network in which the selected plurality of devices (902, 904, 906) selected by a drag trace are connected to each other; detect that the continuous drag input is terminated at the region of the display unit to determine that the continuous drag input forms a closed loop; when the continuous drag input forms a closed loop, generate set information in which the selected plurality of devices (902, 904, 906) selected by the closed loop drag input are connected to each other, and store the set information including connection information on a state in which the selected plurality of devices (902, 904, 906) is connected to each other and operational state information on the operation states of the selected plurality of devices (902, 904, 906) at the time of storing the connection information; and cause the selected plurality of devices (902, 904, 906) to operate according to the operation states at the time of storing the set information in response to a selection of the stored set information. cause the touchscreen to display an image of a preview image obtained by the camera or a previously stored image, wherein the displayed image includes a plurality of devices (902, 904, 906, 908) and corresponds to a specific indoor area where the mobile terminal is located; detect a user's selection of at least a part of the plurality of devices (902, 904, 906, 908) to be connected to each other, wherein the user's selection is detected as a continuous drag input that is started at a region of the display unit to select a first device of the plurality of devices (902, 904, 906, 908); establish a network in which the selected plurality of devices (902, 904, 906) selected by a drag trace are connected to each other; detect that the continuous drag input is terminated at the region of the display unit to determine that the continuous drag input forms a closed loop; when the continuous drag input forms a closed loop, generate set information in which the selected plurality of devices (902, 904, 906) selected by the closed loop drag input are connected to each other, and store the set information including connection information on a state in which the selected plurality of devices (902, 904, 906) is connected to each other and operational state information on the operation states of the selected plurality of devices (902, 904, 906) at the time of storing the connection information; and cause the selected plurality of devices (902, 904, 906) to operate according to the operation states at the time of storing the set information in response to a selection of the stored set information.