How i can create and register custom templates for sending messurmentes in cumulocity iot

how i can create or register custom templates for sending messurmentes in cumulocity iot in nodejs and i am sending cov data like {pointID : 1234e456757fdggfbn6,data:130} i am sending in messurments and i want to see this data in messurments .

1 Like

Hi Sumit,

how do you send those measurements to Cumulocity in nodejs? If it is via MQTT you will find information about custom templates in this thread and in the official documentation.

In case you are using the REST API, it isn’t required to register any custom templates for sending measurements. You just need to follow the structure for measurements, which is described in the Cumulocity OpenAPI specification.

Best regards
Christian

1 Like

I am doing via mqtt
Thanks for your support Christian

1 Like

hi christian
can i send string enum data type data on cumulocity meassurment section ,is it possible to send any kind of data can be send custom templates for meassurments if yes then how can i do that help me with steps ?

Hi Sumit,

please have a look at this post.

Best regards
Christian

1 Like

Hi Christian
what kind of data we will able to send in event using widget process and how it will look like?

Hi Sumit,

to have the Process Widget pick up your event correctly, you need to define a mapping of the event in the Process widget. For example, you have an event, which describes a process step:

{
  "source": {
    "id": "8237"
  },
  "type": "c8y_DobotProcessEvent",
  "time": "2022-05-03T09:29:11.704Z",
  "text": "Dobot Status: Idle",
  "status": "Idle"
}

The relevant field, which should be processed by the widget, is the status property. Inside the widget configuration you declare the mapping, e.g.:

You need to define Event Type which is the type of your event. In the example above the value is c8y_DobotProcessEvent. In addition, you need to specify the property, which should be processed by the widget. In this case it’s the status property. Last, you have define the mapping for the values of the status property.

For the configuration above it will look like this:

Hope this helps

Best regards
Christian

1 Like

Thanks for your support
so i can ADD any data type in process widget right? like enum,string , BitString .

Hi Sumit,

not sure what you mean by:

i can ADD any data type in process widget right? like enum,string , BitString .

The process widget only processes Cumulocity events and evaluates a field, which needs to be configured in the settings of the process widget. The mapping for this field are defined in the Field Value column, which takes Strings as an input.

What do you mean by adding any data type in the process widget?

Best regards
Christian

thank u for your your respond adding any kind of data means suppose i have events and what ever i have in events i can use that in process widget but now its clear thanks for your support.