DHT22 temp/humidity sensor setup - GPIO on RP4?

Hi - I am trying to configure my DHT22 temp/humidity sensor - but I am seeing an error. I am running HA on a RP4, Home Assistant OS 5.8.

Are GPIO no longer supported with RP4?

configuration.yaml

sensor
  - platform: dht
    sensor: DHT22
    pin: 4
    monitored_conditions:
      - temperature
      - humidity
# more home-assistant.log|grep dht
➜  config git:(master) ✗ more home-assistant.log|grep dht
2020-12-15 13:28:47 INFO (SyncWorker_1) [homeassistant.loader] Loaded dht from homeassistant.components.dht
2020-12-15 13:28:48 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.dht
2020-12-15 13:28:50 ERROR (MainThread) [homeassistant.components.sensor] dht: Error on device update!
  File "/usr/src/homeassistant/homeassistant/components/dht/sensor.py", line 137, in update
    self.dht_client.update()
  File "/usr/src/homeassistant/homeassistant/components/dht/sensor.py", line 173, in update
    humidity, temperature = self.adafruit_dht.read_retry(self.sensor, self.pin)
2020-12-15 13:28:51 ERROR (MainThread) [homeassistant.components.sensor] dht: Error on device update!
  File "/usr/src/homeassistant/homeassistant/components/dht/sensor.py", line 137, in update
    self.dht_client.update()
  File "/usr/src/homeassistant/homeassistant/components/dht/sensor.py", line 173, in update
    humidity, temperature = self.adafruit_dht.read_retry(self.sensor, self.pin)

Known issue.

OK, thanks! I thought I was going crazy…

Mine was fine but stopped working when I installed OS 5.8.

I get this message:

dht: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    await task
  File "/usr/local/lib/python3.8/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 239, 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.8/site-packages/Adafruit_DHT/common.py", line 94, in read_retry
    humidity, temperature = read(sensor, pin, platform)
  File "/usr/local/lib/python3.8/site-packages/Adafruit_DHT/common.py", line 80, in read
    platform = get_platform()
  File "/usr/local/lib/python3.8/site-packages/Adafruit_DHT/common.py", line 63, in get_platform
    raise RuntimeError('Unknown platform.')
RuntimeError: Unknown platform.

Same exact problem as yours with the same LOG.
Before 2020.12 update. it worked without problems.
I hope it will be solved as all my automations based on external environmental parameters are affected by this sensor.

Is there any news for this integration? I see they are working on it but I don’t understand if the programmers have found the solution.
thanks

1 Like