IFTTT Maker

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

IFTTT Maker

#1 Post by namirda » 07 Apr 2016, 23:40

I have seen a few requests for the option to send push notifications directly from ESPEasy.

The best way to do this is to use an external utility like MQTTWarn running on the same machine as your MQTT broker - but then you need to have MQTT running. If you don’t want to use MQTT then it is quite possible for ESPEasy modules to send push notifications directly using the popular package IFTTT (IF This Then That) – my plugin IFTTTMaker does just that.

It is a very simple plugin which sends a trigger to IFTTT when sensor readings exceed specified limits.

If you want to give it a try, download the plugin 'IFTTT Maker' from the ESPEasyPlayground.

https://github.com/ESP8266nu/ESPEasyPluginPlayground

You will need to download two files - _P209IFTTTMaker.ino and Extra_Utilities.ino. Make sure you take the latest version of Extra_Utilities.ino as I have added a couple of functions recently. Copy those two files to your project folder and recompile/upload.

The configuration screen for IFTTTMaker looks like this:

Image

You will need to provide your IFTTT Key and the IFTTT Event name as the two main parameters. The IFTTT Key is a unique string which identifies you to IFTTT and the Event Name is the name of the trigger which you will send to IFTTT.

‘IFTTTMaker’ can monitor up to 4 sensor values – the example shown above only monitors two. The standard parameter Delay specifies how often the values are checked.

