Sonoff not being recognized by Hassio

I have a bunch of Sonoff devices which were all flashed through ESPhome under Hassio running on a pi3+ (latest version of Hassio). All but one are running fine. When I install them I get a message saying that a new device has been found and if I would like to add it.
Well this particular unit is not recognized when I install it. It does connect to the network, it does operate with the button on the Sonoff itself to toggle a relay (as per programming that it was flashed with) but none of the entities are available under HA. The green light keeps flashing on the Sonoff at roughly 1 sec intervals … sort of like when a new device is attached to the network before it is connected to HA. It just never stops flashing.
It is quite possible that I had this device installed earlier, that it was added and that somehow or other I removed it for reasons unknown.
What I am wondering is - is there a way to add a device that somehow is not detected automatically?
If I did delete the device or made it inactive, how would I go about getting it back ?
Any help would be greatly appreciated!

You call it hassio but that name was discontinued several months ago. If you’re a long-time user of Home Assistant then I understand why you would still use that outdated name. However, your account profile indicates you joined September 10, 2020 so it implies you are a relatively new user. Where in the documentation did you learn to call Home Assistant OS by its former name?

Ensure its ESPhome configuration includes Native API component.

1 Like

Thanks for your reply. I have home assistant installed on the pi as an operating system image (ie on the pi’s sd card) and was under the (obviously mistaken) impression that ‘Hassio’ referred to the Home assistant operating system when installed on a pi. Is there a specific term that I should use to explain that I am not running home assistant as an application under some operating system but that I am running Home Assistant via an SD card image on a pi ?
Where would I set up the ‘native API’ component? All the Sonoff devices were flashed with the same .yaml file (with names changed) and under ‘api:’ in that file there is nothing entered. All of the Sonoff’s installed so far have been recognized (8 or so).
There is nothing in the configurations.yaml that refers to the API component.

Yes, I am new and very green … and very confused … sorry about being dense …

Home Assistant OS

The table in this post helps to clarify the four major ways of installing Home Assistant.

That’s the Native API component so you’ve confirmed all of the Sonoff devices have it (including the one that isn’t discovered).

At this point, I’m at the limit of my knowledge of ESPhome so the only thing left is to confirm the one that can’t be discovered had a unique name and isn’t identical to one of the other devices that is discovered. Beyond that, someone with more knowledge will have to help you.

This is what is the .yaml file that is flashed onto the Sonoff. It appears to be identical (other than names) to what is installed on all the other Sonoff devices.

esphome:
name: sonoff_basic_5
platform: ESP8266
board: esp01_1m

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: “Sonoff Basic 5 Fallback Hotspot”
password: “yKzMFJCyjn85”

captive_portal:

Enable logging

logger:

Enable Home Assistant API

api:

ota:

binary_sensor:

  • platform: gpio
    pin:
    number: GPIO0
    mode: INPUT_PULLUP
    inverted: True
    name: “Sonoff Basic 5 Button”
    on_press:
    • switch.toggle: relay

switch:

  • platform: gpio
    name: “Sonoff 5 test Relay”
    pin: GPIO12
    id: relay

status_led:
pin:
number: GPIO13
inverted: yes

That’s my parting shot: confirm its name isn’t identical to one of the others. :man_shrugging:

Thank you 123 Taras. I will confirm that the name is unique. Maybe I can just re-flash it with a new name.
Do you happen to know where HA keeps a list of names that it refers to ? Again, it is quite possible that a device with the same name was created in the beginning and then later erased. It could be that it is still somewhere in the system.
The name is unique under /config/esphome/ … where ll the other devices are listed.

If you don’t see it listed in Configuration > Entities (or Configuration > Devices) then, as far as Home Assistant is concerned, it doesn’t exist.

Where Home Assistant stores auto-discovered anything is in a hidden directory called .storage in various files. IFeel free to explore the files (contents are in JSON format) but do not modify anything (unless you really know what you are doing) because one mistake can cripple the system. All this to say, you’re not supposed to touch anything in there (and explains why the directory is hidden).

Great, I will explore without touching anything!
No, the entity or devices are not listed in the configuration.
The name is unique.
I will also try reprogramming with a different name if I can’t find anything obvious.
Thanks again!

For those running into the same issue - I re-programmed to a new name, worked fine, I then re-programmed to the old name - still working fine.
Seems that something went amiss during the original programming that let the device work for everything but not be recognized by HA.