DHT 11 Sensor in HA

Hi,
Ive tried to use new function of release 0.7 and cannot force it to work.
I use the following:

sensor:
  platform: dht
  sensor: DHT11
  pin: 4
  monitored_conditions:
    - temperature
    - humidity

connected to my pi zero w. The sensor is connected to pin 7 on the board that’s named GPIO4 so should be correct right?

I get following error when I reboot HA.

2020-03-20 21:29:46 ERROR (MainThread) [homeassistant.components.sensor] dht: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 312, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/dht/sensor.py", line 137, in update
    self.dht_client.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/dht/sensor.py", line 173, in update
    humidity, temperature = self.adafruit_dht.read_retry(self.sensor, self.pin)
  File "/usr/local/lib/python3.7/site-packages/Adafruit_DHT/common.py", line 94, in read_retry
    humidity, temperature = read(sensor, pin, platform)
  File "/usr/local/lib/python3.7/site-packages/Adafruit_DHT/common.py", line 80, in read
    platform = get_platform()
  File "/usr/local/lib/python3.7/site-packages/Adafruit_DHT/common.py", line 55, in get_platform
    from . import Raspberry_Pi_2
  File "/usr/local/lib/python3.7/site-packages/Adafruit_DHT/Raspberry_Pi_2.py", line 22, in <module>
    from . import Raspberry_Pi_2_Driver as driver
ImportError: cannot import name 'Raspberry_Pi_2_Driver' from 'Adafruit_DHT' (/usr/local/lib/python3.7/site-packages/Adafruit_DHT/__init__.py)

Can anyone advise on what could be wrong? I’m also using standard Hassos here downloaded from HA github.

1 Like