ESP32 has no sensor entities

Can someone tell me if there is anything wrong with my YAML below? I don’t see any sensor entities in ESPHome under my device. Thanks.

esphome:
  name: huzzahESP
  friendly_name: HuzzahESP

esp32:
  board: esp32dev
  framework:
    type: esp-idf
    

# Enable logging
logger:

# Enable Home Assistant API
api:
  #encryption:
    #key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

ota:
  - platform: esphome
    password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    
captive_portal:
i2c:
  sda: 21
  scl: 22
  scan: true
  id: bus_a

apds9960:
  address: 0x39
  update_interval: 60s

sensor:
  - platform: apds9960
    type: CLEAR
    name: "APDS Clear"   

Check the serial logs for the device. Likely there is an issue with your i2c connection, thus the sensor is not loading.

Be aware that pin labeled SDA on Huzzah is Gpio23, not 21.

1 Like

If I was using wrong pins I wouldn’t have any data, I get that. But I don’t even have any sensor entities for this device in HA.
There are no errors in the logs. It’s like ‘I2C’ and ‘sensor’ statements are ignored in my config or something.

Share your serial logs.

I don’t know what is your intention with this:

Afaik it’s used only once when you change ip address.

1 Like
[11:43:56]ets Jun  8 2016 00:22:57
[11:43:56]
[11:43:56]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[11:43:56]configsip: 0, SPIWP:0xee
[11:43:56]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[11:43:56]mode:DIO, clock div:2
[11:43:56]load:0x3fff0030,len:1184
[11:43:56]load:0x40078000,len:13132
[11:43:56]load:0x40080400,len:3036
[11:43:56]entry 0x400805e4
[11:43:56][I][logger:171]: Log initialized
[11:43:56][C][safe_mode:079]: There have been 0 suspected unsuccessful boot attempts
[11:43:56][D][esp32.preferences:114]: Saving 1 preferences to flash...
[11:43:56][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[11:43:56][I][app:029]: Running through setup()...
[11:43:56][C][esp32_ble:032]: Setting up BLE...
[11:43:56][C][wifi:048]: Setting up WiFi...
[11:43:56][C][wifi:061]: Starting WiFi...
[11:43:56][C][wifi:062]:   Local MAC: EC:64:C9:A8:C1:E0
[11:43:56][D][wifi:074]: Loaded saved wifi settings: ASUS
[11:43:56][D][wifi:482]: Starting scan...
[11:43:56][W][component:157]: Component wifi set Warning flag: scanning for networks
[11:43:56][D][esp32_ble:284]: Enabling BLE...
[11:43:56][D][esp32_ble_server:077]: BLE server setup successfully
[11:43:56][D][esp32_improv.component:082]: Creating Improv service
[11:43:58][D][wifi:497]: Found networks:


[11:44:55][D][esp32_improv.component:252]: Setting Improv to start
[11:44:55][C][web_server:100]: Setting up web server...
[11:44:55][C][api:026]: Setting up Home Assistant API server...
[11:44:55][I][app:062]: setup() finished successfully!
[11:44:55][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[11:44:55][D][esp32.preferences:114]: Saving 1 preferences to flash...
[11:44:55][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[11:44:55][W][component:157]: Component api set Warning flag: unspecified
[11:44:55][I][app:100]: ESPHome version 2024.11.1 compiled on Nov 25 2024, 08:39:04
[11:44:55][I][app:102]: Project esphome.web version 24.11.1
[11:44:55][C][wifi:600]: WiFi:
[11:44:55][C][wifi:428]:   Local MAC: EC:64:C9:A8:C1:E0
[11:44:55][C][wifi:433]:   SSID: [redacted]
[11:44:55][C][wifi:440]:   BSSID: [redacted]
[11:44:55][C][wifi:441]:   Hostname: 'esphome-web-a8c1e0'
[11:44:55][C][wifi:447]:   Channel: 1
[11:44:55][C][wifi:448]:   Subnet: 0.0.0.0
[11:44:55][C][wifi:449]:   Gateway: 0.0.0.0
[11:44:55][C][wifi:450]:   DNS1: 0.0.0.0
[11:44:55][C][wifi:451]:   DNS2: 0.0.0.0
[11:44:55][C][logger:185]: Logger:
[11:44:55][C][logger:186]:   Level: DEBUG
[11:44:55][C][logger:188]:   Log Baud Rate: 115200
[11:44:55][C][logger:189]:   Hardware UART: UART0
[11:44:55][C][esp32_ble:391]: ESP32 BLE:
[11:44:55][C][esp32_ble:393]:   MAC address: EC:64:C9:A8:C1:E2
[11:44:55][C][esp32_ble:394]:   IO Capability: none
[11:44:55][C][esp32_ble_server:200]: ESP32 BLE Server:
[11:44:55][C][esp32_improv.component:269]: ESP32 Improv:
[11:44:55][C][captive_portal:089]: Captive Portal:
[11:44:55][C][web_server:153]: Web Server:
[11:44:55][C][web_server:154]:   Address: esphome-web.local:80
[11:44:55][C][mdns:116]: mDNS:
[11:44:55][C][mdns:117]:   Hostname: esphome-web-a8c1e0
[11:44:55][D][esp32_improv.component:102]: Service started!
[11:44:55][C][esphome.ota:073]: Over-The-Air updates:
[11:44:55][C][esphome.ota:074]:   Address: esphome-web.local:3232
[11:44:55][C][esphome.ota:075]:   Version: 2
[11:44:55][C][safe_mode:018]: Safe Mode:
[11:44:55][C][safe_mode:020]:   Boot considered successful after 60 seconds
[11:44:55][C][safe_mode:021]:   Invoke after 10 boot attempts
[11:44:55][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[11:44:55][C][api:140]: API Server:
[11:44:55][C][api:141]:   Address: esphome-web.local:6053
[11:44:55][C][api:145]:   Using noise encryption: NO
[11:44:55][C][improv_serial:032]: Improv Serial:
[11:44:57][I][wifi:313]: WiFi Connecting to 'ASUS'...


[11:47:22][D][api:103]: Accepted 192.168.0.20
[11:47:22][W][component:170]: Component api cleared Warning flag
[11:47:22][D][api.connection:1446]: Home Assistant 2024.12.4 (192.168.0.20): Connected successfully

I think that maybe I am looking at the wrong device?
This ESPHome Web a8c1e0 device keeps getting discovered and I can’t get rid of it.
Huzzah is the one that I have configured and have sensors connected. It shows as offline but it is connected. I am updating it OTA.

Your log is from A8C1E0.
You didn’t answer to my question about use_address…

Hi Karosm,
They are the same device. I uninstalled and re-installed ESPHome, but as soon as I connect my ESP32 to serial port I get discovered device and then if I click “Take control”, Huzzah device appears of which I can edit yaml and install. The discovered one I can’t edit and can’t get rid of.
I thought use_address is to make sure the device gets static IP? I have the IP reserved for this device in my router config.

To set a static IP use

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Optional manual IP
  manual_ip:
    static_ip: 192.168.0.26
    gateway: 192.168.0.1
    subnet: 255.255.255.0

However I’d highly recommend you use a DHCP reservation on your router, I’d check you haven’t two devices with the same address.

1 Like

No, it’s a “one time code” to change static IP.
To set static IP, see the lines @EBME2 posted.
I personally prefer static IP …

Thank you everyone for your input. After a lot of head scratching, I tried another board with the sensor and it worked right of the bat.