BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Blynk + IFTTT - details Guide how to connect both

enter image description here

hello Blynkers

as the great Blynk team is working on many new features and widgets , and they already promise to provide the push button trigger “as set an icon on your home screen to activate an GPIO on your board” but i think this maybe will take them some time, so tried to use IFTTT to be integrated with Blynk.

also you can use IFTTT to do some Automation based on other service -IFTTT call it channels - you have and that will actuate and change the values of your hardware running Blynk .


examples will be demonstrated.

  1. that can be used for many thing but here i will go for the basic tasks like click the icon to make your D4 GPIO high and that will actuate a relay that will switch on your fan or light.

  2. when your Mobile connect to your home WIFI the entrance light will switch on - assuming you have a MCU board connected to Blynk and has a relay that’s connected to your entrance lights.

  3. please post your ideas in the comments.

that can be used for many thing but here i will go for the basic tasks like click the icon to make your D4 GPIO high and that will actuate a relay that will switch on your fan or light


Requirement:

  1. any exist board that already have Blynk sketch running on it.
  2. IFTTT account
  3. DO Button by IFTTT app installed IOS and Android
  4. Mobile phone with IFTTT app installed IOS or Android.
    that’s all

here we will try the DO Button

  • open your Blynk dashboard that will be connected to IFTTT and write down the token also you need to Know which GPIO or PIN you need to control eather it’s actuall PIN or Virtual.

Please note that token is has to be kept private as any body have your
token can control your Hardware.

  • Open DO App in your phone.
  • Click on the + bar in the top middle.

  • type in the search bar Maker.

  • select the Maker channel and connect it.

  • from Maker channel select make a Web Request.
    -

  • Type Recipe Title like turn Fan ON

  • In URL enter http://cloud.blynk.cc:8080/XXXX your TOKEN XXXX/pin/ZZZ

  • and replace XXXX your TOKEN XXXX with your actual token and ZZZ with the PIN number , for Digital PIN use DX like D1, D5 etc. and for Virtual PIN use VX like V1 ,V5 etc.

note that if you are using any variant of ESP8266 the pin number here
should match the actual GPIO number not as per the board manufacturer
numbering .

  • in Method select PUT to WRITE a value to that PIN.

  • in Content Type select application-json.

  • in body write ["1"] to make the PIN High or ["0"] to set the PIN Low.

  • then click Add button.

  • Now for android go to your home screen and try to add widget and search for DO Button and drag it to the selected place and then select the desire recipe name that you Just configured.

  • test it and enjoy.


Action based on other IFTTT channels.
connect to a specific WIFI SSID will change a PIN level to High or Low

note that if you are using any variant of ESP8266 the pin number here
should match the actual GPIO number not as per the board manufacturer
numbering .

  • in Method select PUT to WRITE a value to that PIN.
  • in Content Type select application-json.
  • in body write ["1"] to make the PIN High or ["0"] to set the PIN Low.
  • then click continue , after that click on finish button.

enjoy Blynking and please leave any notes , comments , new ideas others can do using the great Blynk and IFTTT

11 Likes

Awesome! :pray: Thanks for such a detailed tutorial!

There is only one important detail. The body should be [<<<1>>>]
Otherwise it won’t work (or at least it doesn’t work for me with ["1"]

i have tested ["1"] and working fine for me on Android i didn’t test it on Iphone .

2 Likes

It now works not only for local servers ? It does not work for me . I am trying to change the state of the virtual pin V0.

I also tried to send [“1”].
My token is c275a9c56e054527aa983b88ff47dd2a. Do not worry, I will change my token, when all the work. Can anybody help me?

@VitaliyRomanov are you able to change pin value via CURL or browser plugin? Does your project in RUN state? How long did you wait for action? (IFTTT may have delays up to 15 minutes)

@VitaliyRomanov try it first using Postman chrome plugin after that implement it in IFTTT.

it’s working using Postman i just change your V0 pin status to [“0”]
recheck the IFTTT settings.
note that i never test it using iphone , if that makes difference.

i also tested one of my projects and working fine with IFTTT , below is the screenshoot

great write up! This works the same way on iPhone. I like the DO buttons. They have an Apple Watch app too. When I come home, I just hit the DO button on my watch to turn the lights on :slight_smile:

thanks , glade that you like it.
i have done a great project for an ESP8266 PCB that has 3 relays and a LED RGB strip all that can be controlled using the lovely BLYNK app.
soon i will write up a post when i have the time… stay tuned.

What’s your thought about pressing a momentary button? You can set a button to be a “push” button instead of a “switch” which is the difference between a “momentary” button and a “toggle” button.

I noticed that when I use the API to send a value to a “push” button, the button still retains the high value.

Is there a way to make an API call that would send a momentary value to a push button? Or do we have to make two calls - one 1 and one 0? IFTTT is not tooled to do that, so I was hoping the API might.

in that case , nether Blynk API or IFTTT can handle that right now.
but i think Blynk can change the API which in case you have set the PIN type to Push button that will not retain the status 1.

or you can have Tasker doing that by sending two requests " 1 > 500 ms delay > 0"

1 Like

Yep, I took IFTTT out of the loop right now and am just using Tasker to send REST API calls.

We will release soon Webhook widget, so using tasker also may be unnecessary.

That’s exciting, can’t wait to test it out!

It took me a while realize the url is not working anymore. Can somebody update the post to avoid confusion?
My configuration worked like this:
url http://blynk-cloud.om/token/pin/d0

@macf81 you need to use IP for IFTTT instead of host (until we fix issue) http://docs.blynk.cc/#troubleshooting-geo-dns-problem

sorry i don’t know why the edit option is not working for me it shows me only last two edits and not allow me to change it?!

Hi, i have problem with PUT method. I tested it here> http://docs.blynkapi.apiary.io/#reference/0/write-pin-value-via-put/write-pin-value-via-put?console=1 Result is Invalid token.

When i make in browser GET method http://blynk-cloud.com/xxxxxx449928997129095ae4079/update/V50?value=0
it is OK. and i can change value on V50 pin. But this is not working with DO butoon from IFTTT.

and this format http://blynk-cloud.com/xxxxxxx42c5449928997129095ae4079/update/V50 - Wrong request format.

SOLVED>
I use this in DO and everithing is OK now >

http://46.101.143.225/xxx5742c5449928997129095ae4079/update/V50?value=0

method GET
contnet plain/text

does this works ???/ blynk with ifttt???

Yes. But it is recommended to use IP instread of blynk-cloud.com