The first field is the name of the sensor value in the form [%tskname%#%valname%]. The second and third parameters are the lower and upper limits and the last is the hysteresis. Thus, in the case of the examples above, a single trigger event called “ESP01” will be sent to IFTTT when [DHT22#Temperature] goes above 25 degrees. Once the trigger has been sent, so long as the temperature remains above 23 (Upper Limit – Hysteresis) no further triggers will be sent. If the temperature drops below 23 and then again rises above 25 then another trigger will be sent.

The IFTTT interface allows three data values to be sent to IFTTT along with the trigger. I have specified these as:

Value1 - the Identifier such as [DHT22#Temperature]
Value2 - the current value of the temperature
Value3 - a concatenation of the Lower and Upper Limits in the form [LL/UL].

Before using this plugin, you must log onto your IFTTT account and make a ‘recipe’ to tell IFTTT what you would like it to do when it receives your trigger. As an example, I have made a ‘recipe’ where IFTTT sends a PushBullet note to my phone – here is what the ‘recipe looks like:

Image

Now, whenever my temperature goes above 25 degrees, I receive a PushBullet note like this:

Image

You can configure IFTTT to do a huge range of different things when it receives your trigger – but please heed the warning below.

Security Warning. I originally tried to make this plugin use the WiFiClientSecure library so that communication with IFTTT was secure using HTTPS. Unfortunately I did not succeed. The WiFiClientSecure library is just too big and although it works in a simple test sketch, it crashes when built into a larger framework like ESPEASY. I was therefore forced to use the simple WiFiClient library and communicate with IFTTT using HTTP on port 80 - I am slightly surprised that IFTTT accept this sort of traffic but for now they do.

This means that your IFTTT Key is wide open to anybody who wants to snoop into your network traffic. This may not be an issue if all you do with IFTTT is send PushBullet notes to yourself - but if you use it to control your domestic heating or cook your dinner then you might get some unpleasant surprises! Take care.

If you find a way to get WiFiClientSecure to run in ESPEASY then I would like to hear about it!

Please let me know how you get on with this plugin.

N

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#2 Post by rajbadri » 08 Apr 2016, 07:14

how to get device identifier for device doorbell ?
Screen Shot 2016-04-08 at 10.41.57 AM.png
Screen Shot 2016-04-08 at 10.41.57 AM.png (82.65 KiB) Viewed 32845 times

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: IFTTT Maker

#3 Post by namirda » 08 Apr 2016, 07:36

I suppose the value of [doorbell#switch] changes from 1 to 0 when the doorbell button is pressed?

If that is the case then you could set the lower limit to 0.5 and the upper limit to 1.5 with a hysteresis of 0.2.

This would send a trigger event called 'button' to IFTTT.com each time your doorbell button is pressed.

You must log onto your IFTTT account and make up a 'recipe' to tell IFTTT what you would like it to do when it receives that trigger event.

N

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#4 Post by rajbadri » 08 Apr 2016, 19:43

works perfectly with my sonoff switch and my pir motion sensor
Screen Shot 2016-04-08 at 11.10.44 PM.png
Screen Shot 2016-04-08 at 11.10.44 PM.png (76.64 KiB) Viewed 32817 times

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#5 Post by rajbadri » 08 Apr 2016, 19:48

i am unable to make it work with this esp device controlling my door lock , doorbell and reed sensor
Screen Shot 2016-04-08 at 11.16.19 PM.png
Screen Shot 2016-04-08 at 11.16.19 PM.png (93.36 KiB) Viewed 32816 times

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: IFTTT Maker

#6 Post by namirda » 08 Apr 2016, 22:00

You are only checking the value every 30 seconds - it's quite possible that you are simply missing the event.
N

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#7 Post by rajbadri » 09 Apr 2016, 05:27

yesterday i did a lot of testing with your plugin with a variety of esp8266 modules and found that the modules become quite unresponsive after i compile the image using IFTTT plugin. The ping times which are normally in single digits increase to 300-400. After i removed the plugin and recompiled the image the modules became normal and the ping times returned to single digits.

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: IFTTT Maker

#8 Post by namirda » 09 Apr 2016, 06:57

That's strange. I have tried the same ping checks here and see no difference whether IFTTT Maker is included or not.

Image

IFTTT Maker is a very simple plugin and I can't see any reason why it should overload your esp - unless perhaps you are using a very short Delay?

N

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#9 Post by rajbadri » 09 Apr 2016, 08:28

yesterday what i first marked was my sonoff switches were behaving erratically. when i use to switch them on / off from domoticz the were responding erratically. As soon as i recompiled without the ifttt plugin they started working normally.

i will try again today with new esp's

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#10 Post by rajbadri » 09 Apr 2016, 08:33

i want to connect my doorbell esp to ifttt plugin. when i am keeping a delay of 5 seconds or more the notifications does not trigger. As the doorbell triggers the esp8266 for about a second or less. what delay should i keep in the settings ? when i am keeping the delay for less than 5 seconds the esp becomes almost unresponsive.


Thanks

5ko
Normal user
Posts: 33
Joined: 03 Jan 2016, 17:58
Contact:

Re: IFTTT Maker

#11 Post by 5ko » 10 Apr 2016, 11:52

Very good plugin...Thanks...Works, nice job.
Congratulate. :)

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: IFTTT Maker

#12 Post by namirda » 10 Apr 2016, 12:24

@rajbadri

On one of my esps I reduced the delay down to 2 seconds without problems but it is true that the esp is becoming fully loaded at that point - I have about 80% load with a 2 second delay ( and 6 other plugins running) which is too high. When I wrote this plugin I was thinking about checking sensor readings like temperature where a typical delay might be 60s - I was not thinking about pushbuttons!

Is there any way you can make your button trigger the esp for longer? Doesn't the "Switch Input" plugin allow you to input pulses of different lengths?

I can certainly improve the efficiency of the IFTTT plugin which may help - but I doubt whether it will ever suit your application unless you can extend the pulse length somehow.

N

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: IFTTT Maker

#13 Post by namirda » 11 Apr 2016, 08:19

I have just uploaded a new version with a few bugs removed - it runs much lighter now.

if you want to try it, please re-download the revised version of Extra_Utilities.ino as well.

@rajbadri - I think you could try your doorbell again with this new version - it can handle a delay of 1 second without problem

N

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#14 Post by rajbadri » 11 Apr 2016, 18:37

:D will try

thanks

namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Re: IFTTT Maker

#15 Post by namirda » 11 Apr 2016, 23:50

I have made yet another change to this plugin to match the changes made recently in ESPEasy R99. Update available in playground.

N

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#16 Post by rajbadri » 13 Apr 2016, 07:52

Works with everything requiring 5 sec delay or more. But does not run with doorbell which requires 1 sec delay. also it still jacks the load to 100% @ 1 sec delay.

User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

Re: IFTTT Maker

#17 Post by rajbadri » 13 Apr 2016, 20:18

currently using espeasy --> Thingspeak ----> Pushingbox to get notifications on my smartphone.

doxikus
Normal user
Posts: 57
Joined: 22 Sep 2015, 08:47

Re: IFTTT Maker

#18 Post by doxikus » 17 Dec 2016, 08:53

Hi all,

Can someone confirm that this plugin work, recently iftt made some changes and when I create recipe and test it trough browser on ifttt.com it works, but when I create task under ESP I cant get mail notification.

One more ting, IFTTT Key: field accept only 24 characters, my key is much longer!? Maybe there is a problem.

Thanks
esp.jpg
esp.jpg (111.91 KiB) Viewed 22709 times

Enferax
New user
Posts: 1
Joined: 08 Mar 2017, 22:42

Re: IFTTT Maker

#19 Post by Enferax » 09 Mar 2017, 18:03

For everyone running into the same problems as doxikus. Just open the _P209_IFTTTMaker.ino and change the lines



string += F("<TR><TD>IFTTT Key:<TD> <input type='text' size='40' maxlength='24' name='APIKey' value='");

strncpy(Template[0].Ident, WebServer.arg("APIKey").c_str(), 24);

Just change the 24 into something so the key fits.



Greetings Enferax

doxikus
Normal user
Posts: 57
Joined: 22 Sep 2015, 08:47

Re: IFTTT Maker

#20 Post by doxikus » 14 Mar 2017, 23:40

Hi

Tnx Enferax, I will try with this solution, post back after I have test it.

NetEye
Normal user
Posts: 51
Joined: 22 Jun 2016, 00:48

Re: IFTTT Maker

#21 Post by NetEye » 03 Apr 2017, 09:21

Hello,
I'am trying to make an burglar alarm work with my ESPEasy.
Burglar alarm.jpg
Burglar alarm.jpg (609.94 KiB) Viewed 21832 times
In ESPEasy it generates an Valua 0 in rest and an 1 in alarm situation.
I configurated your IFTTT Maker as in your description.
22 string key found at https://ifttt.com/maker_webhooks (the digits shown here as dots at https://maker.ifttt.com/use/......)
I installed IFTTT on my iphone and pc.
I chose for Pushbullet and installed it also.
I tested 4 applets and nighter of them worked yet
1st and 2nd: as trigger IFTTT (chosen: "new service activated by you") and as actioner 1 with SMS en the second applet with Pushbullet)
3rd and 4th: as trigger Button widget and as actioner 1 with SMS en the second applet with Pushbullet).
There is still something wrong in my thinking, can you please help me to make this work?
Regards
Jan

