IFTTT for NodeRED

Use rules in the cloud with IFTTT (“if this then that”).

IFTTT (https://ifttt.com) is a cloud service that allows users to create chains of simple conditional statements, called “recipes”.

Discover recipes here: https://ifttt.com/recipes

All the recipes use channel that are created from the majority of social networks and inbox applications.

In order to generate IFTTT Trigger, we use the Maker channel that allows you to connect your app with the IFTTT service.

Create a IFTTT applet

The first thing to do is to unable an entry in IFTTT. Go to “my Applets”, then “New Applet”

Select “webhooks” for the “this” part.

ask for “web” in the search edit box to select the “webhooks” service and select “Receive a web request”.

Choose a trigger name that you like:

Then any action. For instance an email:

The last point is to get the authentification key to be able to call the service.

So to “services” then “webhooks” then choose “settings”:

copy the key under the red line.

Install the NodeRED node

In NodeRED, click the right menu in the Node-RED web page. Choose Manage Palette then Install.

  • Type ttb-ifttt in the edit box and click the OK button.

  • Wait for the install

The installation may take a few minutes (a progress bar shows the progress). * You don’t need to reboot nor refresh the web browser page. * Now you can find this node in the palette (use the filter to find it)

Build a NodeRED flow

Find and drag the IFTTT node:

Edit it: fill it with the trigger name gave and the key you got.

You can also fill the values edit box but they are usually filled in the previous nodes (in msg.value1 …). msg.payload is used if msg.value1 is not defined.

Build a simple flow that sends a value:

Here is the function node content:

msg.value1="youpi";
return msg;

Here is the output in the console:

More

Find the full source code on GitHub https://github.com/TheThingBox/ttb-ifttt.