Adding more complex triggers with IFTTT to control your home IoT

IoT HomeI have been using IFTTT for quite a while with my various IoT devices, doing simple things like turning on lights when my garage door opens or when there is motion near my home. One of the great things about IFTTT is its simplicity. If ‘this’ triggering event happens, do ‘that’. This simplicity is also one of the frustrating limitations of doing more complex tasks.

If I want to only turn on the porch lights when it is dark out, but keep them off when it is light, there is no way to do that natively within the system. They have thought about expansion capabilities through the ability to send and receive information from websites that can provide stateful information – IFTTT supports both trigger and response through a capability called webhooks. There are some free services to support this capability that you can experiment, if you don’t want to bring up your own website.

The one I looked at is: and there is a good explanation of it on Medium. It is still in beta though.

Apilio has three building blocks:

  • Variables – to contain state information
  • Conditions – to evaluate variables
  • Logicblocks – to determine the actions from a Boolean analysis of the conditions

As an example, I decided to use Apilio with IFFF to turn my lights on when there was motion in front of my house but only when it is dark out. To accomplish this, I had to perform the following steps:

  1. Configure your IFTTT webhook connection on your webhooks settings/documentation page in IFTTT and enter that key into your Apilio profile. This key enables a secure connection between the website and IFTTT.
  2. Next define the variables in Apilio where you would like to store state information. In my case, I created a Boolean variable darkOutside. Note that there are URLs that when accessed will set the variable to True or False. You’ll need these URLs in the next step.
  3. Define two IFTTT rule Applets that set the variable to True at sunset and False at sunrise, using the capabilities of the Weather Underground trigger supported by IFTTT.
  4. Define a condition in Apilio that if darkOutside is True then it returns true, otherwise False. I named it DarkOutsideCondition
  5. Next, I made an Apilio logicblock that performs a simple logical AND operation that if it is triggered and the DarkOutsideCondition is True, it triggers applets back in IFTTT. I called the logicblock lights_on_when_dark. It has a URL to force its evaluation (from the logicblock show command) and a place to store a IFTTT trigger event name, if it is evaluated. One for True (called LightsOn) and another for when it is evaluated False (called LightsOff).
  6. Since I have a Ring doorbell with motion sensing that interfaces with IFTTT, I made an IFTTT Applet for when motion is sensed to initiate the evaluation trigger of the logicblock lights_on_when_dark.
  7. Now I just needed to create 2 more Applets, one to turn on the lights if it gets a webhook event called LightsOn and another if IFTTT gets the webhook event LightsOff that turn the lights on accordingly.

This may seem a complex but really only consists of:

  • a variable, a condition and a logicblock in Apillio
  • five applets in IFTTT:
    • set the darkOutside variable to true at sunset
    • set the darkOutside variable to false at sunset
    • receive a LightsOff trigger and turn the lights off
    • receive a LightsOn trigger and turn the lights on
    • catch the Ring motion sensor trigger and force and evaluation of the lights_on_when_dark logic block.

This is a fairly simple example. There are also some additional examples on the Apilio site, but hopefully this walkthrough will help you get started with enough context to overcome some of the areas that confused me.

I also have a IFTTT applet to turn the lights off at sunrise, just so there is another way to turn the lights off. I should have the ability to add some delay sensing so that I can turn the lights off after they have been on for a defined period (say a half hour), to keep my energy costs down.


NIST standards draft for IoT Security

IoTThe draft version of NIST’s “Interagency Report on Status of International Cybersecurity Standardization for the Internet of Things (IoT)” was  released this week and is targeted at helping policymakers, managers and standards organizations develop and standardize IoT components, systems and services.

The abstract of this 187 page document states: “On April 25, 2107, the IICS WG established an Internet of Things (IoT) Task Group to determine the current state of international cybersecurity standards development for IoT. This Report is intended for use by the IICS WG member agencies to assist them in their standards planning and to help to coordinate U.S. government participation in international cybersecurity standardization for IoT. Other organizations may also find this useful in their planning.”

The main portion of the document is in the first 55 pages with a much larger set of annex sections covering definitions, maturity model, standards mappings… that will be likely of great interest to those strategizing on IoT.

The document is a great starting point for organizations wanting an independent injection of IOT security perspectives, concerns and approaches. My concern though is the static nature of a document like this. Clearly, this Information Technology area is undergoing constant change and this document will likely seem quaint to some very quickly but be referenced by others for a long time in the future. A wiki version may make this more of a useful, living document.

Comments on the draft are due by April 18. Reviewers are encouraged to use the comment template, and NIST will post comments online as they are received.

IoT triggering some thoughts

A few weeks ago, I mentioned my initial foray into IoT for the home.  I now have my Ring Doorbell installed and a few Wemo switches.

