Monday, February 25, 2019

You Can Count on Me

I don’t remember where I first read about these programmable buttons from Amazon. Sure, many of us have seen the “Dash” versions you can get which allow you to place an order at the click of a button, but there is potential for more. And while I’ll let your own minds wander to all of the possibilities, I just want to talk about one: using these as data collection devices.

You can configure each button to communicate over wifi. It can receive and transmit data related to a single, double, or long click. Slip one in your pocket. What are the kinds of things you might like to track? How many minutes in a class period the teacher is talking…or how many boys, girls, or non-binary students s/he calls on? What if you gave one to a student and asked him/her to push a button every time an adult in the building greeted him or her by name? We could even go bigger. What if you put a set in the office with a different question each week and asked visitors to respond?

I had these and other questions in mind. So, last summer, we ordered one of these Amazon Internet of Things (IoT) Buttons for our office…and since then, it’s been sitting in its little box, staring at me, waiting for its opportunity to be useful. When I found myself with a gift of time this week, I decided it was finally the moment to program the little beast. Now it’s time to share my learning with you, in case you want to jump in on this, too.

My only disclaimer here is that what I know about coding would fit in a thimble. There will be, no doubt, more elegant solutions to what I implemented—and if you know them, I hope that you’ll share. Here are the resources on which I relied most heavily:
  • Caroline Dunn has a great video on YouTube to help you set up your button and get you started. The code and IFTTT recipes have some useful background, but they did not work for me “as is.”
  • This code from Joseph Guerra, however, works like a dream. The only limitation is that it shows you how to capture information from a single click—not the double or long-click (if you want to use all three options with one button).
  • To overcome this last issue, I was able to use some code from here. I still had to figure out where to place it…but I did. And you can, too.
You will need
I won’t get into the nitty-gritty here with the button set up—watch Caroline’s video or hit teh Googles for some additional support. Basically, you’ll install the apps on your mobile device and use those to configure the button to a designated wifi source and select its first task. 

Next, set up your IFTTT (If This, Then That) recipes. You'll need three: one for a single click, one for a double click, and one for a long click. Use the Webhooks app as the trigger (If then...) and the "add a row" option from Google Sheets (...then that) to capture the type of click. Even though you set this stuff up first, it's really the second part of what happens when the button gets pushed. But you need some information from this to add to the first part of process.

So let's take care of that. Log into your Amazon AWS account and find the Lambda app. This is where your code for the button lives. There's some placeholder stuff there from when you first configured the button using the app on your smartphone. Delete that and replace it with the stuff from Joseph Guerra. You'll be all set for one type of click (single, double, or long). If you want to have the button collect two or all three types of clicks, modify the code so it looks like the sample below. Note that you're just copying the stuff for your first click type (e.g., Single) and pasting it in two more times for Double and Long. Replace the words "Single" with the other clicks.

That's it. You can do it. I did---and I didn't even have this to get started. Keep in mind that you can modify your code here to associate different names with your IFTTT recipes (applets). If you don't want single, double, long showing in your spreadsheet, you can have yes, no, maybe or thumbs up and thumbs down. Or start and stop. The possibilities might not be endless, but the variations are completely up to you.

What I like about the button is not just its options for simplified, automated, and "mobile" data collection, but also the anonymous nature of it. The Google Sheet only captures a timestamp and click type (or whatever word you tell it). When I handed the button off to a principal to use in his building, I told him that whatever shows up in the spreadsheet is all his---I don't need to know who he gave the button to or what the clicks represent or what questions he had in mind. As long as he can extract what meaning he needs, then that's all that matters. And even if the spreadsheet was public, the data won't mean anything to anyone who doesn't know what the various clicks represent.

Now that I survived my first foray into this world, I'm ready to go further. We ordered 19 more of the buttons and I will get started this week getting those programmed and ready to check out to principals. I'm excited to see all the different ways that they use these to gather information in their buildings.

What will you do with yours?