IFTTT (if-this-then-that) example: event handling for temperature and light sensitive blinds and shades

Environmental Sensor Controls Blinds, Shades, Window/Skylight Openers


Bulletin

RollerTrol™ Skylight and Window Openers: Our window and skylight openers are very unobtrusive, blending well with your decor as there are no exposed rods or levers. The chain emerges at right angles from the housing to form a semi-rigid arm that will open a window or skylight. These units also work with our blind and shade motor remotes and automation systems. We have interfaces available for almost any type of automation protocol, not just our own preferred BroadLink® RF-IR blaster controller hub (with RF and IR learning capabilities).

Turn all your old phones and tablets into powerful WiFi home automation controllers with the BroadLink® system!

If you want to take it even further and add support for many other system hubs like Alexa®, Wink®, SmartThings®, Vera® and Wemo®, take a look at the Home Assistant home automation system. Written in Python 3, it is an excellent system that runs on any platform (Raspberry Pi included) and supports literally hundreds of devices, including our blind motors and skylight/window openers via the BroadLink® plug-in.

Overview of Sensor Event Handler environmental sensor monitors temperature, light level, humidity, VOC air quality, sound level

This is the fourth article in this series about using our ES-WIFI-5V e-Air environmental sensor monitoring system for our motorized blinds and shades, and window/skylight openers.

If you missed the previous article about the downloading and installation of the Android or IOS app, please review that article first.

The BroadLink® system is both affordable and user-friendly, with the unique ability to "learn" individual RF motor control signals, including those used to open and close our blinds and shades or our skylight/window actuators.

In this article we will be discussing the BroadLink® software event manager that resides on the environmental sensor. The sensor generates the IFTTT (if-this-then-that) control signals for temperature or light triggering of our blinds, via WiFi control of the transmission hub.

This system can be used in just the same way to control our motorized window/skylight openers, or our SmartPlug to control AC power, or any IR controlled device such as an air conditioner.

There are 2 key hardware components required for this application:

  • The HA-RFIRW-5V controller hub that activates the blind motors for open and close actions
  • The ES-WIFI-5V environmental sensor that provides WiFi control signals to trigger the above hub transmissions

The BroadLink® IFTTT (if-this-then-that) Control App for Android and IOS

home screen for controller to activate blinds via WiFi hub when temperature changes The picture to the right is a screen capture of the BroadLink® Android phone app (IOS is also available).

This is the master home screen for the complete system, where we have created control screens and installed various devices, including the green device icon for the environmental sensor (e-Sensor).

environmental sensor event manager activates blinds via WiFi hub when temperature changesThe controller hub (at left) has a number of different control screens on the app home screen, and we'll use the 4th icon that says 'Blinds' as the target device(s) we want to control.

We had created this remote control function previously, but if you have not already created a remote control screen for the device you want to control with the sensor, please refer to the companion article series that explains how to set this up:

Smart hub for blind motors: Introduction

Please keep in mind the environmental sensor could be used to control anything that the smart hub or smart plug can control, such as our skylight and window opener motors, drapery systems, lights, air conditioners, etc.

If you are just adding the ES-WIFI-5V environmental sensor to an already-configured smart hub system, please plug it into an outlet and connect to your router using the SmartConfig™ method; just enter your router SSID and password credentials.

It will connect and retain those settings in non-volatile flash memory, so even if you have a power failure, it will automatically re-start when power is restored (as do all the units in this system).

Creating IFTTT Event Triggers and Subsequent Actions

When you press the e-Sensor icon, you'll get the first screen on the left, below. This is the status monitoring screen for your environment, and it will show you the current status of the various environmental parameters that are monitored (temperature, light level, humidity, VOC air quality, sound level).

If you press the gear icon in the top right of the status reporting screen you will get a drop-down menu with 2 choices:

  • Interaction
  • Settings

Press the Interaction menu item and you'll get the second screen below, which is where we start the process of creating an IFTTT (if-this-then-that) event handler.

