All right, so here is my basic architecture for a temperature triggered
IFTTT so this is what we're doing right so a temperature sensor is writing to my
computer on a CSV file so it's logging temperature data I have a script that's
running that's looking for that temperature and looking to see if the
temperature ever gets above a predetermined threshold if the
temperature ever gets above a predetermined threshold it sends a web
hook to IFTTT service which will then be used to either trigger an email or a
text message so so walk through how this can all be done now so IFTTT is
ifttt.com I'm going to sign in and I'm gonna use
my Google account to sign in so when I sign in if it's the first time you might
be asked to put in a pin that gets sent to your email address but I've done it
before so here I am so what we want to do is create our own applet so click on
this tiny user account right here and say create so the first thing we want to
do is we'll create an email alert if the temperature ever gets so I have TTT if
something whatever the trigger is then do something so our trigger is going to
be the web hook so the trigger is going to be this web hook sent whenever the
temperature is above a threshold so the script on my computer is looking to see
if the temperature is above a threshold when it's above with the threshold it
sends this web hug its senses web hook so my IFTTT is looking for a web hook so
just search for web hook so how did we get here we will click on this create
and then we got to that window search for web hook I'm going to choose web
hook and then when I get to this we want to choose a trigger so we want to
receive a web request and let's give the web request when it comes in it needs a
name so let's call it a temper email trigger so that's the name of the
trigger is the temp email so create a trigger now what do we want to do with
it is there's a number of options we can do
so the first thing we want to try is an email we want to send an email all right
so I want to send me an email so the first time you do it you might be asked
for a pin to verify that email but what we want is here's the subject line
occurred on something web hook service you can change this to whatever you want
I'm just going to say give it a very short alert temperature is above
threshold okay so that's the subject line and in the body what happened event
name what happened damper temperature is currently so what we want is we want to
add an ingredient we'll call it value one degrees Fahrenheit so this
temperature is currently this
temperature has currently this when when did this happen we can add the
ingredient called occurred at so this will give you the date in time at which
this happened and it's all HTML type coded so we'll put a line break there a
line break there so that's it so we've created a subject line that says alert
temperatures above threshold if you want to add let's say at time and then that's
that subject line we'll also have that time and then what temperature is
currently at a particular value and we'll send this ingredient so we're
gonna create that action when this action gets created so this is the
accident created we'll call it finish okay so we've now created actually a
temperature temperature monitoring system which is gonna send us an email
whenever we hit a particular thresholds in order to test it let's go
back to our home so let's go to home we go to home we're gonna see this webhook
we need the particular address of our webhook so let me go to webhook and show
you how to get that address so one thing you want to click click on webhook click
on documentation you click on documentation this is your unique code
this is your unique code the event name is the name that we gave to our that's
the event name temp underscore email so if i want to create a you can do it
using variety of ways create a forum post if you don't do using c URL you can
do that let's create a temp underscore email and the value 1 let's say the
temperature had reached 859 degrees Fahrenheit okay so that's what this
single line see URL looks like we can test it right from here and see if that
actually triggers our triggers our email so I want to pull up my email right here
and I'm gonna hit test it and what I might find is that I have an email web
look alert temperatures about threshold on April 6 2020 at 9:17 p.m. so when I
click on this it says temperatures currently 859 Fahrenheit when that so
that's a succinct message we sent via email ok so again we've looked at how to
do this part so I have TTT with an email alert next we're gonna try and I have
TTT with a text alert but before you start this what you need to do is you
actually need in order to be able to send any a text message you actually
need to we have the IFTTT app installed on your phone so if you are on android
and this works on android I haven't tried it on iOS but it works on Android
so go I've installed this I have TTT app on my phone and I've signed in
with my IFTTT account on my phone so now I can use my phone to send a text
message or IFTTT can use my phone's text messaging service as a way to text any
number that we designate in our web hook in just a second okay so let's let's set
up this branch of it so once I have TTT is installed on your phone and you've
saved it then you let's proceed back to right here let's go proceed back here
now right so I'm gonna create a new web hook and I'm gonna create again a new
trigger and the trigger is again going to be a web hook but instead of doing
and this time I'm going to call it a temper SMS create instead of the service
being email the last time we did email this time we'll do SMS and we get
Android SMS so the action is to send send an SMS from your Android device to
any phone number you specify so we're here let's just first go and see what
message we want to send let's say temperature is up as currently and
ingredient value one that's where we decided we'll put the temperature of
Fahrenheit which is above threshold set
time okay so put the date the temperature and maybe something like
alert temperature is currently a particular value
and then now go ahead and enter your phone number phone number here so that's
what we want to do next is just put in our phone number two whatever number you
want to send you can include only one phone number so entered my phone number
create action and this would take just a second so it created the axe and finish
it up before I move on I also decided to click keep this checked in so not only
does it send me a text message it'll also email me when that alert is
sent out so let me finish so now let's go back to the web hook that I had and
in this time instead of sending it to my email I'm gonna use the web hook I had
set up and I had call it temp SMS by the way so if I go to my home I should see
web hooks to where folks temp email that I sent earlier temp SMS that I just
created so that's the event name I'm looking for so temp SMS and let's change
the value to let's say 923 Fahrenheit so again I'm gonna test it using curl event
has been triggered so let's find out so I just got a beep
on my phone that says damp SMS has occurred and new text message was sent
so let's see if I received that so here you go I see that I received a temp text
message that says the temperature has risen and here is the message I just
received that says alert temperatures currently 923 F which is above set
threshold time April 6 2020 and 9:23 p.m. so that's the message that I just
received by just testing it to using this trigger now okay so we've tested
using world so you can do this directly from the command line you can do an
equivalent from Java or Python I have a simple step taking this
thinking converted it to a simple Python script so I have a very simple Python
script that's basically going to send a different temperature value in this case
I just says thousand 24 I'm gonna hit run so it's basically making that same
request to that my you a specific URL that I have and hit run and so my this
is run so-so and I just got a IFTTT alert on my phone and here it is the
temperature reading is current 2025 which is above set threshold time at
9:31 p.m. so you can use a Python script or JavaScript or something else to send
this web hook to your phone or your email since I had set up my email to go
off as well as my SMS message I should have received an email as well so I have
it there it is so having new alert about the temperature here as well so all
right so that's how you use IFTTT to basically take a temperature reading
that's saved in a log file that gets triggered whenever the temperature is
above a certain threshold