This tutorial describes how to setup a custom IFTTT recipe with the webhooks channel (aka before know as maker channel).
1 – Setup
Before starting create our custom recipe we will need the following:
- A Smartphone (Android or iOs with internet access)
- A computer or Smartphone to browse IFTTT.com (internet access)
- A computer or Smartphone
2 – IFTTT – Setup Webhook
Open the webhooks channel HERE
Click on the Connect button if you never used the webhooks
Select the Settings gear of that webhooks service as follow: Copy and Access the URL
You should arrive on that screen that explains how to use the webhook as follow
Let’s assume we have one blue NIU and we want to launch three different applets with it. One kind of press on the NIU will launch one different applet.
In order to do that we need to have three different webhook, that screen is just to try things out, it’s not necessary to do what will follow but we do it to make it more easy to understand.
Let’s create three links, for this let’s create three differents event names. The event names can be anything but let’s create three one that are easy to remember.
- niu_blue_single_press (We will use this one for single press of our blue niu)
- niu_blue_double_press (We will use this one for double press of our blue niu)
- niu_blue_long_press (We will use this one for long press of our blue niu)
So let’s write the event in that webhook trial screen as follow:
Open the creation applet page HERE then click on + This
Then copy the generated link that should looks like something like this where the part after /key/ will be different and fill with your own private key (keep that key secret)
Save these three links for later we will use them to configure the NIU application.
3 – IFTTT – Create New Applets
This operation will have to be done for each Applet we want to launch with our NIU buttons, each of them need to have their unique and dedicated event.
Go to that link to create a new applet, click on the + This
Search and pick the webhook service
Receive a Web request
event field with one of your events created from the webhook configurations steps, then press on
In this example we will do it with one of our event which is the one for the single press of our blue NIU button
Then select the action you want to perform in that applet by clicking on the + That
In that example we just decide to send a simple notification to our IFTTT Smartphone App
In that example we picked a simple notification
The event name will be in the text of the notification, we keep the default configuration.
Then we validate the Applet by clicking on Finish
4 – NIU App Configuration
For that part we will need the three webhook links we have created in the webhook setup, we will demonstrate to do it for the single press of our NIU
Select the NIU single press action selection button
Then select the HTTP Request Action
Past the link with the event of the single_press, the same event that you put into your webhook applet.
Don’t change anything else and click on Confirm to save the new configuration
Click on your NIU (The physical one, in that example we use the virtual one, but it’s all the same thing). Then as you can see below, we receive the notification from IFTTT that our applet was triggered with the right event.