Skip to content

Commit

Permalink
Updates to support the circuitpython version (home-assistant#15161)
Browse files Browse the repository at this point in the history
Co-authored-by: Angelo Gagliano <[email protected]>
  • Loading branch information
fabaff and TheGardenMonkey authored Apr 28, 2021
1 parent 355e29d commit b8e8158
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions source/_integrations/dht.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,32 @@ ha_platforms:

The `dht` sensor platform allows you to get the current temperature and humidity from a DHT11, DHT22 or AM2302 device.

## Setup

To use your DHTxx sensor in your installation, you must first install the `libgpiod2` library.

```shell
sudo apt install libgpiod2
```

## Configuration

To use your DHTxx sensor in your installation, add the following to your `configuration.yaml` file:
Add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry
sensor:
platform: dht
sensor: DHT22
pin: 23
pin: D23
monitored_conditions:
- temperature
- humidity
```
{% configuration %}
sensor:
description: The sensor type, supported devices are DHT11, DHT22, and AM2302.
description: The sensor type, supported devices are DHT11, DHT22 and AM2302.
required: true
type: string
pin:
Expand Down Expand Up @@ -63,7 +71,7 @@ humidity_offset:
type: [integer, float]
{% endconfiguration %}
The name of the pin to which the sensor is connected has different names on different platforms. 'P8_11' for Beaglebone, '23' for Raspberry Pi.
The name of the pin to which the sensor is connected has different names on different platforms. 'P8_11' for Beaglebone, 'D23' for Raspberry Pi.
### Example
Expand All @@ -73,7 +81,7 @@ An example for a Raspberry Pi 3 with a DHT22 sensor connected to GPIO4 (pin 7):
sensor:
- platform: dht
sensor: DHT22
pin: 4
pin: D4
temperature_offset: 2.1
humidity_offset: -3.2
monitored_conditions:
Expand Down

0 comments on commit b8e8158

Please sign in to comment.