Cut off elecricity

I make a project for two relays
There is a problem with node mcu when the electricity cut off and comes back the both relays are active when they are off at the last time(electricity cut off)
I used codes for it are supply from blink library
And give it to authtokan and username password.

Post your full code (with triple backticks at the beginning and end so that it displays correctly). Triple backticks look like this:
DO NOT include your auth code.

Also provide details of whether your relay is active HIGH or active LOW, and details of what widgets you’ve added to the app, and what pins these widgets are connected to.


Hi Sagae123,

You need to save last relay states after every relay state change so whenever electricity goes and comes back then Nodemcu can read last stored states from the memory. You can read about SPIFFS and ArduinoJson for starter, thank you!!

Gaurav Barwalia

For most people, simply pulling back the last state from the app will be sufficient, using a Blynk.sync command in the BLYNK_CONNECTED callback.
However, it depends if local physical switching will be used, and on what the actual requirements are - which we don’t know at this stage.