The dht
extension connects to a digital humidity temperature (DHT) device to gather temperature
and humidity
readings. Through the support of adafruit-circuitpython-dht
you can use a large variety of supported linux boards.
This extension does not take an extension level config and is focused on interfaces.
Provides a sensor that returns DHT readings.
Option | Type | Required | Description |
key | [String] | Yes | Unique slug id for the component |
pin | [String] | Yes | GPIO pin to use on board i.e. D12 . |
name | [String] | No | Friendly display name of component. Useful for UI. |
model | [String] | No | Model of DHT device to use. Options: 11 , 22 or 2302 . Default: 11 |
read_attempts | [Integer] | No | Number of times to try and get a valid reading. Each read waits the recommended 2.1s between each attempt. Default: 3 Avoid locks and keep this under 5. |
Here is a config of a complete dht sensor.
"sensor": [{
"key": "dht_sensor_D12",
"interface": "dht",
"pin": "D12",
"model": "22"
}]
Here is an example of the data returned by the DHT:
{
"temperature": 50,
"humidity": 64
}
Note: DHT is a finicky sensor and it has been known to have high read fail rates. ARMv6 may experience issues with DHT more frequently.