Grove DHT20 Custom Input

Hi,

I’m trying to use the Grove DHT20 temp/hum sensor, which I believe is the updated DHT11, a currently supported input. Is it possible to upload a modified DHT11 py file, and if so, any chance there is some guidance on that? This is only my second pi project, so I’m pretty new to programming. Any help would be greatly appreciated!

Colby

Hi Colby,
The DHT11 and DHT22 sensors do not use I2C to communicate like the DHT20. Therefore, I would not recommend merely taking the DHT11 or DHT22 Inputs and modifying them to work with the DHT20. I would recommend using a simple I2C temperature/humidity Input, such as ahtx0_circuitpython.py, as a template. You’ll then need to modify it slightly to have a unique name and use the proper Python library to read the sensor, then you can import the input module into Mycodo. There’s a guide to building custom inputs that explains this in more detail.

Thank you! I’ll give it a shot.

Everything seems to have gone fairly well following the custom input instructions; however, after installing without errors, it still says that dependencies are not installed.

Since I have little experience with creating packages on github, I’m assuming that’s where my error is… but not sure how to proceed without any errors messages.

Any suggestions?


[2022-03-20 14:06:12] Dependency installation beginning. Installing: dht20

[2022-03-20 14:06:12]
[2022-03-20 14:06:12] #### Installing/updating git+https://github.com/colbychristian/pitent.git#egg=dht20 (pip-git)
[2022-03-20 14:06:15] Looking in indexes: Simple index, piwheels - Simple index
[2022-03-20 14:06:15] Obtaining dht20 from git+https://github.com/colbychristian/pitent.git#egg=dht20
[2022-03-20 14:06:15] Updating ./env/src/dht20 clone
[2022-03-20 14:06:15] Running command git fetch -q --tags
[2022-03-20 14:06:15] Running command git reset --hard -q 7cbaca1754eef4a42db3f1aea1b9ce99e9b37d1a
[2022-03-20 14:06:16] Preparing metadata (setup.py): started
[2022-03-20 14:06:17] Preparing metadata (setup.py): finished with status ‘done’
[2022-03-20 14:06:21] Installing collected packages: dht20
[2022-03-20 14:06:21] Attempting uninstall: dht20
[2022-03-20 14:06:21] Found existing installation: DHT20 0.0.1
[2022-03-20 14:06:21] Can’t uninstall ‘DHT20’. No files were found to uninstall.
[2022-03-20 14:06:21] Running setup.py develop for dht20
[2022-03-20 14:06:23] Successfully installed dht20-0.0.1
[2022-03-20 14:06:23] WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
[2022-03-20 14:06:23] You should consider upgrading via the ‘/home/pi/Mycodo/env/bin/python -m pip install --upgrade pip’ command.

[2022-03-20 14:06:24] End install of dht20

[2022-03-20 14:06:24]
[2022-03-20 14:06:24] #### Setting permissions

[2022-03-20 14:06:25] #### Dependencies installed. Restarting frontend and backend…

[2022-03-20 14:06:31] #### Dependency install complete.