Adding ESPHome device and only one entity appears

I am trying to install an Athom Garage Opener interface (ESP8285 version for Homekit reflashed to work with ESPHome, following the instructions from Althom). It connects to ESPHome, but only one entity appears (firmware).

I found this related thread, and tried removing and readding the device, but no luck.

I am running the latest versions of HA and ESPhome builder.

One thing I don’t understand which may be the issue is that in ESPHome builder, it shows an instance of my wifi network, but the SSID is incorrect. It is showing off line, but is it even necessary? Under secret, it has the correct SSID and password.

Thanks for any suggestions.

Per your link, confirming your yaml and providing some logs will help others debug.

I think I saw a couple of other posts related to this problem, but a quick search didn’t find them. Maybe have a troll on the ESPHome section of the forums.

Oops, sorry. Here is the yaml for the door opener:


esphome:
  name: garage-door-opener-north
  friendly_name: Garage Door Opener North

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "kUepcVyrEuBUXNohivQ+k/yFqdSpwdbh9nrrs/Wk2Rc="

ota:
  - platform: esphome
    password: "2f3fbbd76d2b0e12855418d02d60874d"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Garage-Door-Opener-North"
    password: "0984Uw1LQJ3L"

captive_portal:

And here is for the mystery wifi entry. The name and friendly name of my wifi is only the first two words of my 3-word SSID. But the secret SSID and PW is correct.


esphome:
  name: hapenin-dude
  friendly_name: Hapenin Dude

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "9GZTEcCpW4nrWDoNBnwh7iYtiEO0BHz0JSFwnuduwzI="

ota:
  - platform: esphome
    password: "601aa4f80fbbbde091d587f276f38d6d"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Hapenin-Dude Fallback Hotspot"
    password: "Jb3555iHqiEb"

captive_portal:

This is the ESPHome Device Builder Log. Is that the best one to post?
s6-rc: info: service s6rc-oneshot-runner: starting

s6-rc: info: service s6rc-oneshot-runner successfully started

s6-rc: info: service fix-attrs: starting

s6-rc: info: service fix-attrs successfully started

s6-rc: info: service legacy-cont-init: starting

cont-init: info: running /etc/cont-init.d/30-esphome-fork.sh

cont-init: info: /etc/cont-init.d/30-esphome-fork.sh exited 0

s6-rc: info: service legacy-cont-init successfully started

s6-rc: info: service init-nginx: starting

s6-rc: info: service esphome: starting

s6-rc: info: service esphome successfully started

[16:52:45] INFO: Starting ESPHome dashboard...

s6-rc: info: service init-nginx successfully started

s6-rc: info: service nginx: starting

s6-rc: info: service nginx successfully started

s6-rc: info: service discovery: starting

[16:52:45] INFO: Waiting for ESPHome dashboard to come up...

2026-04-12 16:52:48,017 INFO Starting dashboard web server on unix socket /var/run/esphome.sock and configuration dir /config/esphome...

[16:52:48] INFO: Starting NGINX...

[16:52:48] INFO: Successfully send discovery information to Home Assistant.

s6-rc: info: service discovery successfully started

s6-rc: info: service legacy-services: starting

s6-rc: info: service legacy-services successfully started

2026-04-12 16:53:36,416 INFO 200 GET /devices (0.0.0.0) 3.51ms

2026-04-13 15:06:02,365 INFO 304 GET / (0.0.0.0) 14.59ms

2026-04-13 15:06:02,530 INFO 304 GET /static/images/logo-text.svg (0.0.0.0) 20.82ms

2026-04-13 15:06:02,541 INFO 101 GET /events (0.0.0.0) 1.92ms

2026-04-13 15:06:02,545 INFO Started dashboard event loop

2026-04-13 15:06:02,663 INFO 304 GET /static/fonts/material-icons/MaterialIcons-Regular.woff2 (0.0.0.0) 3.15ms

2026-04-13 16:12:21,713 INFO 200 GET /edit?configuration=garage-door-opener-north.yaml (0.0.0.0) 3.99ms

2026-04-13 16:12:21,746 INFO 101 GET /ace (0.0.0.0) 1.04ms

2026-04-13 16:12:21,748 INFO Running command '/usr/local/bin/python -m esphome --dashboard -q vscode --ace /config/esphome'

