How-To Guides
...
Alerts Guides
Create an Email-Alert Based Trigger for DeviceHub Devices
13 min
in this use case, you will set up an alert and a trigger for a manufacturing connect edge (mc edge) device 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 and before you begin you will have to enable smtp from the manufacturing connect admin console see email docid\ xg4vtwb4x3rb yadjzt97 to learn more if you haven't yet connected your mc edge instance to manufacturing connect, see activate an edge device docid\ m2du1twvne9kz1he r222 step 1 add device follow the steps to connect a device docid\ rfvijdxz7dbad8mwbisma select the device type simulator and driver name generator step 2 add tag after connecting the device, you can add tags docid\ ioanzd2awqnkuppgee3eh to the device configure the following for the tag name s 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 mc edge to manufacturing connect to import the tag into the generic mqtt ssl connector log in to manufacturing connect edge navigate to integration click the generic mqtt ssl connector tile click the topics tab click the import from devicehub tags icon the devicehub import dialog box appears select the check box to import the tag from the device you created earlier and click import click the enable all topics icon return to the integration pane and toggle the connect option and confirm the status is connected step 4 set up an email alert based trigger 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 2zmaxafw8faxd bhwsep6 for additional details from manufacturing connect, navigate to events & alerts and follow the steps below step 4a set up an email alert to set up an email alert from the events & alerts pane, click the add new action icon the add new action dialog box appears from the add new action dialog box, enter the following details action template select email action name enter an action name enter email enter an email address that will receive the alert notifications limit enter 1 interval select minute click add the newly created action appears in the action list step 4b set up a trigger to set up a trigger from the events & alerts pane, click the add new trigger icon the new trigger pane appears from the new trigger pane, configure the following sections trigger name enter a name for the trigger active select the checkbox dashboard select the checkbox description enter a description for the trigger scope select edge device and select the appropriate mc edge instance source select metrics as the source of the trigger click add new rule select alert template select dh device data quality for target value, msgs/minute, enter 1 second for alert delay, seconds, enter 60 seconds action action list select the action you previously created continuously select the checkbox to send notifications continuously notification period, minutes enter 1 when done, click save the alert trigger appears in the trigger list step 5 simulate invalid/corrupted data from manufacturing connect edge, you will simulate the devicehub driver sending invalid/corrupted data to simulate a disconnection log in to manufacturing connect edge from the navigation panel, navigate to devicehub > tags the tags pane appears click the action menu for the tag you created and select edit for the value type field, select float64 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 step 6 verify successful trigger and alert from manufacturing connect, you will verify the simulated error rate to verify the successful trigger and alert log in to manufacturing connect from the navigation panel, navigate to events & alerts > incidents the incidents pane appears review that the incidents display in the list the email address that was entered from step 4a set up an email alert will also receive the respective alert email