Cant connect to ESPHome device

One of my sonoff minis with Esphome blew a capacitor so i replaced it with another pre-flashed device, planning to flash in the original firmware of the damaged one.

So the “new” device creates a captive portal, but cant flash the firmware into it OTA because it resets the connection (tried over an android phone). My second attempt was to connect it to the wifi and try OTA from the web interface, but I can’t access the device over the web. it responds to ping, but no web interface comes up and the esphome dashboard also can’t see it…

Currently i don’t have the possibility to connect it to to an USB-TTL adaptor nor cut the power to it to reset it, so i need to resolve this somehow over the network…

What is it currently flashed with?

its a different EPHome build that is set up for a another AP that is not available at its current location

substitutions:
  esphome_name: kitchen_led

esphome:
  name: ${esphome_name}
  platform: ESP8266
  board: esp8285

wifi:
  ssid: radirpok_iot_street
  password: !secret iot_password
  domain: !secret local_domain
  ap:
    ssid: "${esphome_name}_fallback"
    password: !secret ap_password

api:
  reboot_timeout: 60min

ota:

time:
  - platform: homeassistant


captive_portal:

# Enable web server
web_server:
  port: 80

# Enable logging
logger:

# Physical button 
binary_sensor:
  - platform: gpio
    id: push_button
    name: "${esphome_name} switch"
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    on_press:
      # Prevents unintended LED lit states.
      if:
        condition:
          - switch.is_off: logical
        then:
          - switch.turn_on: blue_led
          - switch.turn_on: logical
        else:
          - switch.turn_off: logical
      

sensor:
  - platform: uptime
    name: "${esphome_name}_Uptime Sensor"
    
  - platform: wifi_signal
    name: "${esphome_name} WiFi Signal"
    update_interval: 60s
    
text_sensor:
  - platform: wifi_info
    scan_results:
      name: ESP Latest Scan Results
    

# Relay
output:
  - platform: gpio
    pin: GPIO12
    id: relay

# Logical switch to control relay and light
switch:
  - platform: output
    id: logical
    output: relay
    on_turn_off:
      if:
        condition:
          - switch.is_on: blue_led
        then:
          - switch.turn_off: blue_led
  - platform: gpio
    id: blue_led
    pin:
      number: GPIO13
      inverted: true
  - platform: restart
    name: ${esphome_name}-restart
    id: restart_switch

light:
  - platform: binary
    name: "${esphome_name} lights"
    id: terrace_lights
    output: relay
    

Hmmm… You can’t cut power but wireless OTA fails at it resets connection… :see_no_evil:

I would say then boot into safe mode but you don’t have a switch or button for that in your yaml :man_shrugging:

Did you actually try to run a OTA update/install from your esphome dashboard? :arrow_double_up:

And do you have an idea what version of esphome is running on the plug and which version you got of the esphome dashboard?

after a repeated attempts somehow i was able to connect to the device via web and push an OTA update with the original config. i think the firmware version was something like 2023.7 or similar. probably the initial OTA flash from the phone failed because it was in the “new” format and I am not sure since what version its supported