Difference between revisions of "V2/Concepts/Event"
(8 intermediate revisions by 2 users not shown) | |||
Line 12: | Line 12: | ||
==== Inputs ==== | ==== Inputs ==== | ||
You can define '''Inputs''' tags in the Event. These Inputs tags are linked to values or tag of input data coming from the related Expression. By doing so, you can embed the '''Inputs''' in the Description. You can learn more on how to embed the '''Input''' in the Description as described [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Inputs|here]]. | You can define '''Inputs''' tags in the Event. These Inputs tags are linked to values or tag of input data coming from the related Expression. By doing so, you can embed the '''Inputs''' in the Description. You can learn more on how to embed the '''Input''' in the Description as described [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Inputs|here]]. | ||
+ | |||
+ | [[File:Concepts_Automation_Expression_Event_Mapping.png|thumb|800px|Expression Input Data to Event Inputs Mapping|center|link=]] | ||
==== Example ==== | ==== Example ==== | ||
Line 33: | Line 35: | ||
==== Command ==== | ==== Command ==== | ||
− | Commands can be sent to external system integrated with Senfi to directly control the sensors in the external system. E.g. Command sent to | + | Commands are requests that can be sent to external system integrated with Senfi to directly control the sensors in the external system. If the Connector/subsystem agrees to the request, the Asset's Metric value may be updated to reflect the change. E.g. Command sent to backup chiller to turn it on when the main chiller malfunctions. |
==== Webhook ==== | ==== Webhook ==== | ||
Line 46: | Line 48: | ||
* '''Condition''' is <tt>iot_chiller_v1.status = failed to run</tt> | * '''Condition''' is <tt>iot_chiller_v1.status = failed to run</tt> | ||
* '''Event''': Chiller equipment malfunctioned | * '''Event''': Chiller equipment malfunctioned | ||
− | * '''Event Input''' | + | * '''Event Input''': <tt>device_id</tt> and <tt>chiller_status</tt> |
* '''Notification Action''': Email, with body text: | * '''Notification Action''': Email, with body text: | ||
:<tt>"Chiller device no: ${device_id} has malfunctioned. Chiller status: ${chiller_status}. Please investigate."</tt> | :<tt>"Chiller device no: ${device_id} has malfunctioned. Chiller status: ${chiller_status}. Please investigate."</tt> | ||
Line 56: | Line 58: | ||
At the same time, the backup chiller will automatically startup and take over the malfunctioned chiller, and a work order will be issued to request for chiller maintenance repair. | At the same time, the backup chiller will automatically startup and take over the malfunctioned chiller, and a work order will be issued to request for chiller maintenance repair. | ||
− | Note: "device_id" | + | Note: "device_id" comes from the Device ID Tag of the <tt>iot_chiller_v1</tt> measurement that identifies a particular chiller. "chiller_status" is mapped to <tt>iot_chiller_v1.status</tt> metric as specified in the Expression that triggers this Event. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == External Events == | |
− | * | + | External Events are specialized Senfi Events that are triggered by external systems. Examples of external events are: |
− | * | + | * A new Motion Detected alarm raised from Milestone XProtect VMS -> Motion Detected New external event |
− | + | * An acknowledged Motion Detected alarm update from Milestone XProtect VMS -> Motion Detected Acknowledged external event | |
+ | * A closed Motion Detected alarm update from Milestone XProtect VMS -> Motion Detected Closed external event | ||
− | + | External events are handled similarly to events raised by Expression created in the CMS. External events can: | |
+ | * Have actions (notification, command, webhook) added to them | ||
+ | * Raise alarms | ||
− | + | Note: Senfi currently do not allow direct raising of alarms from external systems. All external alarms must be raised by proxy using external events, which then trigger Senfi alarms using Senfi's automation workflow. | |
− | |||
− | |||
− | === | + | === Similarities of External Events to general Senfi Events === |
− | + | Similarly to events, External events have the basic general information: | |
+ | * Name | ||
+ | * Description | ||
+ | * Inputs | ||
− | === | + | === Differences between External Events to general Senfi Events === |
− | + | Differences between External Events and Events created in the CMS: | |
− | + | * External events are created by Senfi HTTP API only. They cannot be added in the CMS. | |
− | : | + | * External events are updated by Senfi HTTP API only. They cannot be updated in the CMS (except for adding/updating/deleting event Actions). |
− | + | * External events are deleted by Senfi HTTP API only. They cannot be deleted in the CMS. | |
− | + | * CMS can only view External events and add/update/delete event Actions | |
− | + | * CMS cannot enable/disable External events | |
− | + | * Senfi Expression cannot trigger External events | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | [[File:External_Events_in_CMS.png|thumb|800px|Example of an external event when viewed in Senfi CMS (Editing of name and description is prohibited)|center|link=]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ==== What's Next ==== | |
+ | ----- | ||
+ | * [[V2/Concepts/Preparing for Event Creation|What is needed to create an Event]] | ||
+ | * Start [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event|creating your own Event]] | ||
+ | * Learn about [[V2/Concepts/Alarm|Alarm]] |
Latest revision as of 19:00, 7 June 2022
Event
Whenever Result changes (from true to false and vice versa), Events may be triggered. Events includes Actions such as sending of notifications, commands to systems or request to a webhook.
General Information
Name and Description
An Event has a Name and Description. The Name and Description allows you to describe the event or situation that the Expression detects, such that recipients of the Event's notification or Alarms knows exactly what happened and is able to react to it accordingly.
- The Event's Name and Description is displayed in the Alarm Description on the Digital Twin.
Description can also be the default content of an Action. You can describe the event or situation once in the Description, and reuse the information in all the Actions of the Event.
Inputs
You can define Inputs tags in the Event. These Inputs tags are linked to values or tag of input data coming from the related Expression. By doing so, you can embed the Inputs in the Description. You can learn more on how to embed the Input in the Description as described here.
Example
Using our Smart Weighing Scale measurement from earlier, the general information for one simple Event can be as follows:
- Name: Battery level low
- Inputs: weighing_scale_id, current_battery_level
- Description: Weighing scale $(weighing_scale_id) battery level is running low. Current battery level: $(current_battery_level)
Action
There are 3 types of content options available for Action, namely:
- Notification
- Command
- Webhook
Notification
Notifications such as Email, SMS and Telegram can be sent to personnel listed upon Event execution. You will be able to describe the event or situation that has happened to the recipient of the notification in the subject and message of a notification.
To further aid you in describing the event, you can embed the Event Input in the subject and message of a notification.
Take a look at this more detailed example.
Command
Commands are requests that can be sent to external system integrated with Senfi to directly control the sensors in the external system. If the Connector/subsystem agrees to the request, the Asset's Metric value may be updated to reflect the change. E.g. Command sent to backup chiller to turn it on when the main chiller malfunctions.
Webhook
Webhook request can be sent to external systems such as work order system via Webhook address. You can pass the required parameters in the message body of a Webhook.
Detailed Example
The event that you would like to be notified about is chiller malfunction in a building. There are chiller equipment to help power the air-conditioning in a building. When the status of a chiller shows that it has failed to run, the chiller probably has malfunctioned. You would like to be notified by email of such an occurrence, automatically switch on the backup chiller and issue a work order for maintenance repair.
- The Input in this example would be the metric and measurement that readings from chiller equipment is sent to. e.g: iot_chiller_v1.status
- Condition is iot_chiller_v1.status = failed to run
- Event: Chiller equipment malfunctioned
- Event Input: device_id and chiller_status
- Notification Action: Email, with body text:
- "Chiller device no: ${device_id} has malfunctioned. Chiller status: ${chiller_status}. Please investigate."
- Command Action: Send command to backup chiller to turn it on.
- Webhook Action: Send webhook to issue work order for chiller maintenance repair.
With the above Expression configured, when iot_chiller_v1.status is equivalent to failed to run, an email will be sent with the body text:
- "Chiller device no: 05 has malfunctioned. Chiller status: failed to run. Please investigate."
At the same time, the backup chiller will automatically startup and take over the malfunctioned chiller, and a work order will be issued to request for chiller maintenance repair.
Note: "device_id" comes from the Device ID Tag of the iot_chiller_v1 measurement that identifies a particular chiller. "chiller_status" is mapped to iot_chiller_v1.status metric as specified in the Expression that triggers this Event.
External Events
External Events are specialized Senfi Events that are triggered by external systems. Examples of external events are:
- A new Motion Detected alarm raised from Milestone XProtect VMS -> Motion Detected New external event
- An acknowledged Motion Detected alarm update from Milestone XProtect VMS -> Motion Detected Acknowledged external event
- A closed Motion Detected alarm update from Milestone XProtect VMS -> Motion Detected Closed external event
External events are handled similarly to events raised by Expression created in the CMS. External events can:
- Have actions (notification, command, webhook) added to them
- Raise alarms
Note: Senfi currently do not allow direct raising of alarms from external systems. All external alarms must be raised by proxy using external events, which then trigger Senfi alarms using Senfi's automation workflow.
Similarities of External Events to general Senfi Events
Similarly to events, External events have the basic general information:
- Name
- Description
- Inputs
Differences between External Events to general Senfi Events
Differences between External Events and Events created in the CMS:
- External events are created by Senfi HTTP API only. They cannot be added in the CMS.
- External events are updated by Senfi HTTP API only. They cannot be updated in the CMS (except for adding/updating/deleting event Actions).
- External events are deleted by Senfi HTTP API only. They cannot be deleted in the CMS.
- CMS can only view External events and add/update/delete event Actions
- CMS cannot enable/disable External events
- Senfi Expression cannot trigger External events
What's Next
- What is needed to create an Event
- Start creating your own Event
- Learn about Alarm