Zapier is a service for connecting web services and other applications with an API together. It offers support for Gmail, Twitter, RSS, and a few hundred others.

Adafruit.io is a service for connecting your maker projects, sensors and actuators to the Internet.

Adafruit.io can receive, send and store messages. But if you want to have a sensor do a thing with your twitter/email/calendar/facebook/etc., you probably want a service like Zapier or IFTTT that bridges those services together.

The way this works is that you tell Zapier an API key or other credential for the services you want to connect (one for your Twitter account, one for your GMail, one for your Facebook....), while under the hood it knows how to extract or send values to each, and can be triggered on various conditions. This is a called a zap.

We've added basic support for Adafruit IO to Zapier, so you can use it as a bridge between your hardware and a wide range of services. In this guide, we'll discuss using Zapier to:

  1. Extract data from a service (Twitter) and log it on Adafruit IO.
  2. Extract data from an Adafruit IO feed and send it to a service.

First, you'll need an account at Zapier and an invite to the Adafruit IO app on Zapier. Visit zapier.com to sign up, and then use this link for the Adafruit IO app invite.

Next, you'll need an account on Adafruit IO itself. At the time of this writing, IO is in a limited beta - if you're not already signed up,  you'll need to request access over at io.adafruit.com.

For this particular demo, you'll also need a Twitter account. If you don't have one of those, you can sign up in a few minutes over at twitter.com.

Zap: Sending Twitter Results to a Feed

Once logged in to Zapier, look for the "Make a New Zap" button:

Next, you'll need to choose Trigger (from) and Action (to) apps. Start with Twitter as a Trigger app:

Then choose "Search Mention" as the trigger:

Next, choose Adafruit IO and "Send Value to Feed" for the action. (If you don't see Adafruit IO listed, remember that you have to use this invite to access the app.)

Now you should be able to hit continue. You'll be prompted to connect a Twitter account (you've already made one of those and logged into it, right?):

You can give it a meaningful name. You'll probably also want to switch "Auto Follow" to "no", unless you really want to follow Zapier on Twitter. Click "Continue", and you'll be sent over to Twitter to authorize Zapier to talk to your account:

Don't authorize Zapier unless you're comfortable with it being able to see everything you do with your account, and take actions on Twitter on your behalf. You can always make a 'burner account' just for Zapier integration!

Once you click the "Authorize app" button, you should see something like the following:

Once you hit "Continue", you'll be prompted to an Adafruit IO account. This one take a bit more work, since you'll have to find your AIO Key and copy it over.

You can find your key by visiting the Adafruit IO settings page and clicking "View AIO Keys":

Copy this key, and paste it into the "AIO Key" field on Zapier, then hit "Continue".

Next, specify a search term to trigger on. I'll use "adafruit io":

Next, pick a value from Twitter to post to IO - I went with the text of the tweet:

Then pick an IO feed to post to:

Before you get any further, head over to Adafruit IO and make sure you have a matching feed. I did this by clicking "Your Feeds", then the blue "Create Feed" button:

Now you can click "Continue" on Zapier and test your new Zap:

If you look at the feed on AIO, you should now see some sample data:

Assuming everything works, give it a name and turn it on:

Be aware that high-volume searches can use up your quota of "tasks" on Zapier quickly.

I initially searched for just the string "adafruit" and quickly used up the 100 tasks allotted to a free account. A "task" is, more or less, any time Zapier takes an action (like posting a bit of data) on your behalf.

Here's my Adafruit IO twitter mentions feed. I also created a dashboard that displays the most recent tweet. (For more info on dashboards, see Adafruit IO Basics: Dashboards.)

Zap: Sending a Feed to Twitter

Ok, so now let's complete the circuit and have Zapier send some traffic to Twitter for us.

As an example, I have an IO feed for logging mouse data from a Raspberry Pi.

Ok, so suppose I had a friend on Twitter I wanted to notify when the mouse activity got particularly out of hand?

Make a new zap, but this time select Adafruit IO as the trigger application and Twitter as the action app:

Next, select the accounts you set up for the previous zap (they should already be connected):

Then select the feed you're going to use. I went with my existing Mouse Problems feed, but you'll want something you're already writing data to. For more detail on creating a feed, check out Adafruit IO Basics: Feeds.

Next, add a filter on "The logged data". I went with when it's greater than 4:

Now you can build the tweet Zapier will send on your behalf. Click the "Insert Fields" button to use data from Adafruit IO. (You probably want "The logged data", but might be able to use other values as well.)

Since I don't want to clutter up twitter with automated tweets for any actual humans who follow me, I'm @-messaging an old novelty account I created once called @chz_on_stuff. (It's pretty much what it sounds like.)

Next, give it a test:

Lo and behold, a tweet!

Now you can name the zap and turn it on:

That's about the size of it. Following a similar process, you should be able to send and receive IO data to/from any of the other services that Zapier supports. We'll be adding additional features as we continue developing Adafruit IO, but in the meanwhile, please let us know if you run into any unexpected behavior.

This guide was first published on Aug 26, 2015. It was last updated on Aug 26, 2015.