goczen
New user
Posts: 3
Joined: 21 Oct 2016, 18:25

Re: IFTTT Maker

#22 Post by goczen » 20 Sep 2017, 13:28

Hi
The IFTTT key length has been changed. Actually it is 43 characters.
Could you change your solution?
Norbert

daxkamala
Normal user
Posts: 15
Joined: 17 Aug 2016, 09:12

Re: IFTTT Maker

#23 Post by daxkamala » 07 Oct 2017, 14:47

Just a thought, would the pulse counter not work for the doorbell?
It might still take 5 seconds to read the single pulse but should be reliable.

Iv'e been using the pulse counter plugin for a water meter and it seems spot-on.

Carlini
Normal user
Posts: 16
Joined: 09 Apr 2017, 17:45
Location: Brazil

Re: IFTTT Maker

#24 Post by Carlini » 12 Jan 2018, 12:35

Hi

Is it possible to send by email the value of the esp %ip% using the IFTT Marker and plugin "Extra Utilities" and "_P209_IFTTTMAKER" ?

thanks

Carlini

Geoffers
New user
Posts: 1
Joined: 03 Jul 2018, 14:42

Re: IFTTT Maker

#25 Post by Geoffers » 03 Jul 2018, 16:26

Firstly, thank you to everyone involved in making ESP_Easy what it is. I've not long been using it and it is fantastic.

