Second nodeMCU isn't detected

I’m building a temp sensor for each room with an esp8266 & a DS18B20 temp sensor. I was able to build the first one without any trouble using esphome and it was discovered by HA. When I built the second sensor, I followed the same process and its showing in esphome but HA won’t recognize it.

I can fetch logs from the first sensor via WiFi and it displays the expected temps. I can also fetch logs from the second sensor via USB (its still connected to the computer Pi4 for debugging) and it displays the expected temps.

The second sensor isn’t recognized by HA and I can’t add it to the esp home integration - its shows an error:
Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.

I’ve tried with both the mDNS entry and well as the IP. Neither works but I can ping both from my MacBook so I know the sensor is on WiFi.

When I gather logs from the second sensor via WiFi I get an error:
INFO ESPHome 2023.10.3
INFO Reading configuration /config/esphome/pipers-room.yaml…
INFO Starting log output from pipers-room.local using esphome API
WARNING Can’t connect to ESPHome API for pipers-room.local: Error connecting to (‘192.168.86.63’, 6053): [Errno 111] Connect call failed (‘192.168.86.63’, 6053) (SocketAPIError)
INFO Trying to connect to pipers-room.local in the background

Working yaml file:

esphome:
  name: living-room
  friendly_name: Living Room

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "<Top Secret Key>"

ota:
  password: "<Password>"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Living-Room Fallback Hotspot"
    password: "<Password>"

captive_portal:

dallas:
  - pin: D2

sensor:
  - platform: dallas
    address: <Address>
    name: "Room Temp"
  - platform: dallas
    address: <Address>
    name: "HVAC Temp"

Broken yaml file:

esphome:
  name: pipers-room
  friendly_name: Piper's Room

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "<Top Secret Key>"

ota:
  password: "<Password>"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Pipers-Room Fallback Hotspot"
    password: "<Password>"

captive_portal:

dallas:
  - pin: D2

sensor:
  - platform: dallas
    address: <Address>
    name: "Room Temp"
  - platform: dallas
    address: <Address>
    name: "Aquarium Temp"

Worth a try to name it “Pipers Room”, maybe the special character breaks things

Indeed - great hint and it worked!

Actually re-naming it to Pipers Room didn’t solve the issue, but deleting the device and starting over with the name Piper worked. Immediately after I pushed the config the device was discovered.

Interestingly I should have known. This bit me years ago with an SSID that also had an apostrophe; some devices were okay, others were not.

Thanks for the sanity check!

1 Like