Suddenly all switches gone

Have a 4ch sonoff with esp home. Code below. ESP Home shows it as online. Everything was fine but all the switches in HA now show as unavailable.

What can be done? Nothing in the logs.

Code

esphome:
  name: vent-sonoff
  platform: ESP8266
  board: esp01_1m
  comment: Sonoff 4 channel vent control

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "xxx"

wifi:
  ssid: "XXX"
  password: "XXX"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "X"
    password: "X"

captive_portal:


binary_sensor:
  - platform: gpio
    id: vent_sonoff_button_1
    internal: "yes"
    on_press:
      then:
        - switch.toggle: button_1
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
  - platform: gpio
    id: vent_sonoff_button_2
    internal: "yes"
    on_press:
      then:
        - switch.toggle: button_2
    pin:
      number: GPIO9
      mode: INPUT_PULLUP
      inverted: True
  - platform: gpio
    id: vent_sonoff_button_3
    internal: "yes"
    on_press:
      then:
        - switch.toggle: button_3
    pin:
      number: GPIO10
      mode: INPUT_PULLUP
      inverted: True
  - platform: gpio
    id: vent_sonoff_button_4
    internal: "yes"
    on_press:
      then:
        - switch.toggle: button_4
    pin:
      number: GPIO14
      mode: INPUT_PULLUP
      inverted: True
  - platform: status
    name: "vent_sonoff Status"

switch:
  - platform: gpio
    id: button_1
    name: "light_outside_led_left"
    pin: GPIO12
  - platform: gpio
    id: button_2
    name: "vent_vsr500_klapan_2floor"
    pin: GPIO5
  - platform: gpio
    id: button_3
    name: "vent_vsr500_klapan_outside"
    pin: GPIO4
  - platform: gpio
    id: button_4
    name: "vent_fan_reserve"
    pin: GPIO15

#output:
#  - platform: esp8266_pwm
#    id: sonoff_led
#    pin: GPIO13
#    inverted: True

You might want to give a static IP to your ESP devices. I think this may be the cause of switches dissapearing (and appearing as

light_outside_led_left_2

for example)

What happens is that if IP address changes, HA might re-add it. Check Settings → Devices and Services → check under ESPHome

Did check. Only one device there. Get the point but how to get from here? Just change to use of static IP and HA will get the correct config?