Hello,
I built a device template and mapped it to a device that I connected to Azure IoT Central.
The default component contains basic information such as status, MAC address and so on.
A second component (a custom one, created through the IoT Central GUI) holds information of a sensor module that is connected to the device. There, I defined two Telemetry properties with names 'LevelUnfilled' and 'LevelUnfilledPercentage'.
When data is sent to IoT central, it seems that it is not able to model payload data for the custom component that I created.
When I define the telemetery properties in the default component of the device template, IoT Central is able to model that telemetry property.
In visual below you can see the raw incoming data.
'LevelUnfilledPercentage' telemetry property is being mapped to the default model (where it is defined), but the 'LevelUnfilled' telemetry property is not mapped to the custom component where it is defined.
Payload of incoming message is defined as follow:
{
"s": 6,
"t": "2020-12-07T14:54:24Z",
"q": 192,
"c": 0,
"ai1": 18.559,
"ai_st1": 1,
"LevelUnfilled": 0.18012499999999988,
"LevelUnfilledPercentage": 90.99375
}
Also, there is nog Model ID passed in the message as the device template is manually assigned in the IoT Central GUI.
Following the troubleshoot page, I executed following command to see the issues related to incoming messages from the device:
az iot central diagnostics validate-messages --app-id <APP ID> --device-id <DEVICE ID>
This results in following warning message:
[WARNING] [DeviceId: <DEVICE ID>] [TemplateId: dtmi:modelDefinition:ljoar7ke:tsrm4ukrlv] Device is sending data that has not been defined in the device template. Following capabilities have NOT been defined in the device template '['s', 't', 'q', 'c', 'ai1', 'ai_st1', 'LevelUnfilled', 'LevelUnfilledPercentage']'. Following capabilities have been defined in the device template (grouped by interface) '{}'.
The strange thing here is that de TemplateId mentioned in warning above does not correspond to the template ID I can find in the Device Template when I look at the default component interface ID in IoT Central. I tried to pass the interface ID from my model template with my device message, but a warning is recieved that the template id is nog known either.
Any idea why custom component data is not modeled correctly but only data that is defined in the default component interface?
Thanks in advance.
Best regards