Blynk with IFTTT and Google Assistant

First I want to say thanks to each of you that helped me through this. It is now working. Hear is the changed code as well a screen of the changes i made on the webhook in case anyone else runs into this and is looking for the answer.

Again, thanks so much!!

int outputPin = 4;
int inputPin = V1;


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

  Blynk.begin(auth, ssid, pass);

 pinMode( 4, OUTPUT); 
 digitalWrite(4, HIGH);
}


BLYNK_WRITE(V1) {
   if (param.asInt()==1){  // act only on the HIGH and not the LOW of the momentary
    digitalWrite(4, !digitalRead(4));  // invert pin state just once
    timer.setTimeout(2000L, [](){
    digitalWrite(4, !digitalRead(4));  // then invert it back after 1000ms
    Blynk.virtualWrite(V1, LOW);
    });
  
    }}



void loop()
{
  Blynk.run();
  timer.run(); // missing this very important line to make the timer work
}

1 Like