I've "known about" IfTTT.com for years. Just never got around to playing with "If This, Then That" before.
The good news: It is really, REALLY simple to get it to send out a URL to make a web attached "thing" do something!
The bad news: It is only really, really simple if you have already become familiar with how to use IfTTT.com to, say, send someone an email when a web-attached device sends IfTTT a "trigger".
But that's all written up for you at my tutorial about getting started with the brilliant, free, If This Then That service!
Once you have the skills and fundamental "bits" (like your own (free) IfTTT.com account), here's the next step.
This tutorial assumes you already have something like the ESP8266 discussed in the first tutorial, and that it is set up and online, and able to send the code that by the end of the first tutorial was causing IfTTT to send an email upon your demand, via pressing the SPST switch connected to your ESP8266.
Now.. forgive me for delaying mentioning this... I did say at the outset that what we were going to do was to send a web request to "a web attached 'thing'". So, you have to have a web attached thing, to play with these ideas quickly and easily. It might be an IP cam. It might be an Arduserver. (I have a tutorial about setting up an ESP8266 as an Arduserver. Yes... you would need two of them, I think... one to be the device "pulling" the trigger, one to be the device with the LED responding. Go on... you know you wanted a second ESP8266, anyway. They CAN both be at the same DDNS managed URL!
For the sake of the discussion below, we will assume that your trigger, used previously to cause IfTTT to send the email you set it up to send, is rather curiously called "door_trigger". (An unlikely name, I admit. But it arose through the history of my learning about these things. Sorry!)
That trigger can be left still triggering the emails, if you wish.
But we are going to create a new If This Then That recipe, one that will cause IfTTT to make a web request on our behalf when the trigger is "pulled". For the sake of a simple example, that web request will be the one we use to turn the Arduserver's LED on. (We could either make a second trigger for turning the LED off again, or we could just do that by hand.
In fact "by hand" is a good place to start.
If you paste the following into a web browser, you should get a page full of "stuff"...
If you do, it has come from something that cost $15, would fit in a coffee mug (comfortably), and is on the desk beside me as I write this. (If you don't, it is "down"... not impossible, with a hobbyist's Arduserver, which may have been sacrificed for a new project by now! Or maybe it's having a bad hair day... although I've found them very dependable in some limited testing.
Among the text, unless I've fixed a silly, trivial error, you will find "LED is now on". Which is odd as the result of a "zero" command. If you issue...
... which is the same as before, except for the last character, the webpage will say "LED is now off". Backwards. I know. Sorry. ("1" actually DOES turn the LED on, and "0" turns it off... it is just the message on the webpage which is backwards). Whatever! The main thing is: You can turn the LED on and off. (You have to type the command as shown, by the way. If you put "LED" in the command instead of "led", it will ignore your request.
OR... if you have the knowledge, you could send a web request to an IP Cam, telling it to take a photo, and send it to an FTP server. Anything you can get done by sending a URL from a browser you can get done by IfTTT in response to whatever trigger you want to specify!!!
Go into your IfTTT account. (Remember... I told you this essay assumes you've completed what's in my first IfTTT tutorial.)
From there go to the "Maker" part of IfTTT... https://ifttt.com/maker.
Click My Applets. Start a new (Maker) applet (you have to click on the little down-pointing chevron, upper right)
Click on the blue "+This" on the (IfTTT!) screen, to access the part where you specify a trigger.
Type as much of "maker" as you need to narrow the options down to...
.. and click on "Maker".
Click on the square with "Receive a web request", which is actually a button, even if it looks like a mere bit of "help" text.
Now! Pay attention, or you will get confused! At this point, you should see...
.. which I think is misleading. We're not so much creating a new trigger/ event as assigning one we made earlier to a new recipe. If you someday try to "create" a trigger, but don't go into the usual pages for setting it up, consider whether maybe you've accidentally entered the name of an existing trigger. (You can change the specs of what a trigger does... just not here!)
So... fill in "door_status", or whatever the trigger you made for the first tutorial is called. And click "Create Trigger". (You could, and probably will, in the future, make a new thing at this step. But we don't need to for the sake of this first exploration of the ideas we're working on here. So we'll use a bit of our previous work. A tested, debugged, etc bit.
That brings you back... almost... to the "If +This Then That" page... but this time, it is the "That" which is in blue, with a "+" in front of it. Click on it.
You come to a page headed "Choose Action Service". You are being given the chance to say what the "That" will be for this "If this then THAT" recipe!
Do what you did before to get down to "Maker" (Not WeMo Maker, not MeetThyMaker... just "Maker".)
That gives rise to something like the "Receive a web request" page, only this time the rather dull button's text starts "Make a web request".
Click on that, to go into the page where you supply the details of the request you want to go out.
For URL, if you want to affect the LED of my Arduserver, you fill in...
(I hope you have your own... they're easy enough to set up, and Arduservers exist primarily as an exercise to teach the BASICS of stuff that is very relevant to what you are wanting to be able to do, if you've read this far.)
Method: I'm not quite sure what this "ought" to be... but "post" works!
Content type: I'm not quite sure what this "ought" to be... but "application/json" works!
Body: Leave this field empty.
Click "Create Action". Click finish.
That's it! Baring typos, etc, IfTTT now has a new recipe which will be triggered by the same event that triggered the sending of emails by the end of the first tutorial. Now the trigger will still send an email, unless you've turned that recipe off, but it will also issue the LED changing command.
"Check now", by the way, doesn't cause the recipe to run. I think it is more about testing whether the recipe is put together properly.
"But!...", I hear you ask. "Why involve IfTTT??? Why not just send the URL directly to the device you want controlled? You need something that can send to the internet in order to send the message that "pulls" the trigger at IfTTT. Why don't you just send direct to the Arduserver what you've set IfTTT up to send?
The answer is: You could!.
What we've done here could be done with that simpler, fewer- things- to- got- wrong route.
This exercise was just to get you started. To show you some of the steps. While you could do what we've done without IfTTT, that will not always be the case. And now you have the tools to use IfTTT to send web requests when you want to!
If you visit 1&1's site from here, it helps me. They host my website, and I wouldn't put this link up for them if I wasn't happy with their service.
Click here to visit editor's Sheepdog Software (tm) freeware, shareware pages.. Material on this page © TK Boyd March, 2016
Click here to visit the homepage of my biggest site.
Click here to visit the homepage of Sheepdogsoftware.co.uk. Apologies if the "?FrmAht" I added to that link causes your browser problems. Please let me know, if so?
Click here to visit editor's pages about using computers in Sensing and Control, e.g. weather logging.
Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org
....... P a g e . . . E n d s .....