I’m using a nodemcu and 4 Channel Relay to control my bedroom lights and fan.
But every time the power goes out the relay turns off all the connected appliances and never turns them back on automatically. I read somewhere that blynksyncall can help solve this problem. If this is so can someone please help me integrate this into my existing code.
I don’t know anything about coding so couldn’t do it myself.
I’m pasting my existing code, can someone please help me integrate blynksyncall() into this so everything turns back on as it was before the power went out.
#define BLYNK_PRINT Serial
char auth = "AuthCode"; // the auth code that you got on your gmail
char ssid = "ssid"; // username or ssid of your WI-FI
char pass = "password"; // password of your Wi-Fi
// Debug console
pinMode(D1,OUTPUT); //extend these to D8 if you are using a 8 pin relay
digitalWrite(D1,HIGH); // Make it low if you want everything to go off
digitalWrite(D2,HIGH); // in case of a power cut
Blynk.begin(auth, ssid, pass);