Edit an object (PUT)


Note- There are four types of logical device. light, switch, doorSensor, motionSensor. Each type has some common property in the request body. And other properties are different from each other. So, the request body will have different properties based on the value selected for the property type. There are four different request body schema available in the api example.

PUT /v4/sites/{siteId}/objects/{objectId}
Parameters
siteId
uuid required
-
objectId
uuid required
-
when the object type is `light`
Headers
Content-Type application/json
Accept application/json
Authorization Bearer `Your Access Token`
{
    "roomId": "f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "type": "light",
    "capabilities": [],
    "name": "Light #1",
    "bleScanner": true
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "light",
        "switch",
        "motionSensor",
        "doorSensor"
      ]
    },
    "roomId": {
      "type": "string"
    },
    "materials": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "bleScanner": {
      "type": "boolean"
    },
    "attachedResources": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "capabilities": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "const": "dimmable"
          }
        ]
      }
    }
  },
  "required": [
    "type",
    "roomId"
  ]
}

Response 204

when the object type is `motionSensor`
Headers
Content-Type application/json
Accept application/json
Authorization Bearer `Your Access Token`
{
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "type":"motionSensor",
    "name":"MS1",
    "configuration": {
        "motion": {
            "action":"lightOn",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8"
        },
        "absence": {
            "action":"lightOff",
            "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
            "offDelay":900000
        },
    },
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "light",
        "switch",
        "motionSensor",
        "doorSensor"
      ]
    },
    "roomId": {
      "type": "string"
    },
    "materials": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "bleScanner": {
      "type": "boolean"
    },
    "attachedResources": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "configuration": {
      "type": "object",
      "properties": {
        "motion": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightOn",
                "lightOff",
                "sceneOn"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "sceneId": {
              "type": "string"
            }
          },
          "required": [
            "action"
          ]
        },
        "absence": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightOn",
                "lightOff",
                "sceneOn"
              ]
            },
            "offDelay": {
              "type": "number"
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "sceneId": {
              "type": "string"
            }
          }
        }
      },
      "required": [
        "motion",
        "absence"
      ]
    }
  },
  "required": [
    "type",
    "roomId"
  ]
}

Response 204

when the object type is `doorSensor`
Headers
Content-Type application/json
Accept application/json
Authorization Bearer `Your Access Token`
{
    "id":"3c5617df-46c0-48fb-84db-356195aeb351",
    "name":"DS",
    "type":"doorSensor",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "configuration": {
        "open": {
            "action":"lightOn",
            "spaceId":"9c2a07a3-2cf5-4f1d-8eeb-9df28cf56834"
        },
        "close": {
            "action":"lightOff",
            "objectIds":[]
        },
    },
    "attachedResources":[]
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "light",
        "switch",
        "motionSensor",
        "doorSensor"
      ]
    },
    "roomId": {
      "type": "string"
    },
    "materials": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "bleScanner": {
      "type": "boolean"
    },
    "attachedResources": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "configuration": {
      "type": "object",
      "properties": {
        "open": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightOn",
                "lightOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            }
          },
          "required": [
            "action"
          ]
        },
        "close": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightOn",
                "lightOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            }
          }
        }
      },
      "required": [
        "open",
        "close"
      ]
    }
  },
  "required": [
    "type",
    "roomId"
  ]
}

Response 204

when the object type is `switch`
Headers
Content-Type application/json
Accept application/json
Authorization Bearer `Your Access Token`
{
    "name":"2key",
    "type":"switch",
    "roomId":"f9efe159-54ae-4dc7-88e9-fa6a3e64d5d8",
    "variant":"2-key",
    "configuration": {
        "double":{},
        "left": {
            "action":"lightPushDim",
            "objectIds":[]
        },
        "right": {
            "action":"lightOnOff",
            "spaceId":"9c2a07a3-2cf5-4f1d-8eeb-9df28cf56834"
        },
    },
    "attachedResources":[]
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "type": {
      "enum": [
        "light",
        "switch",
        "motionSensor",
        "doorSensor"
      ]
    },
    "roomId": {
      "type": "string"
    },
    "materials": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              }
            }
          }
        ]
      }
    },
    "bleScanner": {
      "type": "boolean"
    },
    "attachedResources": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "variant": {
      "enum": [
        "1-key",
        "2-key"
      ]
    },
    "configuration": {
      "type": "object",
      "properties": {
        "left": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightPushDim",
                "lightOnOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "top": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            },
            "bottom": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            }
          },
          "required": [
            "top",
            "bottom"
          ]
        },
        "double": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightPushDim",
                "lightOnOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "top": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            },
            "bottom": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            }
          },
          "required": [
            "top",
            "bottom"
          ]
        },
        "right": {
          "type": "object",
          "properties": {
            "action": {
              "enum": [
                "lightPushDim",
                "lightOnOff"
              ]
            },
            "objectIds": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "roomId": {
              "type": "string"
            },
            "spaceId": {
              "type": "string"
            },
            "top": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            },
            "bottom": {
              "type": "object",
              "properties": {
                "action": {
                  "enum": [
                    "lightSet",
                    "sceneOn"
                  ]
                },
                "spaceId": {
                  "type": "string"
                },
                "roomId": {
                  "type": "string"
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "on": {
                      "type": "boolean"
                    },
                    "bri": {
                      "type": "number"
                    }
                  }
                },
                "sceneId": {
                  "type": "string"
                }
              }
            }
          },
          "required": [
            "top",
            "bottom"
          ]
        }
      },
      "required": [
        "left",
        "double",
        "right"
      ]
    }
  },
  "required": [
    "type",
    "roomId",
    "variant",
    "configuration"
  ]
}

Response 204