Ok google switch on lamp but the lamp switch off

Before creating the topic

  1. Search forum for similar topics
  2. Check http://docs.blynk.cc and http://help.blynk.cc/
  3. Add details :
    • Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
    • Smartphone OS (iOS or Android) + version
    • Blynk server or local server
    • Blynk Library version
    • Add your sketch code. :point_up:Code should be formatted as example below.

Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.


void loop()

Hello everyone
I have a problem with my project.
I connected a led strip to my esp8266 and assigned a switch to the virtual blink V4 port.
I then connected everything using this post

everything works but if I say twice “ok google switch on the lamp” the light switch off, not being a programming expert I don’t understand where I’m wrong. Who can help me?

Hi,

What are you passing to V4 on “ok google switch on the lamp” trigger?? if 1 then try passing 0 or vice versa.

Regards,
Gaurav Barwalia

Hi noobGB

Thanks for the reply
The problem I believe must be corrected by adding some code that returns the status of the V4 PIN to “0” so if I say “ok google switch on Lamp” the lamp stays on.
And this is my problem I don’t know where to look at the code and where to add something. Attached I inserted the trigger that I used.

Hi,
Sorry, Why you are using Body =[“1>600 ms delay>0”], it should be either [“0”] or [“1”]. If you are using active low design then it should be [“0”] only to keep it on.

Regards,
Gaurav Barwalia

I think he’s read this:

and ignored the bit about using Tasker to do this and just thrown it in the IFTTT body instead.

What could possibly go wrong?

Pete.
Pete.

Hi Pete,

Possibly the Blynk server reading the first byte only which is “1” in “1>600 ms delay>0” and updating V4=1 which results in powering off the relay/lamp. Just a wild guess.

Regards,
Gaurav Barwalia

1 Like

I can’t solve, this is the code I used. Can you add anything in this code so that the light stays on when I say “ok google switch on lamp”?
Who can help me?
Thank you

"’

void aplyCmd()

if (lampStatus == 1)
{
Blynk.notify(“Life: Attenzione ==>> Luce accesa”);
digitalWrite(LAMP_PIN, HIGH);
if (!turnOffOLED) displayData();
LAMPs.on();
LAMPa.on();
}
else
{
digitalWrite(LAMP_PIN, LOW);
if (!turnOffOLED) displayData();
LAMPs.off();
LAMPa.off();
}
}

"’

Please edit your post and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.