---
title: Create an Email-Alert Trigger for DeviceHub Device Data Quality
slug: edgemanager/how-to-guides/lem-user-ui-guides/alerts-guides/create-email-alert-for-devicehub-device-quality
description: Learn how to create an email-alert trigger for DeviceHub device data quality.
docTags: 
createdAt: 2023-04-19T19:05:47.000Z
---

In this guide, you will set up an alert and a trigger for a Litmus Edge device that is generating invalid/corrupted data. Then you will simulate an error output so that an alert is triggered. When the alert is triggered, the email addresses specified in the trigger will receive an email with information about the alert.

# Video

:::Iframe{iframeHeight="0" code="<iframe width=&#x22;560&#x22; height=&#x22;315&#x22; src=&#x22;https://www.youtube.com/embed/iTi-2YpCZRs?si=BPPeYsh5hif2lG1e&#x22; title=&#x22;YouTube video player&#x22; frameborder=&#x22;0&#x22; allow=&#x22;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#x22; allowfullscreen></iframe>"}

:::

# Before You Begin

- You will have to enable SMTP from the Litmus Edge Manager Admin Console. See [Email](docId\:GcxRXKR3-oc_O9zqz7Jke) to learn more.&#x20;
- If you haven't yet connected your Litmus Edge instance to Litmus Edge Manager, see [Activate an Edge Device](docId\:tDJ648wJgATVqzyx79UwB).&#x20;

# Step 1: Add Device

Follow the steps to [Connect a Device](docId:3eyAfPpweuVmBLCEy17sq). Select the Device Type **Simulator&#x20;**&#x61;nd Driver Name **Generator**.

# Step 2: Add Tag

After connecting the device, you can [Add a Tag](docId:8sE7z3PmRfwL1nmzcwaLX) to the device.

Configure the following for the tag:&#x20;

- **Name:&#x20;**&#x53; - Random value generator
- **Value Type**: string

# Step 3: Import Topic into Default Generic MQTT SSL Connector

You will next import the tag you've created as a topic into the generic MQTT SSL connector that connects Litmus Edge to Litmus Edge Manager.&#x20;

**To import the tag into the generic MQTT SSL connector:**

1. Log in to Litmus Edge.&#x20;
2. Navigate to **Integration**.&#x20;
3. Click the *generic-mqtt-ssl* connector tile.&#x20;
4. Click the **Topics&#x20;**&#x74;ab.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/RiGXq8U4ibEwXlMqu4VdZ_topics-tab.png" size="70" width="539" height="516" position="center" showCaption="false"}
5. Click the **Import from DeviceHub** tags icon.&#x20;
   The *DeviceHub Import* dialog box appears.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/88SwMXPJ-ZlRMlYGiiEL0_import-tags-icon.png" size="80" width="1053" height="483" caption="Import from DeviceHub tags icon" position="center" showCaption="true"}
6. Select the check box to import the tag from the device you created earlier and click **Import**.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/6KAn2U3ny1gcM2d__EtNi_devicehub-import.png" size="80" width="962" height="272" caption="DeviceHub Import dialog box" position="center" showCaption="true"}
7. Click the **Enable all topics** icon.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/OFsKCxfI-FgSrUhp1ORi9_enable-all-topics-icon.png" size="80" width="1164" height="469" caption="Enable all topics icon" position="center" showCaption="true"}
8. Return to the *Integration&#x20;*&#x70;ane and toggle the connect option and confirm the status is `CONNECTED`.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/I2Ops086U4tzxrunFVNlN_connection-toggle.png" size="60" width="367" height="258" caption="Connector connection toggle" position="center" showCaption="true"}

# Step 4: Set Up an Email-Alert Trigger&#x20;

In this step you will create an email notification alert. Next, you will create a trigger that will use the email notification alert. See [Alerts](docId\:BWq6oBkuTNZgIJBIgQPBE) for additional details.

From Litmus Edge Manager, navigate to **Alerts&#x20;**&#x61;nd follow the steps below.&#x20;

## Step 4a: Set Up an Email Alert

**To set up an email alert:&#x20;**

