Google Assistant responds but Blynk DOESNOT work

I integrated Google Assistant with Blynk App using Webhooks.
When I say “turn LED on”, it reponds “turning LED on”. But actually it doesn’t turn on led.
I used the url for web hook “http://188.166.206.43/jyBKmVIc4lcdQqbxtQhV86tXnIoDIQ/update/V3” (without quotes).

My code is given below:

#define BLYNK_PRINT Serial
 
#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.

// Go to the Project Settings (nut icon).

char auth[] = "_jyBKmVIc4lcdQqbxtQhV86t_XnIoDIQ";
 
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "my_wifi";
char pass[] = "my_password";

int LED = LED_BUILTIN; // Define LED as an Integer (whole numbers) and pin D4 on Wemos D1 Mini Pro

void setup()
{
  // Debug console
  Serial.begin(115200);
  pinMode(LED, OUTPUT); //Set the LED (D8) as an output
  Blynk.begin(auth, ssid, pass);

}

void loop()
{
  Blynk.run();
 
}
 
// This function will be called every time button Widget
// in Blynk app writes values to the Virtual Pin V3
BLYNK_WRITE(V3) {
 int pinValue = param.asInt(); // Assigning incoming value from pin V3 to a variable
 if (pinValue == 1) {
    digitalWrite(LED, HIGH); // Turn LED on.
  } else {
    digitalWrite(LED, LOW); // Turn LED off.
 }
}

I think code is correct and it actually works with Blynk App. When I press button in my Blynk Project, it turns on the led, but doesn’t work with Google Assistant and IFTTT.

Help please!

In future, please use triple back-ticks around your code (```), this makes it easier for others to read.

1 Like

Could I possibly ask you to check your setup against this?

You could also check that your project works, by assigning a button in the app, on pin V3 - this would simulate the google assistant working correctly.

I did that. I added a button in my project on pin V3 and it works when I push the button.
The problem is with web hook. Even google assistant responds, “Led Turned On”, but it actually doesn’t turn the led on.

Could you show your web hook code?

Have you included the ‘on value’ in the body of your request?


Here, check this out. This is my IFTTT applet!

https://blynkapi.docs.apiary.io/#reference/0/write-pin-value-via-get/write-pin-value-via-get?console=1

Use GET instead of PUT. Body should be empty. Double check your auth token is correct.

Use the URL in your web browser. If it works there it should work with IFTTT.

Webhook should not be needed.

1 Like

Annotation%202019-07-31%20002214
It’s saying invalid token. The token I received in my email was exactly this one.

Check it against the one in the app

In your code you said

_jyBKmVIc4lcdQqbxtQhV86t_XnIoDIQ

The one in the url is missing the underscore?

It should look something like this (using the auth token from your initial post). Double check your auth token. Maybe try refreshing it, and using the new one in your code/IFTTT.

http://188.166.206.43/jyBKmVIc4lcdQqbxtQhV86tXnIoDIQ/update/V3?value=1

The auth code you’ve used in your code is different to the one you’ve used in your IFTTT recipe.

Pete.

I removed underscores to check if it works without underscore. Actually, I used the same token as provided in the email(with underscore).

refresh the auth code and try again.

How did you get the IP address of the Blynk server?

Pete.

Not working.
https://blynkapi.docs.apiary.io/#reference/0/write-pin-value-via-get/write-pin-value-via-get?console=1 is showing my token is invalid. Why is it giving Invalid Token error?

@PeteKnight I pinged blynk-cloud.cc

@Toro_Blanco Tried Again. Google Assistant gives the correct response. IFTTT shows applet worked! But actually it doesn’t turn the led on.

Because the auth token is probably incorrect. I could be wrong, but I do not believe an auth token should have an underscore. Or at least none of the ones I have ever received have.

Like I said refresh it and update your code, and try again. Cut and Paste it from the email to ensure you are not accidentally excluding a character.


I used the same auth token