ESPHome device regognized but no entities are found

I set up an esp8266-based device using the ESPHome wizard and successfully flashed it. When I go to Configurations -> Integrations, ESPHome displays and shows “1 device” but no entities. I am trying to control one of the GPIO pins on the device, so my ESPHome yaml file (/config/esphome/relay.yaml) includes the original boilerplate plus

switch:

  • platform: gpio
    name: “Pin_13”
    pin: 13

The Pin_13 switch is not shown in the list of entities and is not displayed in the Overview. I have tried restarting my Home Assistant Rpi and the esp board, to no avail. Any ideas how I can control this pin from HA?

That is not yaml. Please read this and format your code correctly. How to help us help you - or How to ask a good question

There was a glitch in the formatting of mt post. The actual yaml is good:
switch:

  • platform: gpio
    name: “Pin_13”
    pin: 13

Obviously I’m struggling with the post formatting . . .

switch:
  - platform: gpio
    name: "Pin_13"
    pin: 13

You got it that time.

Welcome to the community by the way, I see that was your 1st post.

Did you recompile & upload the firmware to the esp after adding the switch to the yaml file? Clicking upload in the GUI should compile new firmware and upload it over the air (OTA).

Recompiling and uploading proceed fine:

========================= [SUCCESS] Took 13.35 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of relay.local
INFO  -> 192.168.1.19
INFO Uploading /data/relay/.pioenvs/relay/firmware.bin (405472 bytes)
Uploading: [============================================================] 100% Done...
INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from relay.local using esphome API
INFO Connecting to relay.local:6053 (192.168.1.19)
INFO Successfully connected to relay.local
[06:29:55][I][app:100]: ESPHome version 1.14.5 compiled on Jul  8 2020, 06:29:18
[06:29:55][C][wifi:415]: WiFi:
[06:29:55][C][wifi:283]:   SSID: [redacted]
[06:29:55][C][wifi:284]:   IP Address: 192.168.1.19
[06:29:55][C][wifi:286]:   BSSID: [redacted]
[06:29:55][C][wifi:287]:   Hostname: 'relay'
[06:29:55][C][wifi:291]:   Signal strength: -35 dB ▂▄▆█
[06:29:55][C][wifi:295]:   Channel: 3
[06:29:55][C][wifi:296]:   Subnet: 255.255.255.0
[06:29:55][C][wifi:297]:   Gateway: 192.168.1.1
[06:29:55][C][wifi:298]:   DNS1: 192.168.1.1
[06:29:55][C][wifi:299]:   DNS2: (IP unset)
[06:29:55][C][switch.gpio:042]: GPIO Switch 'Pin_13'
[06:29:55][C][switch.gpio:043]:   Pin: GPIO13 (Mode: OUTPUT)
[06:29:55][C][switch.gpio:059]:   Restore Mode: Restore (Defaults to OFF)
[06:29:55][C][logger:175]: Logger:
[06:29:55][C][logger:176]:   Level: DEBUG
[06:29:55][C][logger:177]:   Log Baud Rate: 115200
[06:29:55][C][logger:178]:   Hardware UART: UART0
[06:29:55][C][captive_portal:169]: Captive Portal:
[06:29:55][C][ota:029]: Over-The-Air Updates:
[06:29:55][C][ota:030]:   Address: relay.local:8266
[06:29:55][C][api:095]: API Server:
[06:29:55][C][api:096]:   Address: relay.local:6053
[06:31:46][I][ota:046]: Boot seems successful, resetting boot loop counter.

Can you post the entire YAML please? Also, do you see HA connecting to the device later on in the boot logs?

Here is /config/esphome/relay.yaml:

esphome:
  name: relay
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: [redacted]
  password: [redacted]

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Relay Fallback Hotspot"
    password: [redacted]

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

switch:
  - platform: gpio
    name: "Pin_13"
    pin: 13

Where can I find the “boot” logs to answer you question? Thank you so much for trying to help me. My project is to use HA and the esp8266 to control a sprinkler on a roof cooling system by getting a weather forecast and setting start and stop times based on the forecast.

In the esphome integration hamburger menu, system options, do you have ‘enable newly added entities’ turned on? You can also use the HA entity browser to find hidden entities (configuration/entities/hamburger menu/check show hidden and unavailable entities).

