Using alarms
The com.apama.cumulocity.Alarm is sent on an alarm from a device. This event is sent to the com.apama.cumulocity.Measurement.CHANNEL (same as cumulocity.measurements) channel. This event contains the identifier of the source, a timestamp (same form as currentTime), message text, and optional parameters.
Example of an alarm:
com.apama.cumulocity.Alarm("44578840","c8y_UnavailabilityAlarm","44578839",
1529496204.346,"No data received from device within required interval",
"ACTIVE","MAJOR",1,{"creationTime":any(float,1529496204.067)})