Blynk webhook to ThingSpeak

Try this, add a button and assign it to virtual pin V1, now when you click the button it should trigger the webhook.

After adding the following code and button in Blynk interface, the device is disconnected from Blynk very often until no measurement is made.

{
  int webhookStatus = param.asInt();
  Serial.println("Webhook status is: " + String(webhookStatus));
}```

All you need is

Blynk.virtualWrite(V1,1); 

To trigger the webhook

I have tried to use button to write 1 to V1, and disable the sensor measurement. It doesn’t work either.

How did you configure your datastream ?
Post a screenshot please.

Here you go John.


V1 to V4 is what I need to push to ThingSpeak.

Try this

Blynk.virtualWrite(V1,1023); 

Have done so. No difference.

Are you assuming that the /pin/ on the end of the URL will be replaced with the value that you send to V1?

If so, what part of the Blynk IoT webkook documentation led you to believe that this is how to do that?

Pete.

Yes, that is my understanding that the value of /pin/ will be replaced with V1, and send to ThingSpeak.
Is this not the right method? As webhook does have a few options of get, push, put and delete.

Pete.

I do not. I am referring the web searches and find successful example before.
Blynk App Webhook Multiple Values to Thingspeak - Need Help With My Project - Blynk Community
and this
blynkkk.github.io/webhook.md at master · blynkkk/blynkkk.github.io · GitHub

These are examples for the Blynk Legacy webbook widget, which works in a totally different way.

Also, the webhook in Blynk IoT doesn’t currently return any values to the trigger pin, so this:

wouldn’t work if it was part of the BLYNK_WRITE(V1) callback, and certainly won’t work in the way that you appear to have used it.

Also, one think that you seem to be overloking is that Blynk IoT is limited to making just one webhook call per minute, which could be affecting your testing results significantly.

I haven’t used the Blynk IoT webhook - if I was going to make those external API calls from an ESP device then I would prefer to do that as an API call directly in the sketch - but looking at the documentation and the webhook interface screen in the console, I would assume that you would need to add dynamic data such as "{device_pinValue}" to include the value of a virtual pin in the API call.

Pete.

It does. If the response has a body.

As Pete, suggested, “/pin/” should be replaced with “{device_pinValue}”. But “test webhook” still may not work for this use case. We’ll fix it in the next release. But real value should work as expected.

Apologies, I missed that in the 10.02.2022 release announcement.

I looked at the documentation and it want really clear how to use these parameters. Maybe the documentation needs refreshing with the info about the webhook now returning the values, and some examples of how to embed the virtual pin values into the API call?

Pete.

1 Like

Agree. Checked the doc, it’s very unhelpful.

1 Like

Good day,

I have the same problem, where can I find the current documentation.

“/pin/” should be replaced with “{device_pinValue}”

it didn’t help me.

Thank you Pavel

Good day,

so i managed to write one value

https://api.thingspeak.com/update?api_key=xxxxxxxxxxxx&field1={device_pinValue}

in the old Legacy, I sent 4 values to the port at once and then wrote them like this

https://api.thingspeak.com/update?api_key=xxxxxxxxxxxx&field1=/pin[0]/&field2=/pin[1]/&field3=/pin[2]/&field4=/pin[3]/

I can’t use this url in nove Iot

https://api.thingspeak.com/update?api_key=xxxxxxxxxxxx&field1={device_pinValue}&field2={device_pinValue}&field3={device_pinValue}&field4={device_pinValue}

does the new blynk support writing multiple values at once?

If so, can you send me what the correct chain for writing should look like?

Thank you Pavel

@Puls hello, currently not supported. I’ll create internal ticket to improve that.

Hello, is there some new update?
I created more webhooks to update values on ThingSpeak but it’s not good way, I wan’t to send all values in one GET response as it was possible in legacy Blynk…