When the power is turned off, it does not see the sensors

Rasberry 4 + D1mini pro on ESPHome. Everything works. But when you turn off the power on the router, server, relay and turn it back on, the management does not see these relays on the ESP. In integration, the device sees, but these relays are also not active. It only helps by deleting the entire device, then restarting the server, and re-activating this device. And so on until the new power cut. What you need to do to make the sensors appear themselves.

esphome:
  name: ESP relay
  platform: ESP8266
  board: d1_mini_pro

wifi:
  ssid: "Wifissid"
  password: "pass"
  power_save_mode: none 


  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Temper Children Fallback Hotspot"
    password: ""

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:

switch:
  - platform: gpio
    pin: GPIO12
    id: relay
    name: "relay"