Init5
Init5

Reputation: 31

How do I send telemetry data via mqtt to a second component in IoT Central?

I am at a bit of a loss and need a bright idea.

I have created a new device model in IoT Central which has two components and an interface. The interface is also in the default component.

Device Model

If I now send my data via mqtt, I do this via mqtt to the endpoint /devices//messages/events.

mqtt request

This works so far that my telemetry data can be assigned to the properties of the default component and the interface contained there.

raw data

However, I do not manage to assign data to the second component. These are always displayed as _unmodeleddata.

My question: Why is the telemetry data for the second component not matched against the data model?

Thank you for the explanation.

Best Regards Init5

Upvotes: 0

Views: 431

Answers (1)

Roman Kiss
Roman Kiss

Reputation: 8265

Sending the telemetry data must be done by component with a specific component name. Only a default component doesn't need this name.

The following example shows how can be setup this component name in the topic in the case of direct MQTT protocol:

devices/mydevice/messages/events/$.ct=application%2Fjson&$.ce=utf-8&$.sub=myComponentName

More details here.

Upvotes: 1

Related Questions