Product/components used and version/fix level:
Cumulocity IoT 1020.296.0
Detailed explanation of the problem:
As mentioned in the title we use Smart REST to create devices. In particular we already created a root device and we are now creating some child devices.
We are able to create a child device but the external id bounded to that device is not what we expect.
Indeed from the docs about child device creation is stated that:
[…] an externaId for the child will be created with type
c8y_Serial
and the value a combination of the serial of the root device and the unique child ID.
The value of the external id of the resulting child device is just the id included in the mqtt message.
The code:
String childDeviceName = "childSensor";
String childDeviceType = "dac_sensor";
String childId = "1";
String staticTemplateCode = "101";
client.publish("s/us",
(staticTemplateCode + "," + childId + "," + childDeviceName + "," + childDeviceType).getBytes(), 2,
false);
Should I manually create the combination of parent and child id?
Error messages / full error message screenshot / log file:
Question related to a free trial, or to a production (customer) instance?
Customer instance