Webhook

Hey Guys!

I just want to make you a quick question.

For a long time i am trying to make webhook to work but i dont understand how to put it working.

Do you have any example (server and client side) so i can try and mod to fit my needs?

I need my blynk device to make a variable upgrade API…

For example:
When motion detection is triggered will make a digital 1, closing relay. In that case i will make webhook to upgrade a value in a 3rd party server.

I tryed to use the examle in examples.blynk.cc… no success…

Any help please?

Thanks!!!

@Flyingpeter is the 3rd party server running an API?
Is it your own API or someone like Thnigspeak?
Is the server local to you?

I want my Blynk device to make a http request on domoticz to trigger and action…! For example a “get” http request…
I dont know thingspeak… but i guess its the same thing…

For example:

if (var == 1) {
Do: “http://domoticz-server/json.htm?type=command&param=switchlight&idx=12&switchcmd=On”;
}

The reason for that is that i am preparing an alarm system with 433mhz devices. I have a rfxcom transceiver that detects an 433 PIR… and then, with domoticz… i can trigger an alarm notification in my Blynk APP.

However… i have a remote 433mhz PIR that is connected via another arduino… with a XY-MK-5V receiver. It sends to my blynk device a notification… but i would like to centralize everything related to my alarm in my domoticz… thats why i need the http request…

It is useful for example to upgrade via Blynk device a value on another location…in another kind of system. If i can do that… i can make everything in blynk. And IOT =)

Do you understood what i mean?

Is that the real porpose of webhook? Or was a missunderstand of me?

I think I understand and yes that is what Webhook is for.

Is the Domoticz server accessible via the internet or just locally on your LAN?

If it’s only available on your LAN you have 2 options:

  1. Set up a local Blynk server as Blynk’s Webhook widget can’t access your LAN via their Cloud server.

  2. Port forward the Domoticz server so it’s accessible via a WAN.

I am doing everything inside my LAN… but my problem is that i dont understand how do i put it working…!

I go to webhook example in examples.blynk.com

Can you confirm that this should work:

int value;

BLYNK_WRITE(V0)
{
value =param.asInt();
if(value == 1)
{ Blynk.virtualWrite(V1, "adress-to-join");  value = 0;}
}

Can you confirm that a the time i change the state of the V0 value to 1, it will make the http request?

Thank you for you help Costas!

If V1 is your Webhook widget then you have the basics of what’s required.

Try to put as much of the required URL in the Webhook as possible rather than in your sketch.

So from the URL you provided earlier perhaps you would just need to send the String “On”.

I see.
Perfect! I tryed the webhook between 2 blynk devices and it worked like a charm! GREAT!!!

One more question… if I have this thing configured only in the App… like an action to a push button…

My question is… if i trigger the virtual pin… by a condition in the sketch… and then in the sketch something trigger that variable without the interference of the blynk app… will the cloud trigger the http request?

Do you undersrand what i mean?

Yes as long as it’s coded correctly.

@Costas thank you for your support! Its was a great help to me. Sorry to take your time.

I think you should give more emphasis to that thing in the docs of blynk. It really makes blynk (even) mpre powerfull then it is! :wink:

Cheers!