Controll lights at home also modify the switch

Hello brother this is the circuit diagram sorry I did it the old style draw it with my hand I don’t have the app for the circuit designer
If u have any q ask
And if u are able to prove it for better don’t hesitate
I will be more than happy to improve the code also

Look what I found on AliExpress
This is the mini power supply I got it from AliExpress
It’s very small and fit in the socket wall

Thanks brother, I’ll analyze and set up the scheme, then tell you how it was.

Alright no problem :slight_smile:
The push buttons I also got them from AliExpress they are already 5vdc
There are some on eBay 3.3 u need to put resistor for it
Just to remind thank u

If the wifi adapter and the rooter are turned off (or unpluggled) the switch keeps working with the buttons on the wall? Or the sketch keeps in a infinit cycle on the instruction " Blynk.begin(auth, ssid, pass); " ??

If there is no wifi the physical button will work yes for 30 seconds then it stops working for 8 seconds in this 8 seconds it will try to connect to blynk if the connection made then ur fine the blynk will work and the physical button too
If it didn’t connect to blynk it will keep trying to connect

There´s any way to improved the SONOFF with the follow features??:

  • Could turn off and turn on the light with the physical button, without delay, even if wifi connections goes down or if the router in turned off. I say this cause most of codes of SONFF works with the physical button but have somes delays when connection goes down or wait for connection setting even if the button is pressed.

  • Use wifi manager with the features above.

To be honest I havnt tried sonoff yet
But i think it should have small of delay like mine I have 8 seconds delay to try to connect to blynk cloud when there is internet u need couple of seconds to try to connect in this couple of seconds u won’t be able to operate the physical buttoN

Exactly, si I would like to avoid that “dead time” for the physical button, but I dont know how.
There are two ways to read the physical button:

1- by polling. I think in this way you will always have the “dead time” issue.

2 - by Interruption. Im not sure how to use the interruption to change inmediately the switch state without dropping down the connection or causing another issue.

A post was split to a new topic: Blynk application can I learn the button information

blynk application can I learn the button information?

button = v1
button = v2
lcd = v5

You question doesn’t make any sense… and did not seem related to the 2+ year old topic you attached it to, so i moved you into your own topic.

Please clarify your question.

1 Like

It’s two buttons
V0 and V1
If that what u asking for .

Thank @dananmo at least someone understood the question :stuck_out_tongue: I merged this back into your topic.


Can we use this same code for esp32

2 posts were split to a new topic: Flood error warnings