Shade, Blind and Window Opener Control with Node-RED

Alexa™ Blinds: Installing the BroadLink™ Hub & Alexa™ Library Components

Adrian Biffen, Senior Partner

  Bulletin - NEW RM4 Pro Version (with Alexa & Google Home) 

This is just a quick note to let you know we have the new Broadlink RM4 Pro available, with a new article series that includes details about motorized blind control and the Roku Streaming system (with Alexa):

Using the new RM4 Pro with Alexa for Home Theater & Blind Control

The article series below is out of date and has been replaced by the updated link above. The new apps are much easier to use and do not require a Raspberry Pi.

Please Note: This article series assumes you have already set up your BroadLink hub with the phone app (see home theater phone app article series). This series is about using Amazon Alexa™ for blind and shade control. Blind automation with Google Assistant™ will be covered in a separate article series.

Raspberry Pi® with Node-RED and Alexa automates our shade motors and window openers

Node-RED: An Introduction

As discussed in the previous Part 1 of this series, the Raspberry Pi® is a credit-card sized low cost computer that enables people of all ages to explore computer programming for a very low cost. The Node-RED visual design system for home automation comes pre-installed with the default Raspbian operating system.

You can quickly turn the Pi into a very effective, low cost home automation system, with our BroadLink® RF radio/infrared hub, providing direct control with Node-RED of our roller shade motors, window openers, and many other devices.

The Node-RED system has a very flexible dashboard display that runs as a web server page on your local network, and can be extended to the external internet at a later time, if you wish. Voice control with Alexa™ can be easily added, as you will see below, and we'll also be designing a dashboard system to control the blinds and other devices.

At left you'll see a portion of the extensive Node-RED palette, showing the BroadLink® node components, the Alexa™ node component, and some of the dashboard components that we already imported into the system. You simply drag these components into the design area when you want to use them. We don't see how it could be any easier than that!

Starting the Node-RED Web Server

The Node-RED program is installed by default with the Raspbian operating system, and we will assume you have already installed Raspbian on the SD card and booted the Pi into the GUI (Graphical User Interface).

The Node-RED program is on the 'Programming' menu, and when launched, you'll see a console screen, showing that the web server is being invoked. When it is finished loading, you'll see a link that looks similar to this:

Once Node-RED has started, point a browser at http://192.168.1.139:1880

The IP address you see in that line will be where you point your browser to see the Node-RED design screen. You will be able to use any web enabled device in your local WiFi network to see this screen, and you can design the system from any location.

The dashboard will be at the same location, except you will add /ui to that address, like this:

http://192.168.1.139:1880/ui

Both the design screen and the dashboard can be viewed on any browser enabled device on your local WiFi LAN (phones, tablets, laptops, towers, etc), and it will detect a design change automatically if you move from one device to another.

Node-RED Upgrade from Default Version

If you just installed Raspbian, you'll notice that Node-RED is not the full blown version, lacking the palette library for adding components, and lacking the dashboard component for control and data display.

It is important to upgrade the program and the NodeJS server platform that it runs on; you can find the single command that will execute the uprade on this page of the Node-RED documentation (you will need to do this to replicate the steps in this article series).

Understanding the Node-RED Design Screen

This is the screen you see when you first point your browser to the Node-RED system (we have added an Alexa FLOW for lights in the center DESIGN panel):

Node-RED workspace with Alexa running on Raspberry Pi

The above picture is a condensed view of the Node-RED workspace, with the 4 main elements visible:

  • NODE component selector PALETTE panel on the left
  • NODE system DESIGN panel in the center (can have multiple tabs)
  • NODE interconnect "WIRES" connect items in DESIGN panel to create the "FLOW"
  • NODE information OUTPUT panel on right (showing actual realtime feedback from NODE FLOW testing)

The 4 items above constitute the essence of the Node-RED system:

  • Component NODEs are dragged from the left PALETTE panel and dropped into the center DESIGN panel
  • A double click on a NODE in the DESIGN panel opens a dialog box to set PARAMETERS for that NODE
  • Nodes are connected by dragging a WIRE from the output dot of a NODE to the input dot of the next NODE
  • The "Deploy" button activates the FLOW DESIGN panel, displaying any errors you may have
  • Talking to Alexa will activate the FLOW; you can also set screen buttons to activate the FLOW (not shown)
  • The output panel on the right displays subsequent results and feeback on the DEBUG tab
  • There are 2 other tabs on the right OUTPUT panel: INFO and DASHBOARD
  • INFO provides general NODE instructions, and the DASHBOARD displays the user control screen, as you build it

Frankly, we think this is an awesome way to set up a home automation system!

Loading the Node Components for BroadLink™ & Alexa™

We have included the picture below to show where the system menu is (note mouse pointer at top right). This menu allows you to add node components from the extensive Node-RED library, such as the BroadLink™ nodes, and to generally manage various aspects of the Node-RED system.

Node-RED workspace menu for Alexa control of blinds, shades, and lighting

You can use the "Manage palette" command to add (and remove) node components. To add the BroadLink™ node, search the library for "node-red-contrib-broadlink" and load the nodes into the palette; you should see something very similar to the first picture on this page. This node set has been kindly provided by a Node-RED user, Vladimir Filippov.

If the DASHBOARD tab does not appear in the right hand panel, you will also want to load the dashboard component by searching for "node-red-dashboard".

The Alexa™ voice control module needs a further explanation. There are several ways to set up Alexa, and we are choosing the simple solution made by a 3rd party. It does not require an account login with Amazon, or the setup of a "SKILL". You can go the SKILL route if you prefer, and you will likely end up with a cloud-based solution with more features, but there is a learning curve associated with it.

We are focused on providing the simplest solution, and the node component we are using emulates the Philips HUE™ lighting system, which is already built into the Alexa™ system. It does not require any complicated programming. This node component was also provided by users at the Originally US group in Singapore; to add this node, search the library for "node-red-contrib-alexa-local".

----------------------------------------------

Buy The HA-RFIRW-5V RF-IR Hub In Our Online Store

In the meantime, we have the excellent BroadLink phone apps that are very capable, and they may very well be all you need (they work stand-alone, the RPi is not needed). This will give you direct control over our blind motors and window openers. Please note that you will need to set up the phone app if you want to implement the system described in this series.

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

Articles in this series:

Part 1: Alexa™ + RPi + BroadLink™ Hub + Node-RED: Blind Control Introduction

Part 2: installing BroadLink hub and Alexa to control blinds with Node-RED (you are here)

Part 3: Alexa™ + RPi + BroadLink™ Hub + Node-RED: Configuring Node Components in Node-RED

Part 4: Alexa™ + RPi + BroadLink Hub + Node-RED: A Simple Example: Light Control

Part 5: Alexa™ + RPi + BroadLink Hub + Node-RED: Control Blind & Shade Motors

Part 6: Alexa™ + RPi + BroadLink Hub + Node-RED: Configuring the Node-RED Dashboard Light Switch

Part 7: Alexa™ + RPi + BroadLink Hub + Node-RED: Configuring the Dashboard Blackout Blinds