How-To Guides
Flows Guides

Send Alerts to a Mobile Phone

8min

You can use Flows to set up automated SMS alerts that can be sent to a mobile phone.

User Scenario

In a manufacturing plant, when certain conditions are met, such as temperature exceeding safe limits, you can send alerts from the shop floor to workers who need to respond to that critical condition.

Here's how you can do it using Litmus Edge:

  1. Read tags from a PLC.
  2. Define alerts (conditions/rules/levels) in Flows.
  3. Route alerts to specific cell phones or user groups.

Strategies for Sending Alerts

You can send alert messages to a mobile device with either SMS Gateway or WiFi/ Networks.

Use an SMS Gateway for Messaging

  • SMPP-based SMS Gateway: To generate alerts through SMS, you can use the SMPP (Short Message Peer-to-Peer) protocol. You have the option to use a gateway that is available in a data center, or you can deploy an open-source solution such as Jasmin SMS Gateway, which can be installed in Litmus Edge by navigating to Applications > Marketplace.
  • Hardware SMS Gateway: You can deploy a device with a SIM card and use Flows to send messages to the gateway when an alert is triggered.
  • Online SMS Gateway: You can use online cloud-based SMS gateways like AWS SNS or Twilio for sending SMS alerts.

For instructions on how to create a Twilio flow to send an SMS alert, please refer to the section below titled "Create Twilio Flow to Send an SMS Alert".

Use WiFi/ Network for Messaging

Install a Notification-receiving mobile app. Several MBaaS (Mobile Backend-as-a-Service) applications (such as Kinvey, Cloudkit for iOS, or Firebase) provide this capability.

  • Litmus Edge becomes the Notification Server.
  • The app connects to flows to receive notifications.

Create Twilio Flow to Send an SMS Alert

The following example provides high-level guidance for configuring outgoing Twilio messaging in flows. Because each enterprise has unique requirements and configurations, customize this example for your environment.

Before You Begin

You will need to sign up for a Twilio account on their website. Note that Twilio charges for message activity.

Step 1: Configure the Twilio Node

To configure the Twilio node:

  1. In Litmus Edge, navigate to the Flows Manager and create a new flow. See Create a Flow to learn more.
  2. On the flow canvas, add the Twilio out node.
  3. Double-click the node. The Edit twilio out node dialog box appears.
    • Output: Select SMS from the dropdown options.
    • Name: Enter twilio_alert.
    • To: Enter the phone number (no spaces or special characters) for the person who receives the text messages.
    • Twilio: Click the Edit icon and configure the following parameters for the Twilio connection. To retrieve these values, log in to your Twilio account and access the Programmable SMS Dashboard.
      • Account SID: Find this SID (Security ID) in the Twilio account dashboard.
      • From: Use the Twilio-assigned phone number found in your Twilio account.
      • Token: Find this authentication token in the Twilio account dashboard.

        Twilio account dashboard
        Twilio account dashboard
        
      • Name: Enter an optional user-defined name.
      • Click Update.
    • Click Done.

      Edit twilio out node dialog box
      Edit twilio out node dialog box
      

Step 2: Test Connectivity

To test the connectivity:

  1. Drag a Function and Inject nodes to the canvas and wire them to the Twilio node.
  2. Double-click the Function node.
    • On Message: Enter a basic message to send as a text message. Use this code as an example: msg.payload = "Alert: This is a test message from the manufacturing floor."; return msg;
    • Click Done.
  3. Click Deploy.

    Completed flows canvas
    Completed flows canvas
    
  4. Click the Inject node button to trigger the alert and check the respective phone for the text message.
Alert message from twilio
Alert message from twilio