bobli
March 27, 2016, 7:45pm
1
Hello
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 :
download the plugin https://play.google.com/store/apps/details?id=com.freehaha.restask&hl=en
open tasker, new task, click the “+”, plugin, then “RESTask”
click the pen
request type : PUT
host : http://cloud.blynk.cc/your_token/pin/D1 (for real pin)
or http://cloud.blynk.cc/your_token/pin/V1 (for virtual pin)
enable “custom body”
custom body : if you want to activated pin : [“1”]
if you want to deactivate pin: [“0”]
Go to “header tab”
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
3 Likes
bobli
March 29, 2016, 6:42pm
2
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 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.
bobli
March 29, 2016, 7:41pm
5
it doesn’t work
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
bobli
March 29, 2016, 7:53pm
7
okay thanks, after loading the server file in the plugin, it works with ssl
will this certificate expire anytime soon ?
zeeko
March 30, 2016, 1:44am
9
@bobli Awesome tutorial… Can you give a couple examples of how/why this would be useful?
bobli
March 30, 2016, 11:42am
10
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
RaPo
March 30, 2016, 2:06pm
11
Some time back I read blynk restfull API works only with local server.
Is it now works with the cloud server also ?
Costas
March 30, 2016, 2:10pm
12
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?
M3W4N
May 21, 2016, 6:27am
14
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.
bobli
May 22, 2016, 7:18am
16
if you put data, it’s normal to receive 200 as a response.
M3W4N
May 29, 2016, 7:26am
17
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.
M3W4N
May 29, 2016, 7:57am
18
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
bobli
May 29, 2016, 10:32pm
20
you should try to get it working without ssl first
1 Like