|  Developer
Updated on January 5, 2023

hub.device.room.set

Connection type:

Permissions:

  • Place device in a new room.
  • When placing parent device in a new room
  • Child devices for parent device room placing cases:

    • If a child device’s parameter is : place all child devices to a new room or an “Unassigned” (roomId=””).
    • If a child device’s parameter is : place all child device to a new room or an Unassigned” (roomId=””), except the devices listed in separateChildDevices array.
  • When placing some child device in a new room:

    • If a child device’s parameter is : placing the device in another room is prohibited.
    • If a child device’s parameter is : place the child device to a new room or an “Unassigned” (roomId=””).

 

Edit
Field Description
_id
Id of a target device
roomId
Id of a target room
separateChildDevices
List child devices that will not be placed in a new room if their properties are . This parameter makes sense only for parent devices.
Edit
Edit
Broadcast Description
Informs about device state changed. Should contain the flag = in case of a roomId changed for the device.
Edit
Edit
Edit
				
					{
    "method": "hub.device.room.set",
    "id": "_ID_",
    "params": {
        "_id" : "_OBJECT_ID_",
        "roomId": "_OBJECT_ID_"
    }
}				
			
Edit
				
					{
    "api": "1.0",
    "error": null,
    "id": "_ID_",
    "result": {}
}				
			
Edit

Move parent device to another room, but leave the two child devices in their current rooms. Child devices listed should have the = .

Request:

				
					{
    "method": "hub.device.room.set",
    "id": "_ID_",
    "params": {
        "_id" : "_OBJECT_ID_",
        "roomId": "_OBJECT_ID_",
      "separateChildDevices": [ "<childDeviceWithParentRoomFalse1>", "<childDeviceWithParentRoomFalse2>" ]
    }
}				
			
Edit
Code Message Data
-32500 Placing subdevice is forbidden ezlo.device.forbidden.place.subdevice
-32500 No device found! ezlo.device.notfound
-32500 Room not found nma.room.notfound
-32602 Wrong field of object rpc.params.wrong_field