WeMos Temperature & humidity sensor - JiltedGeek/HomeAssistant GitHub Wiki
The yaml code for my ESPHome WeMos (8266 D1 mini) and a connected DHT11 sensor to 3.3v, GND and pin D4 named Living Room Temperature and Living Room Humidity with a refresh of 60 seconds.
sensor: - platform: dht pin: D2 model: AM2302 temperature: name: "Living Room Temperature" humidity: name: "Living Room Humidity" update_interval: 60s
The DHT22 and DHT11 require external pull up resistors on the data line. To do this, solder a resistor with about 4.7kΩ (anything in the range from 1kΩ to 10kΩ probably works fine, but if you’re having issues try the 4.7kΩ recommended by the manufacturer) between DATA and 3.3V.
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.
![image]()