IFTTT with Raspberry Pi

by Apr 5, 2020IoT Cloud, IoT Connectivity, Raspberry Pi

IFTTT stands for IF This Then That, and is a free web service that allows users to build their own custom applets. In this article, we will learn how to build a custom applet that can be used with our Raspberry Pi. That is, how to connect to IFTTT, set up a Webhook within it, and how to trigger it. This can be used for a plethora of projects and applications, but for the purpose of this article let us assume that we want to build an applet that will send a notification to our phones if motion is detected. Please note that the applet is simply going to push notification if the event is True, not actually detect the motion for you. It is, therefore, a small part of a bigger application.

What is IFTTT?

IFTTT (If This Then That) is a free IoT service that allows you to send a trigger from one device/thing, and allow that trigger to make something happen elsewhere. In our example, the ‘this’ is the motion, and the ‘that’ is the notification. The exciting thing about IFTTT is the number of services available for use as triggers (THIS) or actions (THAT).

Now imagine combining that with the range of a Raspberry Pi! Considering the flexibility and range of programming with sensors and other components, you can let your imagination run wild. Making such projects come true is possible using IFTTT Webhooks service, which was specifically designed for custom applet makers. Webhooks can send and receive triggers via HTML POST and GET requests.

Hardware Requirements:

  1. Raspberry Pi with OS installed on SD card (available on the official website)
  2. Power cable
  3. Monitor
  4. HDMI connector
  5. USB or Bluetooth mouse
  6. USB or Bluetooth keyboard
  7. WiFi or Ethernet connection for internet

Setting up the IFTTT account and action:

  1. Creating an account:

To create an IFTTT account, open the website (https://ifttt.com/join)

1
when you open the website, you should see this. On this page, sign up either through the given options or click sign up to create an account

     2. Creating an action:

To create an action, click on the profile option on the top right corner to open a drop down list.

2

On this list, click ‘Create’

3. Creating a Trigger

When you click create, it will open a page that looks like:

3

On this page, click on ‘+This’

4. Choosing the service

As mentioned earlier, we will be using Webhook service for the trigger for which we have to search and select the option called Webhooks from the list provided.

4

After selecting Webhooks, click on the Connect button

5. Selecting the Trigger

Some services provide more than one type of trigger, however Webhooks provides us with only one option.

5

Click on the option box that appears, as in the above picture.

6. Assigning an Event name

The trigger will be activated only if an event is true. We thus need to assign an Event name to the trigger.

6
The name will not accept any spaces or special characters, with the exception of  underscore (‘_’)

7. Creating an action

We now have to select action service, to do this first press the ‘+That’ on the page

7

8. Selecting an action service

As discussed, we want a notification to be sent to our phone when there is motion detected, that is when the event is true the action should be a notification. Therefore, select the notification from the list provided

8

After this, press the Connect button to see the actions provided

9. Selecting the action

Since we are aiming to send only a simple notification to our phone, select the ‘Send a notification from the IFTTT app’ option

9

10. Write the notification that you want to send

IFTTT notifications are made to be customized, such that you can write the message that you want to see in the notification. After you click on the blue option box in the previous step you will see the message option open up in which you can type the text you want, and then click the ‘Create action’ button and then finish.

10

11. Finding the API keys

The Webhooks page should open on its own, if not double click on the icon. On this page, click on ‘Documentation’ (in the right hand corner).

11

12. Copying the Keys

When you open this page, the first line is the API Key.

The URL to which we must send the Webhook calls to is specified below Make a POST or GET web request to.

blurred

Using the IFTTT from your Raspberry Pi:

Make sure to update and upgrade your software before starting this. It is also assumed that you have python installed on your Pi with the code for your project, in this case for the motion detector.

1. Install the Python requests module

sudo pip install requests

2. Modify your code to include the following statements in the beginning

import time
import requests

3. At the end of the script add the following line

requests.post('https://maker.ifttt.com/trigger/event name/with/key/apikey')

In the above line, make sure to replace the event name and apikey with the one you have entered and found respectively.

4. Install the IFTTT app on your smartphone

You have to download the app, from the Play Store or the App Store

Screenshot_20200405-151650

5. Save and run your python code on the Raspberry Pi

When the event, here motion detection, is true – you will receive a notification on your smartphone.

And that is it! You have successfully created a well rounded project that will push notifications to your smartphone. This is an impressive project to build and is fairly easy as well. Exploring the bounds and possibilities that IFTTT can provide is an ocean of its own. So feel free to read through the services and try to use a few other ones that aren’t mentioned here.

Creating a multiplication Skill in Alexa using python

Written By Jyotsna Rajaraman

Hi! I'm Jyotsna, an electronics and communication undergrad who likes reading, writing, talking and learning. So when it comes to teaching, all my favorite things come together! I hope my articles have helped and taught you something. 🙂

RELATED POSTS

Creating REST API CRUD with Node.js, Express and MongoDB

Creating REST API CRUD with Node.js, Express and MongoDB

In our previous blog, we explored the fundamentals of creating a REST API with in-memory CRUD operations using Node.js and Express. Now, we're taking a significant step forward by integrating our product data with a database. This transition is pivotal for achieving...

How to create REST API using Node.js and Express?

How to create REST API using Node.js and Express?

In the vast landscape of web development, creating a robust API is a fundamental skill. APIs, or Application Programming Interfaces, serve as the communication bridge between different software applications. Today, we'll embark on a journey to build a simple blog API...

What is Edge Intelligence: Architecture and Use Cases

What is Edge Intelligence: Architecture and Use Cases

Introduction With the latest advancements in AI technologies, we have noticed a significant increase in the deployment of AI-based applications and services in recent years. More recently, with the booming IoT industry in particular, billions of mobiles and IoT...

Apache Kafka vs Apache Spark : All you need to know

Apache Kafka vs Apache Spark : All you need to know

Introduction Due to the increase in the volume of data, the demand for Stream processing is on the rise. Just processing the data wouldn't be enough, it should be done quickly too so that organizations can react to changing market conditions on a real-time basis. This...

Creating a Multiplication Skill in Alexa using Python

Creating a Multiplication Skill in Alexa using Python

Introduction In this tutorial, we will be focusing on how to create a custom multiplication skill in Alexa using Python. If you're completely new to Alexa skills, you can get a brief idea about it by clicking here. Subsequently, we have posted regarding account...

Creating a Hello World Skill in Alexa using Python

Creating a Hello World Skill in Alexa using Python

Introduction In this tutorial, we will be focusing on how to create a Hello World Skill in Alexa Developer Console. This is the most basic skill, and it would give us an idea about Skill-building using Alexa's developer console. If you're completely new to Alexa, you...

Creating a custom Date-Time skill in Alexa using Python

Creating a custom Date-Time skill in Alexa using Python

Introduction In this tutorial, we will look at how to create a simple date-time skill in Alexa using Python. For this skill, the only prerequisites required are an Alexa developer account and some basic understanding of Python. Also, we have created a post on how to...

All you need to know about Amazon Alexa Skills

All you need to know about Amazon Alexa Skills

Introduction In this tutorial, we will be taking a quick look at Amazon Alexa Skills. So, let us get started with the most common question - What Is Amazon Alexa? Alexa is nothing but a cloud-based voice service provided by the tech giant Amazon. In today's world,...

APIs Vs. Microservices: What is the difference?

APIs Vs. Microservices: What is the difference?

You've probably heard two extravagant terms thrown around when discussing software design and integrations: APIs and microservices. Both topics are important in web application development and design nowadays, and their applications overlap. In this article, we will...

VIDEOS – FOLLOW US ON YOUTUBE

EXPLORE OUR IOT PROJECTS

IoT Smart Gardening System – ESP8266, MQTT, Adafruit IO

Gardening is always a very calming pastime. However, our gardens' plants may not always receive the care they require due to our active lifestyles. What if we could remotely keep an eye on their health and provide them with the attention they require? In this article,...

How to Simulate IoT projects using Cisco Packet Tracer

In this tutorial, let's learn how to simulate the IoT project using the Cisco packet tracer. As an example, we shall build a simple Home Automation project to control and monitor devices. Introduction Firstly, let's quickly look at the overview of the software. Packet...

All you need to know about integrating NodeMCU with Ubidots over MQTT

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

All you need to know about integrating NodeMCU with Ubidots over Https

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

How to design a Wireless Blind Stick using nRF24L01 Module?

Introduction Let's learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic...

Sending Temperature data to ThingSpeak Cloud and Visualize

In this article, we are going to learn “How to send temperature data to ThingSpeak Cloud?”. We can then visualize the temperature data uploaded to ThingSpeak Cloud anywhere in the world. But "What is ThingSpeak?” ThingSpeak is an open-source IoT platform that allows...

Amaze your friend with latest tricks of Raspberry Pi and Firebase

Introduction to our Raspberry Pi and Firebase trick Let me introduce you to the latest trick of Raspberry Pi and Firebase we'll be using to fool them. It begins with a small circuit to connect a temperature sensor and an Infrared sensor with Raspberry Pi. The circuit...

How to implement Machine Learning on IoT based Data?

Introduction The industrial scope for the convergence of the Internet of Things(IoT) and Machine learning(ML) is wide and informative. IoT renders an enormous amount of data from various sensors. On the other hand, ML opens up insight hidden in the acquired data....

Smart Display Board based on IoT and Google Firebase

Introduction In this tutorial, we are going to build a Smart Display Board based on IoT and Google Firebase by using NodeMCU8266 (or you can even use NodeMCU32) and LCD. Generally, in shops, hotels, offices, railway stations, notice/ display boards are used. They are...

Smart Gardening System – GO GREEN Project

Automation of farm activities can transform agricultural domain from being manual into a dynamic field to yield higher production with less human intervention. The project Green is developed to manage farms using modern information and communication technologies....