[TUTORIAL] Blynk and Tasker

Hello :slight_smile:

Here is a tutorial on how to bind tasker and Blynk, via the restfull api http://docs.blynkapi.apiary.io/#reference

we will use a plugin called RESTask

we will fist cover how to write data :

  1. download the plugin https://play.google.com/store/apps/details?id=com.freehaha.restask&hl=en
  2. open tasker, new task, click the “+”, plugin, then “RESTask”
  3. click the pen
  4. request type : PUT
  5. host : http://cloud.blynk.cc/your_token/pin/D1 (for real pin)
    or http://cloud.blynk.cc/your_token/pin/V1 (for virtual pin)
  6. enable “custom body”
  7. custom body : if you want to activated pin : [“1”]
    if you want to deactivate pin: [“0”]
  8. Go to “header tab”
  9. click “add more”
    10 : name : Content-Type
    value: application/json

you can check if your program work by clicking the play triangle, if it works, click the save icon and enjoy !

if you want to read data, you have to change:
step 4 : it will be “get” instead of “put”, and at
step 6: you have to uncheck the custom body

Your data will be stored in the tasker variable %rtres

ps : if you want to add more security between your phone and the server, check the discussion under this post :wink:

3 Likes

Does the restfull api support SSL ? I’m trying to make the connection between the phone and the server a bit more secure, but https://cloud.blynk.cc/your_token/pin/D1 (notice the httpS) doesn’t work :frowning: any idea ?

I think it’s a certificate problem. @Dmitriy, could you look into this?

@bobli should be

https://blynk-cloud.com/your_token/pin/D1

Also have in mind we use at the moment self-signed certificates.

it doesn’t work :frowning:

My tasker plugin have an input field for custom certificate, could you maybe give me the custom certificate ?

edit : in fact it works in my browser but not in the tasker plugin… this is strange

You can find one here: https://github.com/blynkkk/blynk-library/tree/master/scripts/certs

2 Likes

okay thanks, after loading the server file in the plugin, it works with ssl :slight_smile:

will this certificate expire anytime soon ?

in 5 years =) I think

2 Likes

@bobli Awesome tutorial… Can you give a couple examples of how/why this would be useful?

if you have a garage door opener with
blynk, you can :

  • put tasker shortcut on your home screen to open your door without launching the blynk app

  • make a gps trigger on your phone, so your garage door open when you come in front of it

  • using zooper widget, you could make an homescreen widget to display usefull information (like the garage door state) on your home screen

Some time back I read blynk restfull API works only with local server.

Is it now works with the cloud server also ?

Yes it works with the cloud now.

1 Like

Would “https://blynk-cloud.com/your_token/pin/D1” also work for the IFTTT Maker channel?

I have tried this method many times and i even downloaded the server certificate along with the https://blynk-cloud.com:9443/your_token/pin/D1 as the host .
But i keep getting an error that looks like this. any help would be much appreciated.

Not sure if this has anything to do with it but when the esp8266 is connecting, serial monitor shows Connecting to cloud.blynk.cc:8442

What error do you get? Also you may use https://blynk-cloud.com/your_token/pin/D1 now.

if you put data, it’s normal to receive 200 as a response.

That is what i thought as well… So its definitely not an error.
But no matter what i do i cannot seem to set D1 high or low.
This is a full screen screenshot of my RESTask plug in screen. could you kindly have a look and let me know what is wrong with it.

I’ve tried that too…Just doesn’t seem to work…No matter what i do, i cant set any of my pins high or low. It works fine through the Blynk app though

@M3W4N does url works for you from browser?

1 Like

you should try to get it working without ssl first

1 Like