Enable newly added entities is turned on. The HA entity browser does not show the esp8266 pin, despite having disabled and unavailable entities checked…

I just discovered that when I click on the “Show logs” button in the ESPHome dashboard, I get perpetual connection failures. But the OTA uploading works fine and the esp8266 has an IP address and is pingable, so how can the connection fail?

INFO Reading configuration /config/esphome/relay.yaml...
INFO Starting log output from relay.local using esphome API
INFO Connecting to relay.local:6053 (192.168.1.19)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Invalid password!). Re-Trying in 1 seconds
...

That’s odd, as the logs you posted earlier show a successful connection. What’s changed since then?

This smells like a networking problem.

  • Do you have an “advanced” network setup with VLANs or other subnets? (you’ll know if you do)
  • What is the IP of the machine running the ESPHome dashboard?
  • Are you certain there’s no other device also using 192.168.1.19, or with a hostname of relay?
  • Perhaps set a static IP in your YAML, outside your router’s DHCP range. For example, my router gives out 192.168.1.100–254 as DHCP addresses, and everything up to .100 are static IP devices that I have configured.
  • There is no API password in your YAML. Make sure you’re not using one in your dashboard.

This morning when I checked the overview there was the pin and lo and behold I could switch the led I had connected! It’s troubling in a way since I had not made any changes from the evening before when it was not showing. Hopefully this was a one-time issue. So now I am on to figuring out how to grab the next day’s min and max temperature forecast from OpenWeatherMap and use it in an automation. I really appreciate everyone taking the time to try and help me. This seems like a wonderful community!

I am having similar issue and struggling since few days like nuts, my esphome 8266 nodemcu is perfectly fine, it shows online, it also has password , it also has static ip, infact things are quite similar to my old esphome device, which works fine. suddenly entities stopped being discoverable.
there is a file i found under .storage> core.entity_registry , there earlier nodemcu esphome entities, or basically json objects are there, no new entries are getting added.

here is my yml

esphome:
  name: p-bedroom

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "9e4a4cc9ca8184ea786ee4c687598109"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  
# Optional manual IP
  manual_ip:
    static_ip: 192.168.1.73
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "P-Bedroom Fallback Hotspot"
    password: "jjT2JrIPttXZ"

captive_portal:

binary_sensor:
  # - platform: gpio
  #   pin: D1
  #   name: "P Bedroom window"
  #   device_class: window
  - platform: gpio
    name: "P Bedroom SOS"
    device_class: window
    pin: 
      number: D5
      inverted: true
      mode:
        input: true
  # - platform: gpio
  #   pin: D6
  #   name: "gas sensor"
  #   device_class: window
  - platform: gpio
    name: "P Bedroom window"
    device_class: window
    pin:
      number: D1
      inverted: true
      mode:
        input: true
    
sensor:
  - platform: dht
    pin: D2
    temperature:
      name: "P Bedroom Temperature"
    humidity:
      name: "P Bedroom Humidity"
    update_interval: 60s
    
# Example configuration entry
switch:
  - platform: gpio
    pin: D6
    name: "P Bedroom Motor input 1"
  - platform: gpio
    pin: D7
    name: "P Bedroom Motor input 2"

Similar or identical?
You will get more response if you start a new thread.

1 Like

I had an issue with new entities not showing up but my experience was related to removing and renaming, I resolved it and got new entities to show up by removing the integration from the integration panel and the restarting the addon from Addons (what was supervisor). New entities were then discovered.

4 Likes

Sorry to resurrect an old thread, but I wanted to add another possible cause for those who might stumble across this while googling.

For me the symptom in the title was caused by trying to use the button component with an older version of home assistant core. The documentation makes this incompatibility conspicuously clear, but I had missed it the first time through.

2 Likes

Just got this error after updating HA and HA core and fixed it by removing the button part

Just wanted to add that I had the same issue. It was working fine in the logs and running the webserver from ESPhome. When I finally added it to Home Assistant it only showed the Firmware was up to date. I had tried flashing the device several times, connected to pc and Ota, and nothing worked.

After I found this post, I removed only the Button code and re-flashed. IT WORKED! All my sensors and switches showed up in Home Assistant. After that I added the Button code back and flashed again and it is still working now with the button in Home Assistant. Kind of an odd bug, but at least it works now.