# How to send SMS notifications

In this tutorial, you will learn how to set up a **rule to send SMS notifications to one or multiple recipients.** We make use of the [device simulator](https://docs.akenza.io/how-to-connect-a-device/device-simulator) as a test device, to test your rule set up right away.

{% hint style="info" %}
Find out more about how to use the device simulator [here](https://docs.akenza.io/akenza.io/get-started/create-new-device/device-simulator).
{% endhint %}

For a successful setup, the following steps are explained in this tutorial in more detail. It is assumed, that you already have created an organization and a workspace.

The following steps are explained in more detail:

1. [Create an HTTP Data Flow](#1.-create-an-http-data-flow)
2. [Create an HTTP Device](#2.-create-an-http-device)
3. [Create a rule](#3.-create-a-rule)
4. [Test your rule alert by using the device simulator](#4.-test-your-rule-alert-by-using-the-device-simulator)

### 1. Create an HTTP Data Flow

Go to **Data Flows** on the menu and select *Create Data Flow*.

Select **HTTP as a device connector**. Select the **Device Simulator** as a device type. Proceed with the selection of the **Akenza DB** and save your Data Flow. Your Data Flow will be now displayed on the Data Flow Overview Page.

![Device simulator data flow](https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2FCnKiWwtHr4Mg9MkbvbGE%2Fimage.png?alt=media\&token=083aa510-1369-4603-a53d-6ec232ee149f)

### 2. Create an HTTP Device

Proceed further to **Asset Inventory** and select *Create Device*.

Enter a device name and optionally a device description, tags or custom fields. Assign your created Data Flow to your device. Generate a device ID and save your **HTTP device**. Your device will be now displayed on the Asset Inventory Overview Page.

![Create new device](https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2FYcdlQnwWUiYA63hpLq1y%2Fscreely-1640816236580%20tags%20device%20create.png?alt=media\&token=d060edd6-442c-424e-a961-377102454d13)

### 3. Create a rule

Proceed now to **Rules** and select *Create Rule*.

Select as a **Rule Input your created HTTP** **device**. Add a logic connector to your rule by selecting the akenza Logic Block *Comparison*. Connect the pulse animated dots from your device to the comparison block. All available data sources from your device will appear on the dropdown of *Data source 1*. In this example, we have the following available data sources:

* Occupancy
* Temperature
* CO2

In this tutorial, we choose *Temperature* as a data source, as we want to receive an alert via **SMS** if a temperature threshold is reached.

In field *Condition 1* of your comparison block, you are free to choose the individual condition of your rule. In this example, we want to trigger an alert, if the temperature is bigger than 25 degrees.

Proceed now with adding the SMS output connector to your rule.

![Rule setup](https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2Ft9Eu7da5I1Cl7yFXoh6r%2Fimage.png?alt=media\&token=c447bd4b-0d7c-4784-b955-c2b9708fe10d)

All SMS connectors which were already created in your organization are displayed as available SMS connectors. In this tutorial, we create a new SMS connector. Type in your specific information.

* Connector name (free text)
* Recipient (one or multiple)
* SMS Text
* Add payload data to your text by using such a syntax: {{myPropertyName}}

{% hint style="info" %}
By adding payload data to your SMS text, you will get informed about the actual measured value of your device. Use also the preview function, to preview your SMS content before you set it live.
{% endhint %}

![SMS output connector output](https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2FSg3hnyHapDDUuqPMXOa7%2Fimage.png?alt=media\&token=b873a329-97e2-4904-85ab-f498a3944a74)

Once your SMS connector is filled out, select *Save connector*. Make sure, that you connect your SMS connector to the comparison block.&#x20;

Your SMS rule is now saved and displayed on the Rule Overview Page.

### 4. Test your rule alert by using the device simulator

To test your rule alert, you now can send test data from the device simulator to your HTTP device. By selecting a temperature value above the set 25 degrees on your rule, you will receive an SMS to the chosen recipient number as the rule will get triggered.

To send test data from the device simulator to your HTTP device, you need to copy the **Uplink URL** from your HTTP device. Go to Asset Inventory, select your HTTP device, and open *API-Configuration*.

Copy the Uplink URL and insert this URL on the Uplink URL field on the [device simulator](https://docs.akenza.io/how-to-connect-a-device/device-simulator).

![API-configuration](https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2FrPlfPHJoadI1uAmPwwOB%2Fimage.png?alt=media\&token=6bc07f68-2a5f-47fa-8ee9-802ac5e1ff47)

In this example, we choose a temperature value of 31 degrees. Proceed by selecting *Send Message*. Check if you receive the SMS on your mobile.

**Congratulations,** you have successfully created an SMS alert by using the device simulator.
