Documentation
Humidity Sensor (Pi)
Read humidity and temperature from DHT11, DHT21, or DHT22 sensors connected to the Raspberry Pi.
Overview
Humidity and temperature can be important for a number of applications such as regulating environmental controls. Using a commercially available sensor (DHT11 or DHT22) you can take a digital read of humidity and temperature (in °F).
Warning
The DHT Legacy extension (dht_legacy interface) is deprecated as of v0.11.0 and incompatible with Python 3.9+. Use the DHT extension (dht interface) instead.
Note
The core can be expanded to support sensors of other models as well.
Configuration
JSON
{
"sensors": [
{
"pin": 4,
"type": "Humidity",
"model": "22",
"name": "Greenhouse Humidity"
}
]
}
Settings
| Property | Value | Description |
|---|---|---|
type |
Humidity |
Sensor type identifier |
model |
11, 21, or 22 |
DHT model number (default: 11) |
Returns
Object — Contains humidity and temperature readings:
Response
{
"humidity": 65.2,
"temperature": 72.4
}