DHT Sensor - custom_components

You have to comment first the dht related lines in your configuration.yaml.

sensor:
#  - platform: dht
#    sensor: AM2302
#    pin: 27
#    monitored_conditions:
#      - temperature
#      - humidity 

Click “Check Configuration” button and only then RESTART.
After it has restarted, uncomment the lines, recheck configuration and restart again.

2 Likes

Thank you so much!
Now everything works like before.
Daniele

how we will add version to manifest.json ? Help for a newbie :slight_smile:
i mean how we will write the code ?

answer to my question. i changed to that.

{
  "domain": "dht",
  "name": "DHT Sensor",
  "documentation": "https://www.home-assistant.io/integrations/dht",
  "version": "1.0.0",
  "requirements": [
    "adafruit-circuitpython-dht==3.7.0",
    "RPi.GPIO==0.7.1a4"
  ],
  "codeowners": [
    "@thegardenmonkey"
  ],
  "iot_class": "local_polling"
}
2 Likes

I’ve tried all of the above but still the same error: The system cannot restart because the configuration is not valid: Platform error sensor.dht - Integration ‘dht’ not found.

Any ideas?

You have to:

  • Or reboot
  • Or restart with the custom component but without the DHT definition, first, then only add the DHT to your HA.

See How to create a custom component from one removed from HA itself

2 Likes

Thanks, not quite sure why it didn’t work the first time so I deleted the dht folder and started again from that guide, and now working :slight_smile:

Not working again…

1 Like

After update to 2022.7.x not working again…

2 Likes

Any idea of if this integration is going to work again?

2 Likes

I just setup HA Core, I added DHT sensor and it is working.

Check if you have the folder dht inside custom_components folder and restart HA twice. That works to me.

You used python 3.9 in your venv, I presume?
I bet the component is broken when using python 3.10

The env is a raspberry pi 3.

I also think that the component is not compatible with python 9…. :frowning:

Hi, i have the same issue,
After updating to 2022.7.x (and thus python 3.10) the dht sensor is no longer working.
Should we wait for an update of the custom component dht to make it complient with python 3.10?

To be clear, if you followed the steps described here, the custom component will never autoupdate.

Any idea how to revive DHT in version 2022.8.1?

Hello guys,
I have the same issue here. I am on 2022.8.1 and still no dht sensors
I have tried:
‘’’ to remove the dht folder from custom_components and the dht code from configuration.yaml → reboot → reinstall the folder with the files → reboot → reinsert the dht code on configuration.yaml ‘’’
thank you for your time

Where did you donwload the component from?

I try this on rpi3 with latest 2022.8.4.

I downloaded component from here and put dht folder under custom_components. Then I added "version": "1.0.0", line in the manifest.json file and restart ha.
After restsrt I added sensor under sensors and when I check configuration I get infinite loop.

Like this:

error:

Unable to install package adafruit-circuitpython-dht==3.7.0: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [15 lines of output] running bdist_wheel running build running build_py Compiling ws281x library... creating build creating build/lib.linux-armv7l-cpython-310 creating build/lib.linux-armv7l-cpython-310/rpi_ws281x copying rpi_ws281x/rpi_ws281x.py -> build/lib.linux-armv7l-cpython-310/rpi_ws281x copying rpi_ws281x/__init__.py -> build/lib.linux-armv7l-cpython-310/rpi_ws281x running build_ext building '_rpi_ws281x' extension creating build/temp.linux-armv7l-cpython-310 creating build/temp.linux-armv7l-cpython-310/lib gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I. -I/usr/local/include/python3.10 -c lib/dma.c -o build/temp.linux-armv7l-cpython-310/lib/dma.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for rpi_ws281x error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [15 lines of output] ****************************************************************************** * Setup can't determine the value of PAGE_SIZE on your system, so it will * default to 4096 which may not be correct. * * Please report this message and your operating system info to the package * maintainer listed in the README file. ****************************************************************************** running bdist_wheel running build running build_ext building 'sysv_ipc' extension creating build creating build/temp.linux-armv7l-cpython-310 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.10 -c common.c -o build/temp.linux-armv7l-cpython-310/common.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for sysv_ipc error: subprocess-exited-with-error × Running setup.py install for sysv_ipc did not run successfully. │ exit code: 1 ╰─> [17 lines of output] ****************************************************************************** * Setup can't determine the value of PAGE_SIZE on your system, so it will * default to 4096 which may not be correct. * * Please report this message and your operating system info to the package * maintainer listed in the README file. ****************************************************************************** running install /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_ext building 'sysv_ipc' extension creating build creating build/temp.linux-armv7l-cpython-310 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.10 -c common.c -o build/temp.linux-armv7l-cpython-310/common.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> sysv_ipc note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
Unable to install package RPi.GPIO==0.7.1a4: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [15 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-armv7l-cpython-310 creating build/lib.linux-armv7l-cpython-310/RPi copying RPi/__init__.py -> build/lib.linux-armv7l-cpython-310/RPi creating build/lib.linux-armv7l-cpython-310/RPi/GPIO copying RPi/GPIO/__init__.py -> build/lib.linux-armv7l-cpython-310/RPi/GPIO running build_ext building 'RPi._GPIO' extension creating build/temp.linux-armv7l-cpython-310 creating build/temp.linux-armv7l-cpython-310/source gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.10 -c source/c_gpio.c -o build/temp.linux-armv7l-cpython-310/source/c_gpio.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for RPi.GPIO error: subprocess-exited-with-error × Running setup.py install for RPi.GPIO did not run successfully. │ exit code: 1 ╰─> [17 lines of output] running install /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build/lib.linux-armv7l-cpython-310 creating build/lib.linux-armv7l-cpython-310/RPi copying RPi/__init__.py -> build/lib.linux-armv7l-cpython-310/RPi creating build/lib.linux-armv7l-cpython-310/RPi/GPIO copying RPi/GPIO/__init__.py -> build/lib.linux-armv7l-cpython-310/RPi/GPIO running build_ext building 'RPi._GPIO' extension creating build/temp.linux-armv7l-cpython-310 creating build/temp.linux-armv7l-cpython-310/source gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.10 -c source/c_gpio.c -o build/temp.linux-armv7l-cpython-310/source/c_gpio.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. WARNING: No metadata found in /usr/local/lib/python3.10/site-packages error: legacy-install-failure × Encountered error while trying to install package. ╰─> RPi.GPIO note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

Any idea what is wrong?

I think this addon is not compatible with latest Home assistant yet

:frowning: