Latest release of ESPHome broke my DHT-sensor code:
captive_portal:
sensor:
- platform: dht
pin: 16 #is Pin GPIO Pin 16, D0
temperature:
name: "Technikraum Temperatur“
humidity:
name: "Technikraum Luftfeuchte“
update_interval: 30s
Error message is: „pin 16 has no pullup, choose another pin“.
I’m using a pull-up resistor for all my dhts. Is there a way to tell ESPHome, that I don’t care about the pin#, because there is a pull-up resistor? I do not want to open 25 boxes, all over the houses and change the hardware, because of a software feature
I checked the docu without success.
Did you try something like
pin:
number: GPIO16 #D0
mode:
input: true
pullup: true
to overcome the software?
It’s a “feature” not a bug
dev
← deCodeIt:rp2040-dht
opened 04:42AM - 16 Feb 25 UTC
# What does this implement/fix?
The DHT11 and DHT22 modules that already have a… n external resistor were not returning any readings with the Raspberry Pi pico w ( RP2040 ) board. The root cause was the configuration of the internal pull-up resistor, which once disabled, the module worked properly and returned proper values.
The following DHT modules were used. They contain SMD 103 on-board resistor - 10K-Ohm.
DHT22 - https://quartzcomponents.com/products/dht22-temprature-and-humidity-sensor-module
DHT11 - https://quartzcomponents.com/products/dht11-temperature-humidity-sensor-module
## Types of changes
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Code quality improvements to existing code or addition of tests
- [ ] Other
**Related issue or feature (if applicable):**
- fixes https://github.com/esphome/issues/issues/4615
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):**
- esphome/esphome-docs#4673
## Test Environment
- [ ] ESP32
- [ ] ESP32 IDF
- [ ] ESP8266
- [x] RP2040
- [ ] BK72xx
- [ ] RTL87xx
## Example entry for `config.yaml`:
```yaml
- platform: dht
model: DHT22
pin:
number: GPIO19
mode:
input: true
pullup: false
temperature:
name: "Room Temperature"
humidity:
name: "Room Humidity"
update_interval: 5s
```
## Checklist:
- [x] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works (under `tests/` folder).
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs).
PS.: You also can make use of the esphome category to reach a wider audience
This category is for everything about ESPHome. Topics do not have to be Home Assistant related.
Karosm
(Karosm)
March 18, 2025, 1:56pm
3
Looks like DHT component defaults to have internal pullup, which 16 doesn’t have.
Try:
pin:
number: 16
mode:
input: true
pullup: false
Thanks to you all This version is working fine:
captive_portal:
sensor:
- platform: dht
model: DHT11
pin:
number: GPIO16
mode:
input: true
pullup: false
temperature:
name: "Technikraum Temperatur"
humidity:
name: "Technikraum Luftfeuchte"
update_interval: 30s
1 Like