How to get alarm in my html custom widget

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

Cumulocity
Backend: 1015.0.278
UI: 1011.0.38

Is your question related to the free trial, or to a production (customer) instance?

What are you trying to achieve? Please describe it in detail.


I am getting this alarm on Cumulocity through Mqtt now i want to show these alarm on my custom widget i mean how i can listen these alarm on this widget which i have develop in cunulocity using html

i want to show alarm by parsed alarm json in html custom widget refere above image for widget which i developed using html

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

Have you installed all the latest fixes for the products and systems you are using?

Hi @sumit.singh ,

not sure where to start :slight_smile:
First of all your alarms and devices look awkward.
The alarm type seems to a a total mess and should follow the principal “prefix_” Instead it seems you have a json string used as a type which makes it very hard to use within the Cumulocity IoT platform.

Your device name also looks strange. You should have a common naming pattern how you would name your device. Using blanks and underscores and also special characters in the name like % makes it very hard to read and work with the platform.

Now to your initial request: If you would follow the naming patterns of alarms you could use the default alarm widgets in your cockpit. Still if you want to adapt the widget to your needs you should follow the web development guides here: Overview - Cumulocity IoT Guides or here: Cumulocity IoT Web Development Tutorial - Part 3: Query data from Cumulocity IoT (especially how to query data).

Mainly you cannot just use HTML but you need to write a web app (angular preferred) with a component using @c8y/client to retrieve the alarm and visualize it in your widget.

Thank You @Stefan_Witschel , I will follow your suggestion it will help me to develop web app , but how i will able to retrieve alarms for this ,what I will use either from API or from Cumulocity which I have in JSON format on Cumulocity?

Please have a look here: Cumulocity IoT Web Development Tutorial - Part 3: Query data from Cumulocity IoT

The c8y/client comes with an AlarmService:
http://resources.cumulocity.com/documentation/websdk/client/classes/alarmservice.html

So you can easily query any data (also alarms) with it and visualize that data accordingly.

Thank You @Stefan_Witschel It will help me a lot .

Hi @Stefan_Witschel I have gone through the above link which u have provided me ,
I am getting confuse with this web sdk docs ,

I want to develop custom widget using angular so that I can show my alarms on Cumulocity using those custom widget , I have alarm API I want to integrate it in my angular application once custom widget work done and then want to deploy this application on Cumulocity “cloud you please refer me some step by step guide or example” so that I can easily develop my custom widget in angular and deploy it on Cumulocity it will be Helpfull for me ,this will give me clear under standing .

Thanks and regards
sumit singh

Actually the Web Developer Series is exactly what you are looking for:

It is starting with basic setup of web development tooling (Part 1) and ends with building a widget and deploying it to cumulocity.

In part 3 it was explained how to use the c8yclient to retrieve data and visualize it.
So everything is there.

Thank You @Stefan_Witschel for these info , It will give me better understanding for developing web application for Cumulocity .

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