Pinterest Stumbleupon Whatsapp
Ads by Google

If you’re not using IFTTT, you’re seriously missing out. If This Then That allows you to combine different services with your own custom logic. You define what should happen when a condition is met. For example: if an RSS feed updates, send an email. If the traffic is bad, wake you up early.

The potential uses for IFTTT are endless. But until now, it’s been difficult to interface it with your own hardware projects. Today, that’s all changed.

Meet Your Maker (Channel)

Channels are the fundamental building blocks of IFTTT. They represent web services that provide data sources or even physical devices like fitness wearables.

There are well over 200 channels available, and they’re a diverse bunch, ranging from Android battery statuses, to RSS feeds, as well as content from publishers like BuzzFeed and the New York Times. Now, they’ve added the Maker Channel.

ifttt-channels

This allows you to build recipes that use data from projects you’ve personally built, which can then be used to trigger actions elsewhere. Whether that’s from your Arduino-based alarm system How To Make a Simple Arduino Alarm System How To Make a Simple Arduino Alarm System Detect movement, then scare the heck out of an intruder with a high pitched alarm sounds and flashing lights. Does that sound fun? Of course it does. That's the goal of today's Arduino project, suitable... Read More , or from your Raspberry Pi powered motion tracker Build a Motion Capture Security System Using a Raspberry Pi Build a Motion Capture Security System Using a Raspberry Pi Of the many projects that you can build with the Raspberry Pi, one of the most interesting and permanently useful is the motion capture security system. Read More  – or your own web project. Anything, really.

Ads by Google

It’s also bi-directional too. You can send messages to your projects straight from IFTTT.

So, for example, you could have an LED companion cube How to Build a Companion Cube Mood Lamp (For Absolute Arduino Beginners) How to Build a Companion Cube Mood Lamp (For Absolute Arduino Beginners) Read More that flashes when you receive an email, or an automated laser turret Pew Pew! How To Build A Laser Turret With An Arduino Pew Pew! How To Build A Laser Turret With An Arduino Are you bored? Might as well build a laser turret. Read More that shoots a beam of light whenever BuzzFeed posts a new article.

The possibilities are endless.

One of my favorite things about IFTTT is the fact that many people choose to share their recipes with the public, for free. There are thousands of IFTTT recipes, ripe for the taking. This is ideal if you’re looking for some inspiration for a project. At the time of writing, there are hundreds of example recipes available for your perusal at hackster.io.

Getting Started

There are some key differences with how recipes are built with the Maker Channel compared to other channels. But that shouldn’t deter you.

First, when you sign up for the makers channel, you’re given a secret key. This string of characters is what identifies you to the IFTTT servers. Given that you’re going to be using this with real-world IoT (Internet of Things) devices in your home, you should take good care of this. Don’t share it, and keep it in a safe place.

ifttt-secret-key

Once you’re all signed-up, you’re going to want to start incorporating it into your projects. Using it is simply a matter of using GET and POST requests. These are an open web technology, meaning you’re not just limited to using it with Arduino and Raspberry Pi. You can also use it with anything that supports HTTP, like the Tessel board Building The Internet of Things, With Tessel: The Node.js Development Board Building The Internet of Things, With Tessel: The Node.js Development Board Tessel is a new breed of development board that runs entirely on Node.js, and after a successful Kickstarter, they’ve now the reached the point of being available to everyone. Read More , the .Net Gadgeteer, and even standard web applications.

If you’re using Arduino, the official documentation will tell you everything you need to know about making HTTP requests. But if you’re using Raspberry Pi, you’ve got a lot of choices when it comes to how you use it. You could use Curl, but if you’re using Python, you can use the delightfully simple to use Requests library.

Creating Your Recipe

So, let’s start off by making our recipe. This is actually surprisingly simple. First, create a new recipe using the Maker channel. Then, you’ll be prompted to define an event name that triggers this recipe (like “button_pressed”, or “motion_made”). If you plan on having lots of custom events, make sure they aren’t too generic.

ifttt-event

Then, move on to defining what you want to happen when an event happens.

