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:

return msg;

Here is the output in the console:

You can for instance link a ZWave (or Philips Hue) motion sensor node:

Very useful to be warned of an intrusion into your holiday home.

Notice that this just an example of IFTTT use: to just send an email, its simplier to just use the email node!

Here is the output in the console:

In this flow, the payload (0 or 1) is sent in the value 1 slot.