specifiy request type (GET) in SendtoHTTP

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
PeterKatana
Normal user
Posts: 7
Joined: 23 Mar 2020, 00:38

specifiy request type (GET) in SendtoHTTP

#1 Post by PeterKatana » 23 Mar 2020, 00:41

Dear all,

when I want to sent a Http request within the “Rules” tab (not within one of the http controllers) with SendtoHTTP is it possible to specify the type of request (in that case “GET”) ?

I want to set a value in a Blynk display field via the virtual pin:

SendToHTTP blynk-cloud.com,80,/xxxxxxxAPI-Tokenxxxxx/update/V3?value=%val1%

But in that case I need to send the http request as an GET request.

Any help is appreciated !

Br Peter

User avatar
ThomasB
Normal user
Posts: 696
Joined: 17 Jun 2018, 20:41
Location: USA

Re: specifiy request type (GET) in SendtoHTTP

#2 Post by ThomasB » 23 Mar 2020, 02:36

It appears that the SendtoHTTP method used in the rules defaults to HTTP GET. FWIW, I can't find a SendtoHTTP parameter that overrides it.

But perhaps the BlynkGet command (enabled by the Blync controller) is what should be used. I can't find much info on it's usage, but this old Github issue discussion has examples.
https://github.com/letscontrolit/ESPEasy/issues/838

- Thomas

PeterKatana
Normal user
Posts: 7
Joined: 23 Mar 2020, 00:38

Re: specifiy request type (GET) in SendtoHTTP

#3 Post by PeterKatana » 23 Mar 2020, 09:31

Hi Thomas,

thanks for the hint! I also found the Blynk controller but had no idea, how the controller can be used. But now I have an idea.

Br Peter

PeterKatana
Normal user
Posts: 7
Joined: 23 Mar 2020, 00:38

Re: specifiy request type (GET) in SendtoHTTP

#4 Post by PeterKatana » 23 Mar 2020, 10:36

Topic solved.

I used the BlynkGet command in the rules. Took me some time to find out how to address the sensor values in variables (should be in []) but now it works. Only issue is that the blynk server reports the the blynk page is offline - which is wrong because I can write values on the fields.

Thanks a lot Thomas !

TD-er
Core team member
Posts: 2783
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: specifiy request type (GET) in SendtoHTTP

#5 Post by TD-er » 23 Mar 2020, 11:27

Some controllers really need to be set to "check reply".
Maybe that's also needed for Blynk?

PeterKatana
Normal user
Posts: 7
Joined: 23 Mar 2020, 00:38

Re: specifiy request type (GET) in SendtoHTTP

#6 Post by PeterKatana » 23 Mar 2020, 19:20

I will try that out (check reply) !

Thanks

Br Peter

rkgarg20
Normal user
Posts: 12
Joined: 07 Dec 2016, 04:04

Re: specifiy request type (GET) in SendtoHTTP

#7 Post by rkgarg20 » 31 Mar 2020, 23:41

PeterKatana wrote:
23 Mar 2020, 10:36
Topic solved.

I used the BlynkGet command in the rules. Took me some time to find out how to address the sensor values in variables (should be in []) but now it works. Only issue is that the blynk server reports the the blynk page is offline - which is wrong because I can write values on the fields.

Thanks a lot Thomas !
How did you store the Blynkget get value in the variable. I am trying something like this but it does not work. D17 is the analog pin.
On Rules#Timer=1 do
if[BlynkGet 2,1,get/D17]>0
GPIO,2,1
else
GPIO,2,0
endif

rkgarg20
Normal user
Posts: 12
Joined: 07 Dec 2016, 04:04

Re: specifiy request type (GET) in SendtoHTTP

#8 Post by rkgarg20 » 01 Apr 2020, 00:00

Never mind. I did not understand what is the purpose of 2.1 after BlynkGet . Now I got it. It sets the value in second device and first variable which I did not have earlier. After I added the dummy device as second device, I see the blynkget value being set there.

Now I will display the Blynk sensor value on LCD that I will connect to espeasy sensor.

Thanks

rkgarg20
Normal user
Posts: 12
Joined: 07 Dec 2016, 04:04

Re: specifiy request type (GET) in SendtoHTTP

#9 Post by rkgarg20 » 01 Apr 2020, 01:26

Can I use BlynkGet for multiple Blynk sensor. I mea ncan I have multiple Blynk controllers with different controller password and retrieve value from each sensor?
Thanks

rkgarg20
Normal user
Posts: 12
Joined: 07 Dec 2016, 04:04

Re: specifiy request type (GET) in SendtoHTTP

#10 Post by rkgarg20 » 04 Apr 2020, 16:58

i could enter the Blynk password in the Rule and retrieve the values from different Blynk server by modifying C12.ino file.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 14 guests