TC4.1 - Dashboard and Notificator

Test Case Title

TC4.1 - Dashboard and Notificator

Goal

I (at any role) can

  • Associate a notification event to a metric/widget,
  • Set how the event is manifested on Dashboard widget by blinking and thresholding,
  • Associate an Action to the Notification via the Notificator, sending emails to qualified users. Eventual change of the values to see changes in the firing.
  • See the log of actions performed and firing received
  • Manage the event from the IOT application, so that for generation actions on Telegram, facebook, sms, messenger, etc.

Prerequisites

Using a PC or Mobile with a web browser.

Access to the Notificator. Knowing the actions performed on the Dashboard builder.

Capability of using IOT applications

Expected successful result

See the notifications, define the actions and test them, see an example of notifications sent.

Program notifications.

Steps

 

 

Please note that some of the following links could be accessible only for registered users.

Each single Dashboard Widget of each city Dashboard (created by the Dashboard Builder) collects data from one or more Metrics. Thus, each Metric of each Widget of each Dashboard can have one or more firing conditions. Each one of these Firing Conditions is automatically registered to the Notificator tool via its API, and thus every time a Firing Condition becomes true the Dashboard Engine, that collects the metrics, informs the Notificator to perform the planned actions. Thus, Notifications are: per Dashboard, per Widget, per Metric. This means that the same Metric (e.g., a Temperature) may be used in multiple widgets and dashboards and may create multiple notifications/actions with different threshold values for different people/operators.

The Notificator presently receives notification via its API from a number of Applications:

The Notificator is usable as MicroService by Snap4City Applications defined in NodeRED, to: register a notification alarm, to send notifications (not yet available). 
Firing conditions can be set for each widget of each dashboard of each user, thus actions on the verification of those conditions are defined and can be executed: blinking on dash, sending message, sending events on ESB, posting on Telegram, facebook, twitter; sending SMS, acting on multiple dashboard, acting on multiple IOT sensors, acting in Push on mobile applications, scheduling on processes, etc. etc.
Conditions to react at certain events and thus perform some action can be defined in multiple manners:


Example 1: City Dashboard, notifications and actions

  • Firing Conditions for the actions are defined via the Dashboard Builder and computed by the Engine: via the Dashboard Builder and computed by the Dashboard Engine, which in turn may provoke action on Notificator, mainly informing operators.
  • The Dashboard engine controls all metrics and data income with multiple thread and multiple servers;
  • https://www.snap4city.org/view/index.php?iddasboard=MTQ4  to control:
    • A metric value is constant for too much time
    • A metric source is not providing data for too much time
    • Database connection
    • collects events coming from ESB, real-time data, status of web sites, status of the processes, etc., and bring them on special Widgets;
    • Access to data
  • Actions Corresponding to firing conditions on City Dashboard Engine, in which may provoke:
    • evidence in the corresponding Widget. For example, in a graph as the line for threshold, in the box with number with some red blinking, in gauge as a bar, etc.;
    • highlight and blinking the widget when the firing condition become true and off when return false;
    • restart some process via DISCES;
    • sending a command to some IOT device or Broker (not yet implemented).
    • sending notification to people via Messenger, Twitter, Telegram via NodeRED IOT Applications
  • Actions Corresponding to firing conditions can be manged by the Notificator which is capable to
    • receive registration for new Firing Conditions, events, values trend, by any external applications;
    • define templates for notification and emails, ..
    • manage list of recipients for the notifications,..
      • Log any kind of event sent, why, when to who, etc.;
      • Perform the programmed actions, send notifications to several different targets by using a range of mechanisms such as:
        • emails,
        • restart some process via DISCES via NodeRED services
        • sending a command to some IOT device or Broker
        • sending notification to people via Messenger, Twitter, Telegram via NodeRED IOT Applications
          Procedure
          Go on Snap4city.org portal  and log-in in the tool with your credential.
          On the left column main menu click on Dashboards to see the list of dashboards available for the user.
  1. In the full test search field on the top right of the page write “test0” and search a dashboard titled: Snap4City – Test0”.
  2. Click the EDIT button below the dashboard preview. The dashboard is open in editing mode.

 

  1. On the top menu, click Wizard to add a new widget in the dashboard via the dashboard wizard.

 

  • In the Wizard page, check the Data Source table.  In the High-Level Type column, checkboxes have to be all selected;
  • In the full text field below the Data Source table on the right corner write: “DCTemp”. The list of data sources in the table is updated accordingly;
  • In the Value Name column check the line containing the name DCTemp1 and click on the line (1).
  • The line is highlighted in green and the data is added in the Choosen data source table below (2).
  • On the top right of the Wizard page click the time trend graph compare widget (3)
  • If the selection of the widget is compliant with the data source, the word “Available” is shown below the widgets icons (4);
  • Click the Confirm button to add the widget on the dashboard (5). The widget is shown at the end of the dashboard webpage.
  • On the top left corner of the DCTemp1 widget, click the right arrow to enlarge the widget and adjust the dimension has you like.
  • Click on the header of the widget to change the widget name
  • Write “Temperature Trend Compare” and click the disk icon to save the new widget name.
  • To activate the notification in case of unexpected temperature, click on the edit icon   on the top right of the widget and select “More Options” in the drop down menu.
  • A pop-up to edit advanced widget properties is shown, as in the follow images.
  • In the Specific Widget Properties area (1), open the Register to Notificator drop down menu and set YES (2);
  • Set thresholds to YES (3);
  • Click the PLUS button (4) to add a new notification event.
  • Add the tick in the “Notify Events” box (5);
  • Set the Operator to “>” (6);
  • Set the Thr (Threshold) 1 to “20” and confirm by clicking the blue flag (7);
  • Optional: set a Range colour (8) and a Short description (for example: “High Temperature”) (9).
  • Click the CONFIRM button (10) to save the widget in the dashboard. The widget is now configured to send notification and a dotted line is shown in the widget representing the threshold value.
  • The next step is to configure the Notificator tool to send these notifications to the defined users.
  • Return in the main application and on the left column main menu click the “Notificator” item;
     
  • You can see the list of events associated to your account with the new notification related to the widget Snap4City – Test0 (1);
  • Click the Add/edit/delete notifications button to set the parameters for this notification (2);
  • Click the PLUS button to add a new event (3);
     

     
  • Add a name to the Notification (4);
  • Specify one or more email addresses that will receive the notification (5);
  • Add other email address if needed (6);
  • Click CONFIRM to save (7).
     

     
    The notification has now been added in the list and, according to the widget notification settings, in case the value exceeds the threshold defined in the widget, a notification is sent by email to addresses specified.
     

    The following is an example of email received by the Notificator because the threshold set to 20°C has been exceeded.

     
    Also, the log of notifications and events can be seen by clicking the EVENT LOG button on the top menu of the Notificator tool. Clicking the chain icon in the Link column open the corresponding dashboard in view mode.
     

    The notification received by email is as in the following image.

     
    Example 2: Conditions and Actions defined into Snapt4City Applications via Application Builder as NodeRED: into Snap4City Applications, directly computed as data driven processes into the Application.
    They can act on IOT Actuators and also exploit MicroServices such as those of the Notificator, Mailer, SMSs, voiced, etc. to send notifications. The Snap4City Applications can also use the Notificator MicroService to send notifications.
    The identification of the firing condition and/or the action to react to one or more conditions can be created into Snapt4City IOT Applications with or without their dashboards. For example, in the following Snapt4City Application, accessible by click on the following link: https://iot-app.snap4city.org/nodered/nr7/#flow/7346fea.5cf9
    (use credentials reported above) there is an example of application that reads information about the earthquake of the last week and when the intensity is greater than 7 or lower than 2, an email is sent to a specific email address, now you see paonesi@gmail.com .
    The flow can be easily modified in order to change the receiver of the email message, the parameters of the condition, or by including a MicroService as that of the Notificator.
    Start executing the process by clicking on the microbutton of the left side block “prova”, on the right side you can see the debug of the sent message.
     

    Moreover:
  • A Snap4City Application may be fired by a condition identified in the City Dashboard Engine when metric on some data is identified
  • A Snap4City Application may be fired according to some logic directly implemented on it
  • A Snap4City Application may be fired according to some Notification produced by the Notificator
  • Via the Notificator MicroService, the Snap4City Application can ask at the Notificator to Perform the programmed actions, send notifications to several different targets by using a range of mechanisms such as:
    • emails,
    • performing a rest call.
    • activating a chat room
    • restart some process via DISCES
    • sending a command to some IOT device or Broker.