2026-04-13 16:12:22,087 INFO 304 GET /static/fonts/codicon.ttf (0.0.0.0) 17.72ms

2026-04-13 16:14:59,527 INFO 200 GET /edit?configuration=hapenin-dude.yaml (0.0.0.0) 2.31ms

2026-04-13 16:14:59,605 INFO 101 GET /ace (0.0.0.0) 1.48ms

2026-04-13 16:14:59,608 INFO Running command '/usr/local/bin/python -m esphome --dashboard -q vscode --ace /config/esphome'

2026-04-13 16:17:22,959 INFO Stopped dashboard event loop - no subscribers

Thanks, I’ll take another look.

You don’t appear to have any entities /sensors configured in your yaml?

Generally for ESPHome the best logs to post are either the “build” ones (via install), or the “operating” ones (via Logs".

Ah, I didn’t know I could add entities in yaml. Maybe that’s all I need to do? For all my other devices, like Zigbee, they automatically provided the entities. I’ll search the web to see if I can add manually.

Here is the log from the garage opener device “Logs”. Nothing stands out to me, though I’m not sure what to look for. The wifi warning is odd as I am using WPA-2.

INFO ESPHome 2026.3.3
INFO Reading configuration /config/esphome/garage-door-opener-north.yaml...
WARNING The minimum WiFi authentication mode (wifi -> min_auth_mode) is not set. This controls the weakest encryption your device will accept when connecting to WiFi. Currently defaults to WPA (less secure), but will change to WPA2 (more secure) in 2026.6.0. WPA uses TKIP encryption which has known security vulnerabilities and should be avoided. WPA2 uses AES encryption which is significantly more secure. To silence this warning, explicitly set min_auth_mode under 'wifi:'. If your router supports WPA2 or WPA3, set 'min_auth_mode: WPA2'. If your router only supports WPA, set 'min_auth_mode: WPA'.
INFO Starting log output from garage-door-opener-north.local using esphome API
INFO Successfully resolved garage-door-opener-north.local in 0.067s
INFO Successfully connected to garage-door-opener-north @ 192.168.1.105 in 0.009s
INFO Successful handshake with garage-door-opener-north @ 192.168.1.105 in 2.671s
[09:14:54.100][I][app:231]: ESPHome version 2026.3.3 compiled on 2026-04-10 13:29:22 -0500
[09:14:54.100][C][logger:229]: Logger:
[09:14:54.100][C][logger:229]:   Max Level: DEBUG
[09:14:54.100][C][logger:229]:   Initial Level: DEBUG
[09:14:54.101][C][logger:236]:   Log Baud Rate: 115200
[09:14:54.101][C][logger:236]:   Hardware UART: UART0
[09:14:54.162][C][captive_portal:134]: Captive Portal:
[09:14:54.163][C][wifi:1517]: WiFi:
[09:14:54.163][C][wifi:1517]:   Local MAC: 34:98:7A:D9:70:1E
[09:14:54.163][C][wifi:1517]:   Connected: YES
[09:14:54.164][C][wifi:1228]:   IP Address: 192.168.1.105
[09:14:54.164][C][wifi:1239]:   SSID: [redacted]
[09:14:54.164][C][wifi:1239]:   BSSID: [redacted]
[09:14:54.164][C][wifi:1239]:   Hostname: 'garage-door-opener-north'
[09:14:54.164][C][wifi:1239]:   Signal strength: -53 dB ▂▄▆█
[09:14:54.164][C][wifi:1239]:   Channel: 5
[09:14:54.164][C][wifi:1239]:   Subnet: 255.255.255.0
[09:14:54.164][C][wifi:1239]:   Gateway: 192.168.1.254
[09:14:54.164][C][wifi:1239]:   DNS1: 192.168.1.254
[09:14:54.164][C][wifi:1239]:   DNS2: 0.0.0.0
[09:14:54.166][C][esphome.ota:071]: Over-The-Air updates:
[09:14:54.166][C][esphome.ota:071]:   Address: garage-door-opener-north.local:8266
[09:14:54.166][C][esphome.ota:071]:   Version: 2
[09:14:54.166][C][esphome.ota:078]:   Password configured
[09:14:54.256][C][safe_mode:026]: Safe Mode:
[09:14:54.256][C][safe_mode:026]:   Successful after: 60s
[09:14:54.256][C][safe_mode:026]:   Invoke after: 10 attempts
[09:14:54.256][C][safe_mode:026]:   Duration: 300s
[09:14:54.257][C][web_server.ota:238]: Web Server OTA
[09:14:54.257][C][api:237]: Server:
[09:14:54.257][C][api:237]:   Address: garage-door-opener-north.local:6053
[09:14:54.257][C][api:237]:   Listen backlog: 1
[09:14:54.257][C][api:237]:   Max connections: 4
[09:14:54.258][C][api:244]:   Noise encryption: YES
[09:14:54.258][C][mdns:194]: mDNS:
[09:14:54.258][C][mdns:194]:   Hostname: garage-door-opener-north

Here is the log from the wifi Hapenin Dude “Logs” (it says off line, but do I even need it?). Can I delete that whole entry?

INFO ESPHome 2026.3.3
INFO Reading configuration /config/esphome/hapenin-dude.yaml...
WARNING The minimum WiFi authentication mode (wifi -> min_auth_mode) is not set. This controls the weakest encryption your device will accept when connecting to WiFi. Currently defaults to WPA (less secure), but will change to WPA2 (more secure) in 2026.6.0. WPA uses TKIP encryption which has known security vulnerabilities and should be avoided. WPA2 uses AES encryption which is significantly more secure. To silence this warning, explicitly set min_auth_mode under 'wifi:'. If your router supports WPA2 or WPA3, set 'min_auth_mode: WPA2'. If your router only supports WPA, set 'min_auth_mode: WPA'.
INFO Starting log output from hapenin-dude.local using esphome API

I started to add an entity to my yaml, but I quickly got stuck. I’m wasn’t sure what values to use for:
platform - Should that be gpio, esphome, or something else?
pin - Do I have to disassemble device to see what pins are being used?
id - Do I need that?

#Add entities manually by Tom
switch:
  - platform: gpio
    name: "Garage Door Opener North"
    pin: D2
    id: relay1

So then I went to the seller’s web page and found this yaml. Do I need to copy and paste the whole thing into my existing yaml for the device, and if so, do I replace the existing code?

There appear to be some variables, enclosed in { }. If they are indeed variables, do I have to define them elsewhere, or just replace the values within the { }?

Lastly, it looks like this yaml if for a slightly different version of ESP device (mine is 8285 with 2M RAM and this looks like it is for an ESP323C with 4M RAM. Will that matter?

Sorry for all the noobie questions.

Add “this yaml” to yours .Just add after “captive_portal”.

Thanks. After adding to my yaml and saving, I clicked validate and it gave errors for duplicate keys. First it was line 1, then line 6, 9, 12, and so on. I tried commenting them out one by one, but now it gives the following error:

ERROR Error while reading config: Invalid YAML syntax:

expected '<document start>', but found '<block mapping start>'
  in "/config/esphome/garage-door-opener-north.yaml", line 20, column 1

I don’t know how to proceed. Here is the latest yaml after my edits:

# esphome:
#  name: garage-door-opener-north
#  friendly_name: Garage Door Opener North

#esp8266:
 # board: esp01_1m

# Enable logging
#logger:

# Enable Home Assistant API
#api:
  #encryption:
   # key: "kUepcVyrEuBUXNohivQ+k/yFqdSpwdbh9nrrs/Wk2Rc="

#ota:
  - platform: esphome
    password: "2f3fbbd76d2b0e12855418d02d60874d"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Garage-Door-Opener-North"
    password: "0984Uw1LQJ3L"

captive_portal:

  # Additional yaml from Athom web page 
  substitutions:
  # Default name 
  name: "athom-garage-door"
  # Default friendly name 
  friendly_name: "Athom Garage Door"
  # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
  room: ""
  # Description as appears in ESPHome & top of webserver page
  device_description: "athom esp32-c3 garage door opener"
  # Project Name
  project_name: "China Athom Technology.Garage Door Opener"
  # Project version denotes the release version of the yaml file, allowing checking of deployed vs latest version
  project_version: "v3.1.2"
  # Status inverted
  status_inverted: "true"
  # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
  dns_domain: ".local"
  # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
  timezone: ""
  # Set the duration between the sntp service polling ntp.org servers for an update
  sntp_update_interval: 6h
  # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
  sntp_server_1: "0.pool.ntp.org"
  sntp_server_2: "1.pool.ntp.org"
  sntp_server_3: "2.pool.ntp.org"    
  # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
  wifi_fast_connect: "false"
  # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
  log_level: "DEBUG"
  # Enable or disable the use of IPv6 networking on the device
  ipv6_enable: "false"


esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"
  comment: "${device_description}"
  area: "${room}"
  name_add_mac_suffix: true
  min_version: 2025.8.0
  project:
    name: "${project_name}"
    version: "${project_version}"
  platformio_options:
    board_build.mcu: esp32c3
    board_build.variant: esp32c3
    board_build.flash_mode: dio

esp32:
  board: esp32-c3-devkitm-1
  flash_size: 4MB
  variant: ESP32C3
  framework:
    type: esp-idf
    version: recommended
    sdkconfig_options:
      # @grigi found in testing that these options resulted in better responsiveness.
      # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives.
      CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
      # Also enable this on any derivative boards (S2, C3 etc) but not the original ESP32.
      CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y
      # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds.
      CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10"

api:
  # reboot_timeout: 0s
  # Only enable BLE tracking when wifi is up and api is connected
  # Gives single-core ESP32-C3 devices time to manage wifi and authenticate with api
  on_client_connected:
     - esp32_ble_tracker.start_scan:
        continuous: true
  # Disable BLE tracking when there are no api connections live
  on_client_disconnected:
    if:
      condition:
        not:
          api.connected:
      then:
        - esp32_ble_tracker.stop_scan:

ota:
  - platform: esphome

logger:
  baud_rate: 0  # 0 Enables logging, but disables serial-port logging to free CPU and memory
  level: ${log_level}
  hardware_uart: UART0

mdns:
  disabled: false

web_server:
  port: 80

network:
  enable_ipv6: ${ipv6_enable}

wifi:
  ap: {}
  fast_connect: "${wifi_fast_connect}"
  domain: "${dns_domain}"

captive_portal:

esp32_improv:
  authorizer: none

esp32_ble_tracker:
  scan_parameters:
    # Don't auto start BLE scanning, we control it in the `api` block's automation.
    continuous: false
    active: true  # send scan-request packets to gather more info, like device name for some devices.
    interval: 320ms  # default 320ms - how long to spend on each advert channel
    window:   300ms  # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable.
    # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be
    # required if your device is controlling other sensors or doing PWM for lights etc.

bluetooth_proxy:
  active: true

dashboard_import:
  package_import_url: github://athom-tech/esp32-configs/athom-garage-door.yaml

sensor:
  - platform: uptime
    name: "Uptime Sensor"
    id: uptime_sensor
    type:
      timestamp
    entity_category: "diagnostic"

  - platform: wifi_signal
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

  - platform: copy
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"
    device_class: ""

binary_sensor:
  - platform: status
    name: "Status"

  - platform: gpio
    name: "Contact"
    disabled_by_default: true
    device_class: garage_door
    id: contact
    pin:
      number: GPIO18
      inverted: "${status_inverted}"
    filters:
      - delayed_on: 20ms

  - platform: gpio
    pin:
      number: GPIO3
      mode: INPUT_PULLUP
      inverted: true
    name: "Button"
    disabled_by_default: true
    on_multi_click:
      - timing:
          - ON for at most 1s
          - OFF for at least 0.2s
        then:
          - switch.turn_on: relay
      - timing:
          - ON for at least 4s
        then:
          - button.press: Reset

button:
  - platform: restart
    name: "Restart"
    entity_category: config

  - platform: factory_reset
    name: "Factory Reset"
    id: Reset
    entity_category: config

  - platform: safe_mode
    name: "Safe Mode"
    internal: false
    entity_category: config

switch:
  - platform: gpio
    pin: GPIO7
    name: "Relay"
    id: relay
    disabled_by_default: true
    on_turn_on:
      - light.turn_on: wifi_led
      - delay: 1s
      - switch.turn_off: relay
      - light.turn_off: wifi_led

light:
  - platform: status_led
    name: "Status LED"
    id: wifi_led
    disabled_by_default: true
    pin: GPIO4

cover:
  - platform: template
    device_class: garage
    name: "Garage Door"
    lambda: "return id(contact).state ? COVER_OPEN : COVER_CLOSED;"
    open_action:
      then:
       - if:
          condition:
            lambda: 'return !id(contact).state;'
          then:
              - switch.turn_on: relay
    stop_action:
      - switch.turn_on: relay
    close_action:
      then:
       - if:
          condition:
            lambda: 'return id(contact).state;'
          then:
            - switch.turn_on: relay

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "IP Address"
      entity_category: diagnostic
    ssid:
      name: "Connected SSID"
      entity_category: diagnostic
    mac_address:
      name: "Mac Address"
      entity_category: diagnostic

  - platform: template
    name: 'Last Restart'
    id: device_last_restart
    icon: mdi:clock
    entity_category: diagnostic
    device_class: timestamp

time:
  - platform: sntp
    id: sntp_time
  # Define the timezone of the device
    timezone: "${timezone}"
  # Change sync interval from default 5min to 6 hours (or as set in substitutions)
    update_interval: ${sntp_update_interval}
  # Set specific sntp servers to use
    servers: 
      - "${sntp_server_1}"
      - "${sntp_server_2}"
      - "${sntp_server_3}"   
  # Publish the time the device was last restarted
    on_time_sync:
      then:
        # Update last restart time, but only once.
        - if:
            condition:
              lambda: 'return id(device_last_restart).state == "";'
            then:
              - text_sensor.template.publish:
                  id: device_last_restart
                  state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'

Sorry about my english.Watch carefully,where rows starts.Ifs very important

I’d suggest carefully “merging what you have into thiers”. So add your wifi details etc. Selectively replacing thier values with yours.

It will help if you start reading the docs a little, to get familiar with how it needs to come together. For example,

For the substitutions (see docs) my suggestion to get started is it is best to stick with their config and change things once you understand them if needed.

This is a hurdle. You will probably have a much easier time if you can find the sellers config for your older board. Try the internet or contact the seller. Otherwise you’ll need to navigate pin mappings and other changes yourself.

Possibly you need this one.

The seller sent me a yaml that is supposed to be for my device. I installed it, but got wifi and IP address errors. So I am now following the instructions on the link regarding wifi configuration you sent and hopefully that will take care of it.

No joy. I still get the same error:

Linking .pioenvs/athom-garage-door/firmware.elf
RAM:   [====      ]  39.5% (used 32348 bytes from 81920 bytes)
Flash: [====      ]  43.8% (used 457917 bytes from 1044464 bytes)
Building .pioenvs/athom-garage-door/firmware.bin
esp8266_copy_factory_bin([".pioenvs/athom-garage-door/firmware.bin"], [".pioenvs/athom-garage-door/firmware.elf"])
esp8266_copy_ota_bin([".pioenvs/athom-garage-door/firmware.bin"], [".pioenvs/athom-garage-door/firmware.elf"])
======================== [SUCCESS] Took 170.19 seconds ========================
INFO Build Info: config_hash=0xca3718a5 build_time_str=2026-04-14 16:25:03 -0500
INFO Successfully compiled program.
ERROR Error resolving IP address of ['athom-garage-door.local']. Is it connected to WiFi?
ERROR (If this error persists, please set a static IP address: https://esphome.io/components/wifi/#manual-ips)
ERROR Timeout resolving IP address: Timeout while resolving IP address for ['athom-garage-door.local']
WARNING Failed to upload to ['athom-garage-door.local']

Here is the revised yaml that produced the wifi/IP address error:

substitutions:
  # Default name
  name: "athom-garage-door"
  # Default friendly name
  friendly_name: "Athom Garage Door"
  # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc
  room: ""
  # Description as appears in ESPHome & top of webserver page
  device_description: "athom garage door opener"
  # Project Name
  project_name: "China Athom Technology.Athom Garage Door Opener"
  # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
  project_version: "v1.2.4"
  # Status inverted
  status_inverted: "true"
  # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs)
  dns_domain: ".local"
  # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney")
  timezone: ""
  # Set the duration between the sntp service polling ntp.org servers for an update
  sntp_update_interval: 6h
  # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@
  sntp_server_1: "0.pool.ntp.org"
  sntp_server_2: "1.pool.ntp.org"
  sntp_server_3: "2.pool.ntp.org"
  # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken
  wifi_fast_connect: "false"
  # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
  log_level: "DEBUG"
  # Enable or disable the use of IPv6 networking on the device
  ipv6_enable: "false"

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"
  comment: "${device_description}"
  area: "${room}"
  name_add_mac_suffix: true
  min_version: 2024.6.0
  platformio_options:
    board_upload.flash_size: 2MB
    board_upload.maximum_size: 2097152
    board_build.ldscript: eagle.flash.2m.ld
  project:
    name: "${project_name}"
    version: "${project_version}"

esp8266:
  board: esp8285

api:

ota:
  - platform: esphome

logger:
  level: ${log_level}
  baud_rate: 115200

web_server:
  port: 80

network:
  enable_ipv6: ${ipv6_enable}

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

mdns:
  disabled: false

captive_portal:

dashboard_import:
  package_import_url: github://athom-tech/athom-configs/athom-garage-door.yaml

sensor:
  - platform: uptime
    name: "Uptime Sensor"
    id: uptime_sensor
    entity_category: diagnostic
    internal: true

  - platform: wifi_signal
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

  - platform: copy
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"
    device_class: ""

binary_sensor:
  - platform: status
    name: "Status"

  - platform: gpio
    name: "Contact"
    disabled_by_default: true
    device_class: garage_door
    id: contact
    pin:
      number: GPIO4
      inverted: "${status_inverted}"
    filters:
      - delayed_on: 20ms

  - platform: gpio
    pin:
      number: GPIO14
      mode: INPUT_PULLUP
      inverted: true
    name: "Button"
    disabled_by_default: true
    on_multi_click:
      - timing:
          - ON for at most 1s
          - OFF for at least 0.2s
        then:
          - switch.turn_on: relay
      - timing:
          - ON for at least 4s
        then:
          - button.press: Reset

button:
  - platform: restart
    name: "Restart"
    entity_category: config

  - platform: factory_reset
    name: "Factory Reset"
    id: Reset
    entity_category: config

  - platform: safe_mode
    name: "Safe Mode"
    internal: false
    entity_category: config

switch:
  - platform: gpio
    pin: GPIO5
    name: "Relay"
    id: relay
    disabled_by_default: true
    on_turn_on:
      - light.turn_on: wifi_led
      - delay: 1s
      - switch.turn_off: relay
      - light.turn_off: wifi_led

light:
  - platform: status_led
    name: "Status LED"
    id: wifi_led
    disabled_by_default: true
    pin:
      inverted: true
      number: GPIO12

cover:
  - platform: template
    device_class: garage
    name: "Garage Door"
    lambda: "return id(contact).state ? COVER_OPEN : COVER_CLOSED;"
    open_action:
      then:
       - if:
          condition:
            lambda: 'return !id(contact).state;'
          then:
              - switch.turn_on: relay
    stop_action:
      - switch.turn_on: relay
    close_action:
      then:
       - if:
          condition:
            lambda: 'return id(contact).state;'
          then:
            - switch.turn_on: relay

text_sensor:
  - platform: wifi_info
    ip_address:
      name: "IP Address"
      entity_category: diagnostic
    ssid:
      name: "Connected SSID"
      entity_category: diagnostic
    mac_address:
      name: "Mac Address"
      entity_category: diagnostic

  #  Creates a sensor showing when the device was last restarted
  - platform: template
    name: 'Last Restart'
    id: device_last_restart
    icon: mdi:clock
    entity_category: diagnostic
#    device_class: timestamp

  #  Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
  - platform: template
    name: "Uptime"
    entity_category: diagnostic
    lambda: |-
      int seconds = (id(uptime_sensor).state);
      int days = seconds / (24 * 3600);
      seconds = seconds % (24 * 3600);
      int hours = seconds / 3600;
      seconds = seconds % 3600;
      int minutes = seconds /  60;
      seconds = seconds % 60;
      if ( days > 3650 ) {
        return { "Starting up" };
      } else if ( days ) {
        return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
      } else if ( hours ) {
        return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
      } else if ( minutes ) {
        return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
      } else {
        return { (String(seconds) +"s").c_str() };
      }
    icon: mdi:clock-start

time:
  - platform: sntp
    id: sntp_time
  # Define the timezone of the device
    timezone: "${timezone}"
  # Change sync interval from default 5min to 6 hours (or as set in substitutions)
    update_interval: ${sntp_update_interval}
  # Set specific sntp servers to use
    servers:
      - "${sntp_server_1}"
      - "${sntp_server_2}"
      - "${sntp_server_3}"
  # Publish the time the device was last restarted
    on_time_sync:
      then:
        # Update last restart time, but only once.
        - if:
            condition:
              lambda: 'return id(device_last_restart).state == "";'
            then:
              - text_sensor.template.publish:
                  id: device_last_restart
                  state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'

I think I got it. I had previously connected the device with USB cable so I thought I could still do everything via wifi. Apparently not. I tried installing the yaml with USB cable and now I can see several entities and it is working over wifi! At least on the bench. Integrating it with HA and automations is another story, but thanks for all the help!

1 Like

Wild guessing and copying everything you find (YouBoob video tutorials, old reddit threads, LLMs and AI hallucinations included in this) will (as you have seen), only get you so far.

Some suggestions, based on my experience:

Go back to the basics. Read the ESPHome documentation carefully.

Your ESP8285 is a ESP8266 with onboard memory. The code for an ESP32 may or may not work, depending on what section you are using. The vendor documentation will tell you which is appropriate if necessary.

You appeared to have copied portions of the athom vendor sample yaml code into your code, and then inside your code, are copying it in again, verbatim, doubling up and possibly overwriting your customisation Use it as a template and modify to your use as necessary, compiling your code only. This would tend to indicate the section of the documentation about nesting yaml code is not clear in your mind yet.

Try hard coding your WiFi credentials if your !Secrets functionality is not working (and most importantly, blank it out when you post here). Check your spelling in the secrets file matches your yaml code, exactly, including spaces, underlines, and capitalisation. The best way to do that it to temporarily cut and paste the lines into your yaml code and then you can be sure they are identical side by side.

Configuring your ESP device on your router DHCP configuration to have a Static IP address can also help enormously with troubleshooting.

Use of debugging switches in your code can help enormously. VERY VERBOSE should be turned off after you have located any problems.

Adding a temporary Web Server to your code will enable you to see defined variables in real time. Use the Visit option in ESPHome to jump to it after you have solved your WiFi issues.

Using the inbuilt ESPHome editor may be less resources intensive than VSCODE, and the resulting logs more useful.

Plan what you want to achieve, and the work towards that goal. This is far more efficient than throwing things into a pot and seeing what works. At the end you will be satisfied you have achieved your goal and have the understanding to build on it and achieve greater things.

Post your full ESPHome compile log once you have turned on debugging for further hints. (Use </> formatting for forum readability please)

Great advice, thank you! Part of the problem for me, and I’d venture other beginners, is that in order to learn from the documentation, you have to know the terminology. Google can help, but not always so it is sometimes a Catch 22. But I always try to research before posting a question here.

Fortunately, I got the correct version of the yaml and it was only a matter of realizing I couldn’t install it wirelessly, even though it was showing as online. And then adding code to refer to secret wifi.

A follow up question, if I may: It seems like everything in the HA world works better with a static IP. Is there any downside to assigning a static IP to all my devices, other than the time to do it?

Yes, if mDNS code is faulty, you may not realise, as you will be using the faster, more efficient way of addressing your devices directly. :innocent:

You can have the best of both worlds, allocating a smaller range of dynamic IP Addresses as well to be handed out to devices that have not been configured for static IPs yet, so you can progressively convert everything and still retain functionality. Be sure to backup your router’s config each time you make a change for rollback purposes.

I did a quick search and my router (ATT BGW320) does not support mDNS. Based on that (and without installing another router in passthrough mode), is there still much benefit to having static IP on IOT devices? I’ve had Tuya devices (almost all DHCP) for a few years and other than occasional delays of a few seconds to respond, it has been very reliable. Is it right to assume that most delays are caused by communicating with the cloud? Alos, now that I am going with more local connectivity using Home Assistant, is static any better, or is it irrrelevant?

Oh, I wish. My router does not support config backups either. So I do it the old fashioned way - with screenshots. Ugh.

This has been discussed a lot on the forum.

For example…

Of course you can see how you go without them.
I bit the bullet and maintain a big spreadsheet of macs and static ips and have had way fewer dramas after I moved to that. That said I don’t know much about networking.

Some applications like deep sleep projects really benefit from fast connection times.