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!