It wasn’t hard to do and with IFTTT integration I can set up actions for numerous triggers like:

  • Turning on the lights at sunset
  • Log when someone comes to the door in a spreadsheet
  • Turn on the house lights when my phone is getting close to home
  • Use Google assistant to do a variety of things

My only complaint is that IFTTT is a bit slow in recognizing a triggering event (like motion) from the Ring doorbell. It takes a minute or more for the action to occur.

It is great that I can have my devices talk to each other, I just wish there was a bit more for them to say. A number of years ago I put together the following illustration:

IoT Value

It seems that IoT is like Metcalfe’s law for the internet:  the value generated is  proportional to the square of the number of connected devices in the system. The one thing that’s true though is that there are more devices with more interfaces all the time.


IoT starts to come home

Over the years, I’ve played around with a few IoT solutions. Sunday, I decided to seriously tackle some outdoor lighting, by replacing one of my light switches with one that can be controlled from the Internet.

372.jpgI looked at a number of solutions and found that there are surprisingly few that will replace a 3-way switch (in fact the only 3-way switch I found was from GE and then I would need a controller…). After looking at my requirements, it appeared I only needed normal light switches and the one I chose was the Belkin Wemo® Light Switch. Fortunately, my house was already wired with switches that looked fairly similar, so my wife was happy with the result.

Thanks to Amazon same day delivery, the new switch was at my house at 6PM on Sunday.

I had it unboxed, wired in and controlled by IFTTT in under an hour. So now I can control when the light go on and off automatically and can turn them on manually from my phone. Not bad… for an hours work.

I have a few more projects that I am planning to do around the house, so I’ll write about those too, as well as anything I learn along the way. An example setting up a dedicated wireless LAN just for the IoT devices (to localize any security issues).


Could Blockchain be at the center of IoT security?

Blockchain can be used for many things… Blockchain technology has the potential to reduce costs, improve product offerings and increase speed for banks, according to a recent report from the Euro Banking Association (EBA). If you’d like a nice overview of blockchains and bitcoin, there’s one on Khan Academy.

Blockchains can be used to keep track of transfers and to ensure that the data collected has gone through a verification process. One of the properties is that the blockchain is a globally distributed database that anyone can add to, but whose history no-one can modify.

This feature could be very valuable for IoT applications where there is data coming in that you would like to both verify and keep for predictive analytics… IBM has been looking at this for a while, since one of the security concerns has been that nefarious data sources could either modify the incoming data or change the data history. Blockchain techniques could make that almost impossible. One of the issues when you have an abundance of data coming into the enterprise is that the length of the chain could expand to the point where maintaining the chain costs more than the data is worth so the processing of the chain would probably need to be outside the IoT sensors/devices themselves. The devices would need to have their own private/public keys though if the validation goes all the way to the edge.

A simple way to think of the block chain for data transactions…


Where each block likely contains:

  • A timestamp
  • The hash of the previous block as a reference (except the Genesis Block)
  • A pointer to the data transactions hash
  • The block’s own hash
  • The Merkle Root – a hash of all the hashes in the block

This is definitely quite a bit of security but when needed it should be sufficient…


New approach to power #IoT

plug in economyOne of the great things about Moore’s law that is sometimes overlooked is that even though computing capabilities have expanded at a tremendous rate, the power consumption for those same transistors that are being packed together have gone down at an even faster rate.

This announcement from the University of Illinois at Urbana-Champaign of the demonstration of a high-performance 3D micro-battery suitable for large-scale, on-chip integration may have long-lasting impact to the Internet of Things.

“Due to the complexity of 3D electrodes, it is generally difficult to realize such batteries, let alone the possibility of on-chip integration and scaling. In this project, we developed an effective method to make high-performance 3D lithium-ion microbatteries using processes that are highly compatible with the fabrication of microelectronics,” – Hailong Ning, a MatSE graduate student

If this technology can be produced reliably, I’d expect it to show up in many ways quickly, since access to a power source is critical to any sensing or distributed computing approach, allowing for greater flexibility in where to place ‘things’. Having the manufacturing process compatible with the chip making process should make for rapid adoption.


Expect more from IoT

planningRecently there was a post in Forbes titled In Search of the True Value in The Internet of Things. This post narrowed down the value statement to:

The real value lies in being able to capture and analyze the data that comes from the sensors at the endpoints of IoT — and that needs to be the few nuggets of data that are of material value to the business.

It does make me wonder if the author overlooked the new business model possibilities. It is not just about capturing and analyzing, it also include the action taken by which actors for the company and its entire ecosystem. As everything ‘gets smarter’ there should be more options available and more time to execute those options. At the same time we see larger and more powerful arrays of processors, we also see them moving into more places and processes.

One of the great questions that remains is what should ‘we’ be doing differently now that computing’s impact moves both deeper and broader into the business?

The arrogance of success is to think that what you did yesterday will be sufficient for tomorrow. -William Pollard