August 29, 2015 · technical projects

How to hack Amazon's Wifi button for IFTTT

If you've ever had a puppy or a baby, you'll know how important it is to track their bodily functions. Are they ok, healthy and pooping according to plan? If you're super organized you can track those shenanigans in a spreadsheet.

In other news, Amazon kickstarted the Internet of Things (IoT) with their impressive $5 wifi buttons. You literally push a button with a product name on it, and Amazon will send you that thing.

Kudos to Ted Benson, who posted an inspirational HOW-TO for parents over on Medium, combining these concepts. Now you can hack Amazon's tiny one-button device to track events - such as your baby's bowel movements - with a button push!

dash button

It takes three or four minutes before you even realise it's an advert for his company CloudStitch. Well played, that man.

I love the idea and had to try it. But with engineer OCD we can do better. Let's do it my way!

1. Use IFTTT

There are over nine billion things you could do with a pushbutton trigger. Say, push a button to call an Uber/Lyft to your house. Let's drop CloudStitch and leverage the great variety of outbound channels in IFTTT.

Up until recently this would be annoyingly difficult. Thankfully since IFTTT introduced the Maker channel in June we are sorted - you can easily set up inbound webhooks from anywhere.

(1) Create a recipe with a Maker web request inbound, and outbound sending to a Google Spreadsheet. Give it a charming name indicative of the great event:

ifttt recipe

Take note of the secret key and the trigger URL.

(2) Configure the outbound channel to accept a couple of values from the HTTP call that we'll be sending. We'll use this for the date and time portions of the timestamp:

ifttt config

(3) Now create another recipe for a baby_peed event. Lovely!

2. Prepare a spreadsheet

Open a new Sheet and put header values in for the data that's about to arrive:

3. Improve the script

Here's my adapted Python:

The improvements:

It all works and is 100% amazing!

3. Things still to do

Get notified when I post

Comments powered by Disqus