How to send/write data to a point/device from Cumulocity

What product/components do you use and which version/fix level?

1011.0.12

Are you using a free trial or a product with a customer license?

What are trying to achieve? Please describe in detail.

Till date I have tried to register devices/points into Cumulocity and data from these points/devices is being displayed/monitored on Cumulocity.

Now I need to send/write data from Cumulocity to those registered points/devices.

My questions are -

  1. I need help in understanding which static template/templates can be used to send the data/measurement from Cumulocity to the registered devices/points.

  2. If I want to create a custom template to send data/measurement from Cumuloicty to registered devices/points which MQTT topic can be used to register those custom templates ?

  3. Which section of UI is used to send data/measurements from Cumulocity to registered points/devices ?

Do you get any error messages? Please provide a full error message screenshot and log file.

Have you installed latest fixes for the products

1 Like

Hi Prasad,

Sending measurements from Cumulocity to a device isn’t a scenario I have encountered yet. Why do you want to do this?

Cumulocity supports the concept of operations and real-time notifications to communicate with a device. You can find more information about the built-in operations in the Device management library. You could also create your own templates for your custom operations.

If you tell me more about your use case, I might give you some guidance and examples.

Best regards
Christian

Hi Christian,

I will go through the options you suggested…

Meanwhile… my use case is that -
I need to send a string or json (anything from both will do), to a registered device on Cumulocity using MQTT.

What I want to achieve is,
The registered device will subscribe to a topic & Cumulocity will publish a string or json to that topic.
We have some services running in our device… So when the string or json reaches the device via MQTT, a particular service will get activated and perform its task.

I hope the use case is clear and some hint or example would be really helpful !!

Thank you,
Prasad

Hi Prasad,

if it is about sending a String/JSON to a device, the Shell command might fit best in this case. It already comes with a built-in SmartREST template. You just need to subscribe to the topic s/ds for your device to receive a shell operation.

The necessary steps how you need to process this operation are described in the guide, I have linked in my post above.

Best regards
Christian

Hi Christian,

Glad to hear that, big relief for me :slight_smile: .

As per your suggestion I went through the document ‘Device Management Library’.

In the overview section… I saw this image of a Test Device and the shell section in that device. (please refer below screenshot).

I create a device on Cumuloicty by using the Cumulocity MQTT static template 100. So initially only these sections appears under the device - Info, Alarm, Control, Events, Service Monitoring, Identity.
(please refer below screenshot)

When I start sending measurement a ‘Measurements’ section gets added to the list.
(please refer below screenshot)

Now… my blocker is I am not able to get the ‘Shell’ section in my Device I am creating.

So, can you please guide me as to how I can bring that ‘Shell’ section in any device using MQTT and any other method so I can chose which one is feasible as per my requirement.

Some steps for bringing the shell to my devices would be awesome.

Thank you,
Prasad

Hi Prasad,

you need to first announce the capabilities of your device to Cumulocity as described in the guide. This means, you need to tell Cumulocity that your device actually supports shell command operations. You can use the static template 114 for this to publish a message on the topic s/us. For example: 114,c8y_Command.

Once you have done this, the Shell tab should appear for your device.

Best regards
Christian

1 Like

Hi Christian,

That worked like a charm … :slight_smile:

Really appreciate for your continuous support !!!

I will try some more things around this… and will come back to you for some more help if needed…

Thank you,
Prasad

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.