Open rido-min opened 3 years ago
/c @sandeeppujar @avneet723
Try this
{
"displayName": "Themostat Template 2",
"capabilityModel": {
"@id": "dtmi:com:test:Thermostat;1",
"@type": "Interface",
"contents": [
{
"@type": [
"Telemetry",
"Temperature"
],
"description": "Temperature in degrees Celsius.",
"displayName": "Temperature",
"name": "temperature",
"schema": "double",
"unit": "degreeCelsius"
}
],
"description": "Reports current temperature and provides desired temperature control.",
"displayName": "Thermostat"
},
"@id": "dtmi:com:test:mythemostat",
"@type": [
"ModelDefinition",
"DeviceModel"
],
"@context": [
"dtmi:iotcentral:context;2",
"dtmi:dtdl:context;2"
]
}
With command:
az iot central device-template create -n [applicationid] -k "yourrequest.json" --dtid "dtmi:com:test:mythemostat"
@yang-hai-feng can you point me to the docs describing that file format? It does not conform to the DTDL v2 spec.
/c @briancr-ms
@yang-hai-feng
I read in docs --dtid The ID of the target device template. Example: somedevicetemplate.
but your example suggest to use a malformed dtmi
(without the version) can you clarify?
@yang-hai-feng I read in docs
--dtid The ID of the target device template. Example: somedevicetemplate.
but your example suggests using a malformeddtmi
(without the version) can you clarify?
You are right, the example wasn't updated, as now --api-version preview
will continue support legacy naming "somedevicetemplate", --api-version 1.0
will use the dtmi format, ignore the id example that I provided, we should have more specific documentation regarding this, I will create a bug to track this doc update.
@avneet723, do we have a link of official docs regarding IoT central device template?
az iot central device-template create
does not accept DTDL v2 interfacesTo Reproduce
Install the latest with
az extension remove azure-iot && az extension add azure-iot
Follow the reference docs to create a device template
Use the next DTDL v2 Model as the input file
Expected behavior A device template is added to my central app
Observed behavior
Environment (please complete the following information):