I'm having the same issue - I just can't seem to get it to send to ifttt under rules.

I've tried every combo I can think of. e.g.:

on extrearpir do
SendToHTTP,maker.ifttt.com,443,/trigger/ExtRearPir/with/key/MYKEY
endon

There are no errors in the log and it appears to respond ok:

6683213: EVENT: extrearpir
6683219: ACT : SendToHTTP,maker.ifttt.com,443,/trigger/ExtRearPir/with/key/MYKEY
6683232: Command: sendtohttp
6683234: EVENT: extrearpir Processing time:21 milliSeconds
6691848: WD : Uptime 112 ConnectFailures 0 FreeMem 19352
6702705: EVENT: Clock#Time=Tue,15:19
6702711: EVENT: Clock#Time=Tue,15:19 Processing time:5 milliSeconds

If I send :
https://maker.ifttt.com/trigger/ExtRear ... /key/MYKEY (it seems to have truncated this line but you can see the url in the browser)
directly from any browser it works fine.

Just to add, I've tried with a space instead of the comma after sendtohttp, space with a comma, etc. as there seems to be a few opinions on format. I'm more than happy to be called a dope and got it completely wrong.

I would be very grateful for any ideas.

Thank you.

Carlini
Normal user
Posts: 16
Joined: 09 Apr 2017, 17:45
Location: Brazil

Re: IFTTT Maker

#26 Post by Carlini » 08 Jul 2018, 16:01

Dear namirda

Do you have a New Version of Plugin IFTTT MAKER for espeasy 2.0 ?

tks

Carlini
Normal user
Posts: 16
Joined: 09 Apr 2017, 17:45
Location: Brazil

Re: IFTTT Maker

#27 Post by Carlini » 21 Oct 2018, 01:26

Try this

SendToHTTP maker.ifttt.com,80,/trigger/YOURS_IFTT_TRIGGER/with/key/YOURS_IFTT_KEYS

In my case works very well.



Geoffers wrote: 03 Jul 2018, 16:26 Firstly, thank you to everyone involved in making ESP_Easy what it is. I've not long been using it and it is fantastic.

I'm having the same issue - I just can't seem to get it to send to ifttt under rules.

I've tried every combo I can think of. e.g.:

on extrearpir do
SendToHTTP,maker.ifttt.com,443,/trigger/ExtRearPir/with/key/MYKEY
endon

There are no errors in the log and it appears to respond ok:

6683213: EVENT: extrearpir
6683219: ACT : SendToHTTP,maker.ifttt.com,443,/trigger/ExtRearPir/with/key/MYKEY
6683232: Command: sendtohttp
6683234: EVENT: extrearpir Processing time:21 milliSeconds
6691848: WD : Uptime 112 ConnectFailures 0 FreeMem 19352
6702705: EVENT: Clock#Time=Tue,15:19
6702711: EVENT: Clock#Time=Tue,15:19 Processing time:5 milliSeconds

If I send :
https://maker.ifttt.com/trigger/ExtRear ... /key/MYKEY (it seems to have truncated this line but you can see the url in the browser)
directly from any browser it works fine.

Just to add, I've tried with a space instead of the comma after sendtohttp, space with a comma, etc. as there seems to be a few opinions on format. I'm more than happy to be called a dope and got it completely wrong.

I would be very grateful for any ideas.

Thank you.

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests