I would like to get a text variable from a http request (get) and display it in the app,
in order then to use it with the eventor.
My http request return a single word. I have set up the webhook to get it in “text/plain”
format and put the output in V1. But I see no way to display it.
Am I missing something ?
More generally, can text be in a virtual pin, or VP are only numbers ?
If yes, how to display in the app, without coding the hardware ?
By the way, I have already programmed the ESP8266 to do everything by coding the http request, but I want to see If I can do everything in the app, without coding.
I monitor an electric heater with an ESP8266 and Blynk with the eventor.
In addition, as my electricity fare depends on the day ( peek demand or not)
I want to avoid to use the radiator when the fare is high, which occurs some days in the year.
I can get the condition of the day with a http request at
So I want to use this result in the eventor to decide if I use the heater or not.
I have already coded directly the request, and can retrive and display the result in a blynk app of test, before putting it in my main application, but I saw the webhook widget, and wonder if I could do everything in the app.
In order to perform the web request to the above url you need to trigger the webhook. For that, you need to call regular virtual write on hardware Blynk.virtualWrite(V1, "any value here");;
In order to get the response from the webhook you need to write:
and write the value in the app with V31.
At least I see it works.
As I understand, to use it really in the app, I need to convert it first to integer with
something like
int ipo;
ipo=0;
if (tempo=="BLEU") {ipo=1;}
if (tempo=="BLANC") {ipo=2;}
if (tempo=="ROUGE") {ipo=3;}
and then
Blynk.virtualWrite(V32, ipo);
All this now work, and I should be able to link with the eventor. This is great.
But I do not find it satisfactory. It is just finding a tricky path to go around the normal
behaviour of the app.
I understand that it was not meant to do that, but I do not see why one should
go through the hardware to get the outcome of the http request in the app.
In fact, my full initial code (with everything in the hardware) was not that complicated.
What worried me is that I would have to update all devices with these requests.
I understand that you will add conditions with text in the eventor.
That will be nice, but not as much an improvement as to allow to totally bypass the
hardware.
Best Wishes for the New year.
Jacques
PS : I was one of your kickstarter supporters and really congratulate you for the improvements you made in the past two years.