1. From the *Alerts&#x20;*&#x70;ane, click the **Add new Action** icon. &#x20;
   The *Add new Action* dialog box appears.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/jcIeQ5n7Ahq0K5lkrL8Pq_add-new-action-icon.png" size="80" width="1378" height="719" caption="Add new Action icon" position="center" showCaption="true"}
2. From the *Add new Action* dialog box, enter the following details:
   - **Action Template**: Select EMAIL.
   - **Action Name**: Enter an action name.&#x20;
   - **Enter email**: Enter an email address that will receive the alert.
   - **Notifications Limit**: Enter 1.&#x20;
   - **Interval**: Select *minute*.
3. Click **Add**.&#x20;
   The newly created action appears in the *Action List*.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/12fxB2Jd2r2gu7ixNdevB_image.png" size="80" width="1554" height="496" caption="Creating a new email alert" position="center" showCaption="true"}

## Step 4b: Set Up a Trigger

**To set up a trigger:&#x20;**

1. From the *Alerts&#x20;*&#x70;ane, click the **Add new Trigger&#x20;**&#x69;con.&#x20;
   The *New Trigger* pane appears.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/SjncOzK9ps2UhX6kmCCP2_add-new-trigger.png" size="80" width="1379" height="715" caption="Add new Trigger icon" position="center" showCaption="true"}
2. From the *New Trigger* pane, configure the following sections.&#x20;

### Trigger

- **Name**: Enter a name for the trigger.
- **Active**: Select the checkbox.
- **Dashboard**: Select the checkbox.
- **Description**: Enter a description for the trigger.

### Scope

Selec&#x74;**&#x20;Edge Device&#x20;**&#x61;nd select the appropriate Litmus Edge instance.&#x20;

### Source

- Selec&#x74;**&#x20;Metrics&#x20;**&#x61;s the source of the trigger.
- Click **Add&#x20;**&#x6E;ew rule.
- **Select Alert template**: Select *DH device data quality.*
  - For *Target Value, msgs/minute,* enter 1 minute.
  - For *Alert Delay, seconds,&#x20;*&#x65;nter 60 seconds.&#x20;

### Action

- **Action List**: Select the action you previously created.
- **Continuously**: Select the checkbox to send notifications continuously. &#x20;
- **Notification Period, minutes**: Enter 1.

When done, click **Save**.&#x20;
The alert trigger appears in the *Trigger List*.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/DsjHfYW9CXo-YB4vDxZNZ_image.png" size="80" width="1920" height="866" caption="Creating a new trigger" position="center" showCaption="true"}

# Step 5: Simulate Invalid/Corrupted Data

From Litmus Edge, you will simulate the DeviceHub driver sending invalid/corrupted data.

**To simulate a disconnection:**

1. Log in to Litmus Edge.
2. ~~From the navigation panel, navigate to **DeviceHub&#x20;**> **Tags**.   ~~
   ~~   The *Tags* pane appears.~~
3. ~~Click the **Action menu** for the tag you created and select **Edit**. ~~
   ![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/0e0EVH-1xV-mcr9fWDDtS_edit-tag.png "The Edit option for the tag")
4. For the **Value Type** field, select float64.
5. For the **Formula** field, corrupt the *Formula* field by replacing the `s` in `sin` with `1` so that the final formula starts with `1in`. Then, click **Update Tag**.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/SbKcMpkwo-Ei3WUF_VYVP_image.png" size="80" width="1176" height="705" caption="Corrupted Tag Formula" position="center" showCaption="true"}

# Step 6: Verify Successful Trigger and Alert

From Litmus Edge Manager, you will verify the simulated error rate.

**To verify the successful trigger and alert:**

1. Log in to Litmus Edge Manager.
2. Select the appropriate company and project.
   The *Dashboard&#x20;*&#x70;ane appears for the project.
3. From the navigation panel, select **Incidents**.
   The *Incidents&#x20;*&#x70;ane appears.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/rRs-rERLJhCfGdyFSIZ9e_image.png" size="80" width="1920" height="866" caption="List of incidents" position="center" showCaption="true"}

The email address that was entered from *Step 4a: Set up an Email Alert* will also receive the respective alert email.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/4yicIObGDEErFdRPDRwUk_image.png" size="80" width="1055" height="532" caption="Sample email that LEM will send out" position="center" showCaption="true"}

