The analytical power of ThingSpeak™ and MATLAB® allow you to generate filtered, targeted, and specific notifications of channel activity. The external web service IFTTT is a web service that lets you create Applets that act in response to a trigger action. This example shows how to use the React app to trigger an HTTP request to IFTTT in ThingHTTP. The triggered IFTTT Applet then sends a text message.
Channel 379984 logs home temperature values. In this example, you receive a text notification when the temperature falls below 50 degrees, so that seedlings getting ready for the garden in spring are not damaged.
You can set the IFTTT webhooks service to use web requests to trigger an action. The incoming action is an HTTP request to the web server and the outgoing action is a text message.
Create an IFTTT account, or log into your existing account.
Create an Applet. Select My Applets, and then click the New Applet button.
Select input action. Click the word this.
Select the Webhooks service. Enter
Webhooks in the
search field. Select the Webhooks card.
Complete the trigger fields. After you select Webhooks as the trigger,
click the Receive a web request card to continue. Enter
an event name. This example uses
TooCold as the event
name. Click Create Trigger.
Select the resulting action. Click the word that. The
this is now the Webhooks icon. Enter SMS in
the search bar, and select the SMS box.
Select Send me an SMS, and then enter the text
message information. You can pass data about the event that triggered your
message using ingredients. For example, including
Name}} adds the event name to your text message. Click
Create action to finish the new Applet.
Retrieve your Webhooks trigger information. Select My
Applets > Services, and search for
Webhooks. Select Webhooks, and
then click the Documentation button. You see your key
and the format for sending a request. Enter the event name. The event name
for this example is
You can test the service using the test button or by pasting the URL into your browser. The IFTTT event trigger is not always instantaneous. Now create a ThingHTTP to complete the trigger request.
The ThingHTTP app lets you trigger predefined HTTP requests with an API key and a GET request from the web or from a device. This example shows how to use ThingHTTP to trigger Webhooks at IFTTT.
Choose Apps > ThingHTTP, and select New ThingHTTP.
Edit your ThingHTTP settings.
Choose a Name.
Enter the URL from the Webhooks documentation. The URL for this example has the form https://maker.ifttt.com/triigger/toocold/with/key/xxxxxxxxxxxxxxxxxxxxxx.
For Method, enter GET.
Save the ThingHTTP. Now create a React to trigger this ThingHTTP based on your channel data.
The React app can evaluate your ThingSpeak channel data and trigger other events. Create an instance of the React app that triggers when the house is too cold. Choose Apps > React, and then click New React.
Choose a Name.
Select On Data Insertion for Test Frequency.
Choose your temperature channel for the Condition.
Select the appropriate field, in this case Field 1.
Set the requirement to is less than.
Set the temperature level, in this case 50.
Select ThingHTTP as the Action, and choose the name of the ThingHTTP you defined previously.
In Options, choose Run action each time condition is met.
Once the temperature in the channel reaches the set point for your React, you receive a text message on your device.
If you do not receive the text message, you can try activating each component separately.
Trigger Webhooks at IFTTT from your browser. Copy the address from the Webhooks documentation to your browser address window, you can trigger the event directly. If successful, IFTTT replies with "You have successfully triggered the TooCold event!"
Trigger your ThingHTTP using a REST API call. The format for the call is available on the help pane after you edit and save your ThingHTTP. Your ThingHTTP has a unique API key.
Trigger your React by writing data to your channel which fits the conditions specified in your React. For this example, you can write a temperature of 49 degrees to field 1.