# Ubidots Integration

[Ubidots](https://ubidots.com/) is an Industrial Internet of Things (IIoT) platform designed for developers and businesses to easily connect, collect, and visualize sensor data. It offers tools for data analysis, real-time monitoring, and automated actions, making it ideal for applications in industries such as manufacturing, healthcare, and environmental monitoring. This article provides step-by-step instructions on sending alerts from the Ubidots platform to ilert to ensure critical issues are escalated to responsible specialists as quickly as possible.&#x20;

## In ilert: Create a Ubidots alert source&#x20;

1. Go to **Alert sources** -> **Alert sources** and click **Create new alert source**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FjX0cS4q7woTXKajZmc1W%2FScreenshot%202023-08-28%20at%2010.21.10.png?alt=media&#x26;token=8ef3666b-84eb-4b51-abee-f07303313941" alt=""><figcaption></figcaption></figure>
2. Search for **Ubidots** in the search field, click the Ubidots tile, and then **Next**.&#x20;

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FlXzQlJpaTFSR49AZk0xA%2FScreenshot%202023-08-28%20at%2010.24.23.png?alt=media&#x26;token=cffeacb4-57b9-47d4-827d-b0f6b1afd914" alt=""><figcaption></figcaption></figure>
3. Give your alert source a name, optionally assign teams, and click **Next**.
4. Select an **escalation policy** by creating a new one or assigning an existing one.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FNnuZqONaIhbOf6fn4OkZ%2FScreenshot%202023-08-28%20at%2011.37.47.png?alt=media&#x26;token=8a74f7b5-5bd2-4eea-97fa-1c1dbb041333" alt=""><figcaption></figcaption></figure>
5. Select your [Alert grouping](https://docs.ilert.com/alerting/configure-alerting/alert-sources#alert-grouping) preference and click **Continue setup**. You may click **Do not group alerts** for now and change it later.&#x20;

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FueugN4JgHn1c90ggFA6u%2FScreenshot%202023-08-28%20at%2011.38.24.png?alt=media&#x26;token=b8009daf-3ca8-4264-a6fa-e42ef7333205" alt=""><figcaption></figcaption></figure>
6. The next page shows additional settings, such as customer alert templates or notification priority. Click **Finish setup** for now.
7. On the final page, an API key and/or webhook URL will be generated. You will need it later.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FSmFRK6i0S7IBYYfMz2Gl%2F1-1.png?alt=media&#x26;token=c50479a9-820c-487a-bdad-ae695e4690de" alt=""><figcaption></figcaption></figure>

## In Ubidots: Create a Trigger Event

1. On the top bar, click on **Data** **->** **Events**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2F2AvMaddnAUifFBKCG5Xp%2F1.png?alt=media&#x26;token=b25bedcd-836f-43d9-8753-984d6d70f2df" alt="" width="563"><figcaption></figcaption></figure>

2. Now click on the "+" to create a new Trigger Event.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FRjhSLdsjj7aEdiWyHbSL%2F2.png?alt=media&#x26;token=da5fb2d1-b886-4426-9cb4-217250acd9df" alt="" width="563"><figcaption></figcaption></figure>

3. Select a **Variable** and configure a trigger as you like. Click on **Next** to proceed to the next step.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FG2z7G8oPby4jg9HzOeoG%2F3.png?alt=media&#x26;token=4671ee3e-109b-4cfa-82a4-43c155a659d2" alt="" width="563"><figcaption></figcaption></figure>

4. Now click on **ADD ACTION**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FopNdoDGNUKdDz2xhNtDi%2F4.png?alt=media&#x26;token=e3d01df5-1c5a-45c0-ba06-7fbafdcd42e7" alt="" width="563"><figcaption></figcaption></figure>

5. Select **Trigger webhook** from the list.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fhj58f8ivLwxvNkFlQPOd%2F5.png?alt=media&#x26;token=208b156d-4a78-4afa-b3f3-e4286e4ea286" alt="" width="563"><figcaption></figcaption></figure>

6. Enter the previously in ilert created integration URL into the URL field.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FTIMO9mmUzDF6RrnrEJBy%2F6.png?alt=media&#x26;token=240dd86d-355a-424f-bfb9-065ed687e9d1" alt="" width="563"><figcaption></figcaption></figure>

7. Copy and paste the following payload:

```json
{
	"eventType" : "alert",
	"deviceId" : "",
	"deviceName" : "",
	"lastValue": "",
	"lastValueTimestamp" : "",
	"triggerValue" : "",
	"triggerTimestamp" : "",
	"variableId" : "",
	"variableName": ""
}
```

8. Now fill the payload with the help of the tag button.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FzotdVdRRXhwvbI0gBj0k%2F10.png?alt=media&#x26;token=bf1121a0-5e44-45f1-8f9a-54e40bab70a7" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FVrj9NIsHjhO8LdURTQVf%2F7.png?alt=media&#x26;token=a25d16c1-808e-4fab-9008-f7e695579b44" alt="" width="563"><figcaption></figcaption></figure>

9. To send resolve events, click on **Back to Normal**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FREIAyPtHSOlQ8wd0jU8i%2F8.png?alt=media&#x26;token=c55b690b-06ab-440b-a08f-f6620dc884b1" alt="" width="563"><figcaption></figcaption></figure>

10. Enable **Back to normal action** and copy following payload:

<pre class="language-json"><code class="lang-json">{
	"eventType" : "resolved",
	"deviceId" : "",
	"deviceName" : "",
	"lastValue": "",
	"lastValueTimestamp" : "",
	"triggerValue" : "",
	"triggerTimestamp" : "",
	"variableId" : "",
<strong>	"variableName": ""
</strong>}
</code></pre>

11. Fill out the payload with the tag button.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FWKXFIIWZQU6ZieByNg7v%2F11.png?alt=media&#x26;token=1e9571bb-c4e3-4bfb-bddb-32d1074927af" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fjzh1w1i0EpozoCT4cSWm%2F9.png?alt=media&#x26;token=358a7ada-64f6-4779-942f-f4253ba22ffe" alt="" width="563"><figcaption></figcaption></figure>

12. Save the Trigger action to finish the setup.

## FAQ

**Will alerts in ilert be resolved automatically?**

Yes, as soon as "Back to normal action" is configured and a variable in Ubidots is back to a normal state, the associated alert is automatically resolved in ilert.&#x20;
