DHT

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.


Sensor Interface

Provides a sensor that returns DHT readings.

OptionTypeRequiredDescription
key[String]YesUnique slug id for the component
pin[String]YesGPIO pin to use on board i.e. D12.
name[String]NoFriendly display name of component. Useful for UI.
model[String]NoModel of DHT device to use. Options: 11, 22 or 2302. Default: 11
read_attempts[Integer]NoNumber 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.

Config Examples

Here is a config of a complete dht sensor.

"sensor": [{
    "key": "dht_sensor_D12",
    "interface": "dht",
    "pin": "D12",
    "model": "22"
}]

Data

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.