Controlling widgets from device

I have a simple led project
i.e. the blynk app has a button which turns the led on/off (toggle)
when the led is on the button is green when it is off the button is black
NOW
I added a physical button to the board (NodeMCU)
I wrote code so that when i press the button the led turns on/off (toggle)
to sum up
i can turn the led via the phone app and via the physical button

what i want is to notify the app when the physical button was pressed so it will change the button’s state

how do i do that?

digitalRead and VirtualWrite.

1 Like

thank you

https://examples.blynk.cc/?board=NodeMCU&shield=ESP8266%20WiFi&example=More%2FSync%2FSyncPhysicalButton

1 Like

thank you very much

Is there a way to add a button via code, or control visibility (hide/show)?
I am building a multiple device app.
I want to show only devices that are connected and hide the ones that aren’t.
Another option add dynamically buttons on the fly.

No but in code you can disable the widgets.

You also may consider Device Selector for your use case.