IFTTT An Introduction

Introduction

 
In this tutorial, we will cover IFTTT. What is it? How can we use it? Writing a simple service with IFTTT and how it can be implemented with IoT. The steps will include setting up your IFTTT account and the steps to follow to make the service complete. This service can be integrated with Windows embedded and using Visual Studio can be programmed and used.
 

What is IFTTT?

 
IFTTT is a web service that allows other services to be programmed by means of simple conditional statements called recipes.
 
Let’s look at what IFTTT comprises of as per their website information:
  • Channels
    Channels are the basic building blocks of IFTTT. Each Channel has its own Triggers and Actions.
  • Triggers 
    The ‘this’ part of a Recipe is a Trigger. Some examples Triggers are “I’m tagged in a photo on Facebook” or “I check in on Foursquare".
  • Actions
     The ‘that’ part of a Recipe is an Action. Some examples of Actions are “send me a text message” or “create a status message on Facebook”.
  • Ingredients
    Pieces of data from a Trigger are called Ingredients. For example, the Ingredients of an Email Trigger could be: subject, body, attachment, received date, and the sender’s address. 
  • Recipes
    Personal Recipes are a combination of a Trigger and an Action from your active channels.
  • On / Off
    Personal Recipes can be turned on and off. When turned back on, they pick up as if you had just created them.
  • Polling Period
    Most Personal Recipes check for new Trigger data every 15 minutes, some are even faster. Let’s look at the process of creating an IFTTT service.
Creating an IFTTT service:
  1. Firstly, you need to sign or register for the service from here.
     
    To start with you need to create a recipe.
  2. Conditional statements to start with THIS option. It is a way to create the logic of the web service we are planning to do the whole process of creating a recipe goes through a series of steps. THIS is a start point of activating the trigger. After that, you are followed by activating the trigger.
  3. Now you have to select a channel for a trigger. There are about 148 channels to choose from. As you choose the channel you need to activate the channel for the trigger.
  4. To complete the logic of THAT we need to create an Action channel. You have to choose from the Action channels available. We need to fill up the Action fields then create the Action and the logic of the Web Service will be complete.
Here is the flow of the entire logic
 
flow
 
Now what we will do is create a simple web service with IFTTT to see what we can do with it.
 
We will go through creating a trigger.
 
We follow the same methodology with Conditional Statements
 
where IF is our ESPN Channel and that is our Dropbox service.
 
Step 1: Joining the IFTTT service.
 
join IFTTT
 
Step 2: You need to create an account:
 
create account
 
Step 3: You need to follow steps to create your own recipe first then click on the Use button to get started.
 
welcome
 
Step 4: Now it will take you to the page where you have the option of Creating recipes from My recipes personal section and then create a recipe link button in the personal section:
 
my recpies
 
Now here is the turn to use conditional statements you need to click on THIS option.
 
Step 5: Now you need to choose a trigger channel we choose ESPN and click on it.
 
choose trigger channel
 
Step 6: Now you need to activate the channel and click on Activate.
 
activate
 
Step 7: You will get another activate button you need to click it.
 
activate ESPN
 
Step 8: After this step, you need to click on Done.
 
done
 
Step 9: You need to activate the ESPN Channel.
 
click on activate
 
Step 10: You need to click on Continue to the next step.
 
next step
 
The next step is to choose a trigger.
 
Step 11: We chose Breaking top news.
 
choose a trigger
 
Step 12: Now you will have options for completing trigger fields, click Create Trigger.
 
create trigger
 
Step 13: Now is the last logic for the conditional statement to complete the recipe creation. We need to click on
 
THAT to continue.
 
that
 
Step 14: Now you will have to choose an action channel. Choose Dropbox and click on it.
 
choose action channel
 
Step 15: You need to activate the Dropbox channel.
 
activate dropbox
 
Step 16: As you will be accessing Dropbox the service will ask to access the folders. You need to click on Allow.
 
click on allow
 
Step 17: Now on the next scene you will get Dropbox activated and you need to click on Done.
 
dropbox done
 
Step 18: You need to click on Activate for the Dropbox action channel to get activated.
 
dropbox activate
 
Step 19: For activation to go to the next step you need to click on activate the Dropbox channel.
 
activate dropbox next step
 
Step 20: You need to perform an action, for that now we choose to Create a text file.
 
Create a text file
 
Step 21: Now we need to complete action fields.
 
complete action fields
 
Step 22: As all the steps conclude you need to Create and Activate the recipe
 
Click on Create Recipe.
 
click on create recipe
 
Step 23: After that, you will see the recipe is created.
  
my recepies
 
Here we have created IFTTT service involving two channels: One for the THIS condition that is the ESPN channel THAT being the Dropbox channel.
 
How can we use it in Arduino based board?
 
Let’s get to know what we will implement A Game score that will result in generating the trigger and saving it in a text format in the Dropbox folder.
 
The Workaround is given in BigButtonFun.com.
 
We will have to setup Arduino/Intel Galileo to go to the webpage that we will create. The Webpage will work as ESPN scores are updated and as the trigger updates (button) with the score changes or when it writes in Dropbox.
 
The things you will need to get the IFTTT service working with Arduino/Intel Galileo:
  1. A hosted Website(using Visual Studio)
  2. Dropbox account
  3. Arduino/Intel Galileo Board
  4. Button
  5. Hookup Board, Resistors and mini Bread board
As I don’t have an Arduino/Galileo board here with me now I will not be able to test it but as soon I get one my work will continue. This is the logic behind working of IFTTT with Arduino and we have referenced it from Bigbutton.com and Instructables.com.
 
TIPS AND TRICKS
  1. The whole process of creating a recipe involves using the Conditional statements IF and THAT
  2. You can easily use the web service and start talking to IoT based devices
  3. Remember you cannot use the same Channels for IF and THAT conditional Statements.
  4. IFTTT comprises of certain buttons for the service
Turn recipe off-> It will turn off the recipe we are using.
 
Check recipe now-> It checks the working of the recipe. When you click the button it will show a green light that suggests the recipe is working.
 
View recipe logs-> It will show the logs of the recipe when it was triggered.
 
Edit recipe, delete, view its logs-> This will show the total working of the recipe and all possible modifications we can do.
 
References
  • https://ifttt.com/
  • http://www.instructables.com/id/E-mail-Button-Connecting-Arduino-to-IFTTT-to-send-/?ALLSTEPS
  • http://bigbuttonfun.com/content/email-button-connecting-arudino-ifttt-and-beyond