1

As I am going through the documentation regarding "Device Provision" & "Bulk Provision" in Thingsboard, I came to know that the devices can be provisioned via following API,

curl -v -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{"deviceName":"*<name>*","provisionDeviceKey":"*<key>*","provisionDeviceSecret":"*<secret_key>*"}" "https://thingsboard.cloud/api/v1/provision"

The above command will create a new device under default device group ("All" device group). How can we make this API to create a new device under specified Device Group with the help of "Device Group" entity id?

Please provide suggestions.

Thank you.

1 Answers1

1

From what I gather based on the source code

https://github.com/thingsboard/thingsboard/blob/eb16527e4dc6017038c5f3dc93e04a953b19299a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java#L518

It does not seem to be able to create a device within a device group.

What you can do is that you can create a device profile that has a rule chain that will automatically add to the device group on device creation.

jernkuan
  • 630
  • 6
  • 8