BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Problem with Google Assistant triggering a webhook

Hi There,

I have same problem with IFTTT + Webhooks and Google Assistant.

There are few topics that explain how this should be done, still I can’t get google to actually run the webhooks, even if she says: “Ok, performing action”.

This is the workflow: Google Home --> IFTTT (GoogleAssistang+Webhook) --> Blynk --> NodeMCU(ESP8266) --> Shutter

From Blynk everything works fine, both using the app or the URL:
http://cloud.blynk.cc:8080/xxxxxxxxxxxxxxxxxxxx/update/V1?value=1

When I tell google to open my shutter she says: “Ok, performing action”, but nothing happens, it doesn’t really send the Webhook.

Here is how the IFTTT applet looks like:

Just in case, this is the sketch:

#include <dummy.h>


#define BLYNK_PRINT Serial
#define UP  D5
#define DOWN  D6
#define LED  D4

#define GPIO15  D8

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxx";
char pass[] = "xxxxxxx";

void setup()
{
  // Debug console
  Serial.begin(9600);
  Serial.setDebugOutput(true);

  Blynk.begin(auth, ssid, pass);
  Serial.println("Hello Connected to WiFi");

  pinMode(UP,OUTPUT);
  pinMode(DOWN,OUTPUT);
  pinMode(LED,OUTPUT);
  pinMode(GPIO15,OUTPUT);
  
  digitalWrite(UP,HIGH); // Set UP and DOWN HIGH so the remote doesn't activate on start IN
  digitalWrite(DOWN,HIGH);
  //digitalWrite(IN,HIGH);
  digitalWrite(GPIO15,LOW); // Set this to Low in case it draws excess power
  digitalWrite(LED, HIGH);
}

BLYNK_WRITE(V1) //UP button press on Blynk app
{
  int V1Value = param.asInt(); // assigning incoming value from pin V1 to a variable

  if (V1Value ==1 ) //Virtual pin is high
  {
    Serial.println(V1Value);
    Serial.println("UP button");
    Blynk.virtualWrite(V1, HIGH);  //we force this high, to give feedback on the app button press.
    digitalWrite(UP,LOW); 
    digitalWrite(LED, LOW);
    delay(1000); //This delay results in a button press and hold of a second, to ensure the radio signal is picked up
    digitalWrite(UP, HIGH);
    digitalWrite(LED, HIGH);
    Blynk.virtualWrite(V1, LOW);  //we force this low, as IFTTT via Google will leave it high otherwise.
  }
  else digitalWrite(UP, HIGH); // Clear everything here as the button isn't pressed now
}

BLYNK_WRITE(V2) //DOWN button press on app
{
  int V2Value = param.asInt(); // assigning incoming value from pin V2 to a variable

  if (V2Value ==1 )
  {
    Serial.println(V2Value);
    Serial.println("DOWN button");
    Blynk.virtualWrite(V2, HIGH);  //we force this high, to give feedback on the app button press.
    digitalWrite(DOWN,LOW); 
    digitalWrite(LED, LOW);
    delay(1000);
    digitalWrite(DOWN, HIGH);
    digitalWrite(LED, HIGH);
    Blynk.virtualWrite(V2, LOW);  //we force this low, as IFTTT via Google will leave it high otherwise.
  }
  else digitalWrite(DOWN, HIGH); // Clear everything here as the button isn't pressed now
}

void loop()
{
  Blynk.run();
}

Any clue?

Thx,
clos80

There are three Blynk cloud servers in different geographical locations around the world. Your project and its associated data only exists on one of these servers.
This is usually the server that is geographically closest to you, but that’s not always the case.

When you crate an IFTTT recipe, it runs on a server somewhere in the works, but when the IFTTT executes the webhook call to the Blynk cloud server, there and on three chance that it will hit the server that contains your project.
The solution to this is to specify the IP address of the Blynk server where your project resides.

Open command prompt on your PC and ping blynk-cloud.com and make a note of the IP address. Use this IP address in place of blynk-cloud.com in your IFTTT recipe.

Also, I prefer to use GET rather than PUT (the syntax is different though) and put everything in the URL field and nothing in the Body field.

Pete.

Thanks Peter, that solved the problem!

1 Like