DHT and "Object not found"

Hi there!
Sorry for my question, I’m a newbie in Homeassistant =)
I have a DHT22 sensor and there was all worked until I have issued a “sudo apt-get upgrade” command and following reboot.
Now I can see an “object not found” label in lovelace.
I can’t add any card with object “sensor.kitchen”, cause I haven’t see that in list of available sensors.
This is my configuration.yaml code:

sensor:
  - platform: command_line
    name: Pi temperature
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "  C"
    value_template: '{{ value | multiply(0.001) | round(1) }}'

  - platform: dht
    sensor: DHT22
    pin: 4
    name: Kitchen
    monitored_conditions:
      - temperature
      - humidity

All other sensors, exclude dht22 on pin4, working well…
Meanwhile, hass --script check_config don’t shows me any errors:

homeassistant@raspberrypi:~/.homeassistant $ hass --script check_config
Testing configuration at /home/homeassistant/.homeassistant
homeassistant@raspberrypi:~/.homeassistant $

And finally, I run a py script and there my dht22 board running well and shows me a correct values.

So, I need help to fix it, guys!
Thank you!

upd. Here is a log of Home assistant:

dht: Error on device update!
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 319, in _async_add_entity
await entity.async_device_update(warning=False)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 466, in async_device_update
self.update # type: ignore
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/dht/sensor.py”, line 137, in update
self.dht_client.update()
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/util/init.py”, line 239, in wrapper
result = method(*args, **kwargs)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/dht/sensor.py”, line 173, in update
humidity, temperature = self.adafruit_dht.read_retry(self.sensor, self.pin)
File “/srv/homeassistant/lib/python3.7/site-packages/Adafruit_DHT/common.py”, line 94, in read_retry
humidity, temperature = read(sensor, pin, platform)
File “/srv/homeassistant/lib/python3.7/site-packages/Adafruit_DHT/common.py”, line 80, in read
platform = get_platform()
File “/srv/homeassistant/lib/python3.7/site-packages/Adafruit_DHT/common.py”, line 60, in get_platform
from . import Beaglebone_Black
File “/srv/homeassistant/lib/python3.7/site-packages/Adafruit_DHT/Beaglebone_Black.py”, line 24, in
from . import Beaglebone_Black_Driver as driver
ImportError: cannot import name ‘Beaglebone_Black_Driver’ from ‘Adafruit_DHT’ (/srv/homeassistant/lib/python3.7/site-packages/Adafruit_DHT/init.py)

is anybody here?=(

Yes, many people here. But I doubt if there are any people here who have connected a DHT22 straight to a Pi.

1 Like

I’ve found a solution for my problem. Seems after system updates the hardware name in the /proc/cpuinfo on my raspberry pi4 has been changed.
So, it is necessary to edit a platform_detect.py in /usr/local/lib/python3.7/dist-packages/Adafruit_DHT/ directory.
All you need it is add next few strings in def pi_version(): function:

elif match.group(1) == 'BCM2711': return 3

After that all works fine =)