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.
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.
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.
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.