O'Reilly logo

Practical Internet of Things with JavaScript by Arvind Ravulavaru

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building the IFTTT rules engine

Now that we are sending the required data to the API engine, we will be doing two things:

  1. Showing data that we got from the smart wearable on the web, desktop, and mobile apps
  2. Executing rules on top of the data

We will get started with the second objective first. We will be building a rules engine to execute rules based on the data we have received.

Let's get started by creating a folder named ifttt at the root of the api-engine/server folder. Inside the ifttt folder, create a file named rules.json. Update api-engine/server/ifttt/rules.json, as follows:

[{ "device": "b8:27:eb:39:92:0d", "rules": [ { "if": { "prop": "fall", "cond": "eq", "valu": 1 }, "then": { "action": "EMAIL", "to": "arvind.ravulavaru@gmail.com" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required