Esphome nodemcu binary sensor state

Dear folks i have a problem with my configuration in esphome with a switch i am using in hassio.
i will try to summarize the problem. The hardware I am using is a nodemcu with a nextion display.

I made a screen with push buttons to operate a number of covers. To make this possible, you have to create a number of binary sensors in the code of Esphome. You can then link this to a touch field of the nextion display. So fa so good. I have it working so that I can operate the cover via the display. howe ever, now there is 1 problem. at the moment the connection with the nodemcu is broken, for example by switching off the display, the state of the binary sensor changes and the cover is activated.
does anyone have an idea how I can prevent this?