the DHT22/AM2301 did not work on Sonoff S20 and NodeMCU (possibly microsecond delay not exact enough??) and gave only "null" values for temperature and humidity.
So I changed the way to determine if a bit is "0" or "1" by measuring the time in microseconds until state changes. If time > 50 usec (in data sheet it should be 80 usec), it is recognized as "1", otherwise (a "0" should be 26-28 usec by specs from data sheet) it is treated as "0".
Also, the old version omitted the first bit (by waiting the sequence 0 - 1 - 0, I have changed it to the only first "0"
This change has been tested on Sonoff S20 (on GPIO 3) and on NodeMCU (GPIO 2) on Tasmota version 9.3.1.4 (on version 9.5. it should make no difference) with a DHT22 with included pull-up resistor
Add another new DHT driver based on ESPEasy. The old driver can still be used using define USE_DHT_OLD. The previous new driver can be used with define USE_DHT_V2 (#7717)
- Fix Hass sensor discovery part 1/4 by Federico Leoni (#7582, #7548)
- Add support for sensor DHT family on Shelly 1 and Shelly 1PM using Shelly Add-On adapter (#7469)