This article will show you how to connect your Arduino Cloud to an IFTTT webhook. As an example, we’ll configure a webhook to send data to an email address when a variable is changed.
You will need:
- An Arduino account
- An IFTTT account
- A ‘Thing’ that you want to configure with IFTTT.
For a general overview of Arduino Cloud, see this page.
Creating an applet in IFTTT
First, we’ll create an applet in IFTTT that will send an email when triggered by a webhook.
-
Open maker.ifttt.com and sign in if prompted.
-
Click Create in the top right. Select If This.
-
In the search field, enter ‘Webhooks’ and select that service.
-
Select Receive a web request.
-
In the Event Name field, enter
counter_change
. -
Click the Create trigger button.
-
Now, click on Then That. Select the Email service.
-
Choose the Send me an email action. If this is your first time setting up an email action, click Connect, and proceed with the configuration as instructed on IFTTT.
-
We can now configure the content of the email. The subject and body fields can be left as is, or changed to your preference.
{{Value1}}
,{{Value2}}
and{{Value3}}
will correspond to the variable name (ifttt_counter), the new value, and a timestamp of the change, respectively. Finally, click Create action. -
Both the trigger and action have now been configured. Click Continue.
-
Optionally, change the applet title, and click Finish to create the applet.
-
Click on your profile picture in the top right, then click My services. Choose webhooks and click on Documentation in the upper right.
-
Write
counter_change
in {event} field and copy the URL from the curl command (we’ll use it in the next section).
Creating a Thing in Arduino Cloud
Next, we’ll create a Thing that will use the webhook to trigger the IFTTT applet.
-
Go to Arduino Cloud. If prompted, sign in to your Arduino account.
-
In the Things tab, click CREATE THING.
-
Initially, the title will be set to ‘Untitled’. Click on it and give it a name.
-
Click ADD and enter the following values:
- Name: ifttt_counter
- Variable type: Counter
- Variable Permission: Read & Write
- Variable Update Policy: On change
- Threshold: 1
Click ADD VARIABLE to create the variable.
-
With the variable created, click Set webhook at the bottom left of the page.
-
Paste the URL inside the Webhook URL field and click SET WEBHOOK.
-
Open the Dashboards tab, then either open an existing dashboard or click BUILD DASHBOARD.
-
Enable the editing mode (notebook symbol) and click ADD. Under the THINGS tab, select the thing you created. Click CREATE WIDGETS with
ifttt_counter
selected. Make sure that the step size is set to 1.000. Click DONE. -
Test the webhook and IFTTT applet by increasing the counter value. You should receive an email shortly.
Troubleshooting
If you’re not receiving any emails, make sure that
- you’ve set a webhook in your thing.
- that the
{{event name}}
in the webhook URL is the same as the event name in the IFTTT web request trigger.