Press the large + symbol to add an event trigger; you'll see the third screen below:

environmental sensor sends blind motor activation command when temperature changes  creating an event action in the task list  start of IFTTT event action sequence

As seen in the last picture above, there are three steps involved in setting up a sensor event action:

  • Sensor and Condition
  • Timer (optional)
  • Action

Press the Sensor and Condition option and the first screen below will appear. You can choose any of the environmental parameters to act as a trigger; we'll select temperature for the purposes of this example.

When you press the Temp sensor selector that is seen in the first screen below, the next "temperature trigger selector" screen will appear, as seen in the second picture below. Keep in mind this may be the first of two events we are setting up for the blinds, one for "temperature too high" (close blind) and one for "temperature too low" (open blind).

This could just as easily be configured as a function of light level, perhaps closing shades if direct sunlight is present in the room.

You can swipe the screen up and down to scroll through the various temperature settings. If you have plugged your phone into a laptop using a screen replicator program, the arrow down and up keys will do the same (depending on the OS and software you use). We use Ubuntu with Seven Square, which works perfectly.

We'll press 78°F as the sensor trigger temperature, which will then show the 3rd screen below. The purpose of this screen is to define whether this is an upper or lower limit, so we will set it as an upper limit (the room is getting too hot).

selecting an environmental input as a trigger  choosing the trigger temperature condition for the blind activation  setting the IFTTT trigger temperature event as upper limit

After you make the upper/lower limit selection, you will be returned to the first screen below which is the same as the IFTTT event creation screen where you started this process, except that it now shows the trigger condition Temp go up 78°F.

The next step is to select the action you want performed when this trigger temperature is reached. Press the action icon shown on the first screen below and you'll see the resulting action definition screen in the second picture below.

We'll press the Blinds icon to select them as the action choice, which will cause the blinds control screen to appear, as in the 3rd screen capture below. Press the Close button to set the actual action.

Please Note: If you didn't see the previous article series about using our HA-RFIRW-5V controller hub for home theater, you may be interested to review that series as this IFTTT rain sensor is an add-on to that system. The previous series explains how to "learn" remote control signals for your motorized blinds, shades, and skylight/window openers.

At this point you will be returned to the IFTTT configuration screen (1st picture below), with the action now also defined. You have the opportunity to save these settings, so it's a good idea to tap the Save text on the screen. You can always delete an event later, if desired.

After saving the setup so far, pressing the "Back" button will take you to the saved list of sensors, and pressing the one we are working on will bring up the action screen again, as seen in the first picture below. This event creation process is quite a simple procedure once you have done it a few times.

We will skip the timer function for now, but suffice to say there is a lot of flexibility that can be introduced with that, such as delays, duration, daily repeatability, etc.

start of IFTTT event action sequence  choosing the action event for the temperature sensor trigger  action event for rain sensor is skylight closing

To finish the event programming, you could now repeat the entire event configuration to handle the temperature lower limit event. The only difference will be with the temperature condition selector (blind open event) and the action selector (blinds open).

The environmental sensor IFTTT program can manage up to 16 different IFTTT events, with 6 conditions and 8 actions for each event.

You may also prefer to raise a notification instead of actually activating the blinds right away; the options are many, and you can decide what works best in your particular situation.

This concludes the article series about automating temperature sensitive blinds; if you got this far, we'd like to thank you for your interest.

Where To Go From Here

Part 1-Temperature and light sensitive blinds: Introduction

Part 2-Temperature and light sensitive blinds: Activating the sensor

Part 3-Environmental sensor program installation: Download and install software

Part 4-Environmental sensor IFTTT event handling (you are here)

If you didn't see the previous article series about using our HA-RFIRW-5V controller hub for home theater, you may be interested to review that series as this IFTTT temperature controlled blind is an add-on to that system.

Also, see the follow-on series about our other devices:

If you are interested, you can purchase these products in our DIY online store.