The problem remains, for example: When the arduino inside the lamp is powerd on, the lamp is normally off. When I open the app, the status of the lamp is also off. There's is no problem when I turn the lamp on using the app for the first time. But then, I pull the lamp out of the plug and replug it, the arduino is reset and the lamp is by default normally off while the status in the app will still show that the lamp is on. Note that there isn't a way for the arduino to remember what the value of the variables were before it was shut off.
There are other situations where this can happen; second person with the app turns lamp on/off, arduino is reset...
I really need a way that the appinventor can ask the NodeMCU for a status update and change the variables in the app accordingly. But therefore, the NodeMCU needs to send data and the app needs to receive it. The app -> arduino way works perfect.