Sonoff device discovered, can not configure in HA

I try to reenable Sonoff basic device that I previously used. When plugged to power, HA discovers device and even recognizes as it has same name I gave it some years ago. I then click on “Configure” button and get following message “Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.” This device does not appear among devices on my router, not sure how HA discovers it, but seems I am stuck, can not “configure” and check YAML. I guess my only way is to reflash it using serial converter, or? I have the file I initially loaded few years ago and that file contains below lines, so I am not sure why error message suggest I need to add api line to yaml

    key: Z3JldGE3MzYK

Similar story with earlier used Sonoff POWR2 unit, same error message when I try to configure it in HA. This one however appears among devices on my router and I can log on to device via it’s web interface. Could update yaml OTA, just did not save my original file somewhere, so I need to generate new file or find the copy I can use.

Any other ideas to tackle this issue?

If HA detects it, it must be on your lan, even if briefly.

Try putting the original yaml file in your esphome directory, probably /config/esphome.

But yes you can usually flash via serial.

1 Like