I build plenty of IoT demos here at SitePoint but there's one thing I'd never considered - keeping track of whether or not my devices are online! It's one of those downsides of the Internet of Things... without the Internet, they can become rather powerless things!
In this article, we'll explore how to quickly and easily set up monitoring for Particle devices like the Core and Photon using IFTTT, Slack and Google Spreadsheets. We'll get notifications on Slack about when our devices go online/offline and we'll record that in a Google Spreadsheet for our records.
If you're totally new to the Particle ecosystem, you can find out more on the Particle website. You may know them as "Spark Core", as that was their previous name before they rebranded themselves. I put together a demo with the Particle Core and NeoPixels a few weeks back too. They're basically cloud connected microcontrollers that are a lot of fun to work with!
What is IFTTT?
IFTTT is a wonderful online service that is short for "If This Then That". It allows you to set up rules for various services that either provide an action that can be triggered remotely or provide the trigger for our actions. For example, about two months ago I built a demo on Connecting LIFX Light Bulbs to the IoT Using IFTTT. In that demo, smart lightbulbs would change color or turn on and off depending on various rules I'd set. If I set my Jawbone UP to sleep mode, my lights would know to turn off. If my favorite sporting team were playing, my lights could change color to the team colors to get some team spirit happening!
Connecting Particle to IFTTT
This article will assume you've already got an account on IFTTT set up and ready to go. If not, sign up on the IFTTT website to get started. If you need more info, we covered it in more detail in the previous IFTTT article mentioned above.
To get started, head over to the Particle IFTTT Channel page (or search for it on the IFTTT "Channels" page) and click "Connect":
It will prompt you for your Particle username and password. Enter those in and click "Sign In":
Then click "Okay" to give IFTTT access to your Particle data:
If all goes well, you should have a "Channel Connected!" success message appear for a little bit and a Particle channel page that looks like so:
Connecting Slack to IFTTT
Slack is pretty similar to connecting up the Particle channel, however it asks a few more questions. Start at the Slack IFTTT Channel page and click "Connect":
It will ask you to sign into the Slack domain you'd like the messages to appear inside. I used a domain I've got for an upcoming website project, rather than driving people at the SitePoint channel insane with my Particle alerts!
Then click "Authorize" to allow Slack to post messages into that Slack domain.
Once your Slack domain and IFTTT are able to talk to each other, you should have a Slack Channel page that looks like so:
Creating Our Particle and Slack Recipes
Now we've got Particle and Slack connected up to IFTTT, lets create our recipes with them. Click on the dropdown with your name in the top right and choose "Create" to create a new IFTTT recipe:
Click "this" to get started choosing our trigger:
Type in Particle to find the Particle channel and select that as our trigger:
Continue reading %Monitoring Your Particle Devices With IFTTT%
by Patrick Catanzariti via SitePoint
No comments:
Post a Comment