Control Echo Blinds Using a Phone

November 23, 2016

Welp, our Amazon Echo broke, and now we can’t close the blinds. Of course we could just close them with our hands, the way people do, but let’s be honest–that’s preposterous. Once you automate, you never go back to hand-operate!

Luckily, there’s a pretty easy solution while we wait for the development kit for Google Home to come out in December.

If you haven’t yet forayed into the world of If This Then That (IFTTT), this is the perfect opportunity. I will ashamedly admit that this is my first time using the service!

Toolbox Additions

We are only adding one item to our toolbox for this one.

Inventory
IFTTT DO Button
This is a very simple button created by IFTTT. It's literally just a button that you can program to do anything you want. In this case, we'll create two buttons--one to close the blinds, one to open them.

And off we go.

1

Download the Do app

You can download either the iOS or Android app on your mobile device. I have an iPhone, as you’ll see in the screenshots below.

2

Join the Maker channel

Launch the app and click the big plus sign at the top to add a new “recipe”. Choose the Channels tab at the top and scroll down until you find the Maker channel (the first icon in the second row in the image below). For some reason when you use the search tool in the Do app, it doesn’t find the channel, so you need to scroll down. Note that the location and look of the icon may change, but it’ll still be called Maker.

Maker channel screenshot
3

Create a new recipe

Once you’re in the channel, click “Create a New Recipe.”

Then select “Make a web request.” You should see a screen like this:

Maker interface

These web requests are a powerful new way that IFTTT lets you make buttons that will basically let you do anything that can be sent over the internet in a web request. This is a super convenient feature for us since our Echo Blinds project is already operating through web requests. Check out our earlier post for a refresher on how it worked with the Amazon Echo. All we’re doing now is replacing the Echo steps with the IFTTT Do Button to get the message into the Relay Server. The Arduino setup will see nothing different and will continue to poll the Relay Server until a new message arrives.

Data flow

For this first version, we’re creating two buttons. One to “open blinds” and one to “close blinds”. For the next iteration we can build a toggle switch that can use just one button.

4

Create the “open blinds” button

The messages that we sent to the Relay Server through Alexa have a specific structure that looks like a normal URL that the Arduino code translates into actions. That’s all a “web request” is–just a URL. There are a couple of parts to the URL:

  • The Address to your relay server (for example, ours is http://projects.theconnman.com:3000).
  • The API Key (this is a secret key that you stored in your hidden config.h file called API_KEY) as described in step 5 of this post.
  • The Client ID, which you also stored in the same hidden config.h file called DST_IP.

So to fill out the fields in the Do Button recipe, enter the following (replacing the pink words with the items discussed above):

Type a Recipe title…

Open blinds

URL

Address/api/put?apiKey=API Key&clientId=Client ID&payload={"open":true}

Method

GET

The rest of the fields are optional, so we’ll leave them blank.

TADA! You’ve got a new way to open the blinds! It should be noted that Alexa will still work to do the same thing, so you’ve just added a new way to open the blinds.

5

Create the “close blinds” button

To make the close blinds button, you’ll follow step 3 again, but this time you’ll enter the following for the recipe:

Type a Recipe title…

Close blinds

URL

Address/api/put?apiKey=API Key&clientId=Client ID&payload={"open":false}

Method

GET

Excellent. Now we can open and close our blinds again!

6

Add Do Button widget to iPhone lock screen

For some extra convenience, you can also add a Do Button widget to your iPhone’s lock screen for quick button access.

Lock screen widget

To do so, first swipe down from the top of your phone, then swipe right to see all widgets. Scroll all the way to the bottom and click “Edit”. Here you’ll be able to add the Do Button widget. Now you can open and close your blinds even more quickly! Still without having to get up to twist the little rod manually. That’s way too much work.

Enjoy your new Do Buttons!

-JMad