Hacking the Amazon Dash Button To Work With IFTTT
Jeff MacDonald
355

This is a great write-up which helped me down the path of getting my Dash buttons working. I had installed a couple LIFX bulbs and a WeMo switch at Christmas time and used IFTTT to create a schedule to make it look like we were at home while we off visiting family. (Plus the Christmas lights turned on and off on their own. Which was cool.) I’ve continued to use them because it’s nice to have the front porch light and couple other lights in the house turn on automatically just before sunset. However, I had the problem that those lamps in the house couldn’t easily be physically turned off without messing with the automation. I really needed WiFi buttons. I really needed Dash buttons.

I’m running OS X 10.11.2 on a Mac Mini media server in the house so it was perfect as a Dash button intercepter as well. I followed Jeff’s suggestions but I could never get the Dasher script to install properly. I kept getting a long list of errors that ended suggesting that “socketwatcher 0.2.1” was having trouble with “node-gyp rebuild”. Here’s how I got around it and got the script working:

I would recommend installing NodeJS v4.2.4 LTS. It seems to be closest to was used with the original Dasher script. Node JS v5.3 and v5.4 will work as well but for some reason you get A LOT more dependencies installed. Perhaps that doesn’t matter. Install everything else as Jeff recommends. Download Dasher into a folder that you’d like to run it from. Normally you would use “npm install” from the command line in the Dasher folder but then you’ll get the errors I was mentioning before.

The way around that is to install the dependencies yourself. While still in the Dasher folder, rename package.json to something else like zpackage.json. The two dependencies for Dasher are “node-dash-button” and “request”. Install those two from the command line while in the Dasher folder.

npm install node-dash-button

npm install request

If you haven’t setup your config.json file, you will need to do that now. Follow Jeff’s instructions. Rename zpackage.json back to package.json. Then you should be able to run Dashner without any problems. From the command line while in the Dasher folder:

sudo npm run start

Once I did that, everything MOSTLY worked for me. I could push a Dash button and it would trigger rules I set up in IFTTT. I said “MOSTLY” because the problem I did have was that the script would crash a lot for me. I’ve found it to be too unstable for what I was looking to do. Ultimately I ended up using a python script to handle the Dash buttons. But that’s another story.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.