ifttt-event2

I decided to send myself an email alert.

ifttt-alert

If it all looks good, press “Create Recipe”. Then you’re ready to start using the IFTTT Makers Channel.

ifttt-confirm

 

Triggering Events

Communicating with your recipe is easy. You simply need send a special POST or GET request to the following URL.

https://maker.ifttt.com/trigger/{event}/with/key/{secret_key}

Here, we’ve got a couple of variables in curly braces. Event is simply the event name, and secret_key is your secret key. If you were to call this in Curl, you’d be looking at something like this.

ifttt-curl-nopayloads

$ curl -X POST https://maker.ifttt.com/trigger/MakeUseOf_IFTTT_Test/with/key/{secret_key}

With Python’s Requests Library, this is even simpler.

ifttt-requests-nopayload

import requests
requests.post("https://maker.ifttt.com/trigger/MakeUseOf_Test/with/key/{secret_key}")

Including Payloads

When triggering IFTTT, you can also include include up to three variables, which can then be used in your recipes. These are stored as a JSON object (What is JSON? What Is JSON? A Layman's Overview What Is JSON? A Layman's Overview Whether you plan to be a web developer or not, it's a good idea to at least know what is JSON, why it's important, and why it's used all around the web. Read More ). Here’s how you’d include three variables in Curl:

ifttt-curl-payload

curl -X POST -H "Content-Type: application/json" -d '{"value1":"test","value2":"test","value3":"test"}' https://maker.ifttt.com/trigger/{event}/with/key/{secret_key}

And in Python:

ifttt-requests-payload

import requests
payload = "{ 'value1' : 'hello', 'value2' : 'hello', 'value3' : 'hello'}" requests.post("https://maker.ifttt.com/trigger/MakeUseOf_Test/with/key/{secret_key}", data=payload)

Note that the variable names (“value1”, “value2”, “value3”) are fixed; you can only include up to three variables, and they must be named like that.

Inbound Traffic

As previously mentioned, IFTTT’s Makers Channel is bi-directional. Not only can it receive messages and triggers, but it can also send them.

This shouldn’t be too difficult. You just need to set up an endpoint, and provide IFTTT with the URL for it. You can also specify the body of the content sent to that URL, as well as the type of request sent.

ifttt-url

This means that you can use the Makers Channel with an application you’ve hosted on the cloud (for example, on a Virtual Private Server What Is A Virtual Server, And What Can You Do With One? What Is A Virtual Server, And What Can You Do With One? Virtual machines and virtual servers — what are they and how do they differ? Read More ). If you’re fortunate enough to have a static IP, or have a dynamic DNS service 5 Best Dynamic DNS Providers You Can Lookup for Free Today 5 Best Dynamic DNS Providers You Can Lookup for Free Today DynDNS was always a top mention when free dynamic DNSes were brought up. But now that it's gone, are there any good alternatives? There sure are. Read More like DynDNS, you could feasibly use it at home with your own creations.

If you go down the path of using a VPS, both Digital Ocean and Linode come highly recommended.

IFTTT Your Smart Home

It’s probably worth noting that this isn’t IFTTT’s first foray into the Internet of Things. They already support an expansive range of Smart Home devices, ranging from the Nest Protect Nest Protect Review and Giveaway Nest Protect Review and Giveaway Read More , to the Philips Hue lightbulb Light Your Home the Smart Way With Philips Hue Light Your Home the Smart Way With Philips Hue If you can afford the initial expenditure, you won't find a better-supported and more user-friendly smart lighting system on the market. Read More , and everything in between.

But this marks the first time where developers can easily integrate their own creations with IFTTT. And that, to me, is really damn cool.

But what do you think? Have you got a burning idea for a creation you want to build? Let me know in the comments below, and we’ll chat.

  1. Ben
    December 6, 2016 at 1:24 am

    I believe there's an error in the python code. The payload should not have quotes around it.

  2. Shailendra
    October 11, 2016 at 3:58 pm

    Hi,

    It is mentioned that we can send 3 JSON values along with the request

    Is that JSON object could b any JSON object?
    I mean is it possible to send array as one single object?

  3. amin
    June 12, 2016 at 8:24 am

    thanks Matthew .... so useful article .... I have make a IFTTT channel with maker to send text message ... it send messages very well but I don't know how should I add a line break in my messages text ?
    I simple used enter but not worked .... I used this html tag but not working ....
    do you know how ?

  4. Ketchup
    May 24, 2016 at 5:41 am

    Is there anybody who uses IFTTT with Devolo Home Control ?

  5. Ali
    May 1, 2016 at 9:05 am

    Hey dude, I think I may be a little while figuring this out, but reading and reading and reading about implementing more complex rules in ifttt has brought me here... I'm working on the idea of writing a multi-presence web-service, probably in azure. I have some experience of .net c# so it shouldn't be difficult for me at that end... Hoping to write something that turns on my hue lights when they are already off, and when no-one is home, to do nothing when extra people arrive, then the turn them all off when the last person leaves. If I can write a web service to receive notification of who has arrived and who has left then I should be able to get it to trigger an event to turn them on / turn them off again when appropriate right? I know I could host it at home on a device but I'm an IT guy so using a cloud service appeals (and saves me buying and running hardware).

  6. Ajay
    April 29, 2016 at 7:01 am

    Is there a way of creating a receipt for lightwaverf and harmony. I want to turn the lights off when I watch movies
    I am new to this please help.
    Ajay

  7. Kez
    March 26, 2016 at 10:21 am

    I want to do something very simple. For ifttt to send an SMS to a number when data connection speed is 0kb/s. is that possible

  8. Jolien
    March 17, 2016 at 9:31 pm

    I am currently in the possession of a "Flic". For school I would like to use my flic to control an analog RGB led strip. For example: Push once is turn it on and this color, push twice is turn it of,...

    I was thinking about using Arduino and IFTTT but after roaming the internet for long while I came to the conclusion that I didn't understand any of the articles and don't have the skills to do this.

    Do you have any suggestions? Thanks!

    Kind regards,
    Jolien

  9. Stefan
    March 7, 2016 at 10:44 am

    Followed your syntax but I always get "Bad Request" as response.

    curl -X POST -H "Content-Type: application/json" -d '{"value1":"URL","value2":"Test"}' https://maker.ifttt.com/trigger/post-fb-methode/with/key/cxxxxxK

    There must be a mistake but I sure can't find it. Any suggestion?

  10. betogls
    February 9, 2016 at 9:42 am

    I am having this issue : {"errors":[{"message":"You sent an invalid key."}]}
    eventhough I tried with some other recipes and I got the same problem, any wisdom ?

  11. walker
    January 22, 2016 at 4:33 am

    Any plans to allow making web request to a url secured by authentication mechanisms? In this scenario would the service exposing the url need to create a partnership with ifttt to create a channel?

  12. volfugas
    September 30, 2015 at 3:13 pm

    It is very interesting !
    I know it is easy to turn a Hue light on with IFTT.
    I am particularly interested in using this function to wake me up earlier in case of rain (because of traffic jam). But it seems impossible to ask to IFTT to turn the light on at 6:00 IF it is raining, and I do not want to be woken at 3:00 in case of rain !
    Do you know how to implement 2 conditions with IFTT ? One for the meteo, the second for the time ?

    • bal simpson
      November 6, 2015 at 1:16 pm

      You can make two recipes.

      1. Turn on the hue at 6.00 am when weather channel sends you a report saying it's raining (You can specify the time of weather report)
      2. Make another recipe when the weather channels says anything but rain

  13. Angela Randall
    August 22, 2015 at 5:16 am

    I didn't even notice this. I thought I'd add that they added support for Spotify and Pinterest (among other things) recently. It really is an awesome tool.

    • Matthew Hughes
      August 30, 2015 at 1:06 pm

      Agreed. I'm all about IFTTT.

  14. N Herold
    August 21, 2015 at 7:02 pm

    Cool!

Leave a Reply

Your email address will not be published. Required fields are marked *