Hacking the Amazon Dash Button To Work With IFTTT

Update 1.10.16:
This week
Jon Michaels wrote to me and told me that he was having trouble setting up this Amazon Dash hack. We emailed back and forth trying to troubleshoot his situation and Jon ended up solving his own issue. He’s done a fantastic write up of the problem he was having here. Check it out if you are also having issues with socketwatcher or anything else that might be broken.

I wanted to build something really cool with the Amazon Dash Button, and having it trigger actions on IFTTT seemed like a pretty easy and useful task. Luckily I found a bunch of folks already working on the task. I decided to do a quick write up to help anyone who might be trying to do the same.

Full credit to Jon Maddox for the Dasher code, he rocks!

Don’t tear up yours just yet, but here’s what’s inside from Adafruit.

Get A Dash Button

The most obvious step, you’ll need a button, they cost $5, and it doesn’t matter which one you get because you won’t be setting it up to make orders.

Something that’s super interesting is that Amazon does make a button for hacking, but it only works for their cloud services and it doesn’t appear to be for sale.

Setting Up Your Button

Once your button has arrived you are ready to get to work. You’ll need to use the general Amazon shopping app on your phone to set it up, as it has you join the Dash Button’s adhoc wifi network for set up.

Join the network, enter the password for the network you want the Dash Button to join, and STOP.

The last step of the process has you select a product for your Dash Button to order. JUST QUIT THE APP. You’re done with Amazon.

Find The MAC Address of Your Button

All of the hacks I found on Amazon use the same exact method for triggering actions from your Dash Button. They have you set up a server to monitor for the Dash Button joining the WLAN network. They do this by looking for the MAC address as the button powers on, joins your network, and then connects to Amazon. Now your button when it get’s to Amazon will return an error, because we didn’t set up any products for it to order, but that’s a good thing in our case.

So how are we going to find the MAC address? Well unfortunately they didn’t just print the damn thing on the button so you’ll have to snoop for it.

For this project you will use Jon Maddox’s Dasher scripts. He’s written not only the sniffing part but also the JS that we we’ll use for the HTTP services.

Note: Sniffing on a high population network for one MAC address could be particularly difficult, I recommend doing this on a home network first, so you can control the variables. Once you have the MAC address you should be good to switch to another network, just remember you’ll have to switch the WiFi configuration on the Dash Button each time you move it’s network. You do this from the Amazon app.

Using Dasher

Once you head over to Jon Maddox’s GitHub he’s written a really great readme about how to find the MAC, edit the config.json, and then run the app via Node.

A few things to get you right on Mac vs. Linux.

  1. Make sure you’ve downloaded Node, which includes NPM.
  2. The command for running a shell script in Mac’s terminal is “./” before the scripts name.
  3. In Jon’s write up he uses APT-GET to install libpcap-dev. You wont have the apt-get command in OSX’s terminal, so install Homebrew. And use the following command in terminal to install libpcap.
$ brew install homebrew/dupes/libpcap
  1. After all of that you should be on the right track. If you have troubles finding your MAC address of your Dash Button, like I did, try this tutorial.

Setting up IFTTT’s Maker channel

So hopefully you know have gone through Jon Maddox’s readme and you have everything setup. Now it’s time to customize your actions. Jon lays out most of the configuration options you have for HTTP Service requests, but the one I find most useful is using IFTTT’s Maker channel for HTTP triggers. The Maker Channel allows you to send and receive info via a HTTP request. And since it’s hooked up to IFTTT, the possibilities are pretty endless.

  1. Goto IFTTT, login, and activate the Maker channel. You’ll be given a key that you will use in your HTTP requests that your unique ID.
  2. Click the link “How to Trigger Events” and copy and past the code shown on that page. Remember: YOUR_KEY_ID will be replaced with a bunch of letters and numbers.
  1. In the curly brackets {event} is the definable event. In this case we’ll use button_pressed to make it easy.
  2. Goto “Create A Recipe” under My Recipes and start with the IF This as Maker Channel, select “Receive a web request”, and for event name type button_pressed
  3. For That, select anything you like! For something simple you can have IFTTT send you an email.

Configure Your config.json Files

Inside Jon’s files is a folder called config.test.json. You can now clone that and create a config.json file so that when your button is pressed. This is where all the magic happens. For this step you need your MAC Address and Maker HTTP Request URL.

My config.json looks like this for reference:

"name": "Email Me",
"method": "POST"

Notice that my Maker HTTP Request URL has the event trigger “button_pressed” in place of {event}. That’s the keyword IFTTT will be looking for when it goes to send an email. This makes it so you can have multiple triggers for one URL.

Test It All

If everything went as planned you should be able to press the button and have it send out emails to yourself. Now you can go and check out IFTTT’s awesome library of connections and do some pretty rad stuff. I had mine sending GIF’s using Giphy’s API.

Here’s a random party gif I sent to my co-workers

Thanks again for checking out my post, please follow me on Medium and on Twitter to keep in the loop on other projects I’m working on.