How to get alarm in my html custom widget

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.