ESP32-Wroom-32u + DHT22 problems

So I’m pretty new to ESP32’s but I have some background with Arduino and was able to program this ESP32 with the DHT22 and get results fine but I cannot get it to work with ESPhome.

I can get through the initial installation and ESPhome will see it as connected but when I add in the DHT22 settings and reflash it the device goes offline and doesn’t work.

I have it on D14 on the ESP32 but that gave me problems until I changed it to GPIO14 which the installation accepted but still does not work.

Here is the code I’m using:

esphome:
  name: esphome-web-2c26d8

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "ra7/0ngFAyZe8rhnlshB2PNjaGnOAyDm/AS4YicQEec="

ota:


wifi:
  ssid: "Router"
  password: "Password"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-2C26D8"
    password: "12BkqqTRGphO"

captive_portal:
    
# Example configuration entry
sensor:
  - platform: dht
    pin: GPIO14
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 60s

I would appreciate any insight/direction on what I am doing wrong or if maybe I should use a different board that is more compatable for this or not.

Thank you!

Try specifying the full model of the DHT chip you are using, use model:

  • model (Optional, int): Manually specify the DHT model, can be one of AUTO_DETECT, DHT11, DHT22, DHT22_TYPE2, AM2302, RHT03, SI7021 and helps with some connection issues. Defaults to AUTO_DETECT. Auto detection doesn’t work for the SI7021 chip.
sensor:
  - platform: dht
    pin: GPIO14
    model: DHT22
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 60s

i had tried that before but did forget to specify it in the code when I made this post. It still puts the ESP32 offline as soon as I update it.

Wondering now if I should just get a different ESP32 that is more compatible.