{
    "key": "dht22",
    "kind": "sensor",
    "model": {
        "aliases": [
            "dht22",
            "am2302"
        ]
    },
    "driver": {
        "runtime": {
            "init": {
                "args": {
                    "pin": "board.D{data_pin}",
                    "use_pulseio": false
                },
                "class": "adafruit_dht.DHT22"
            },
            "apt_packages": [
                "swig",
                "liblgpio-dev",
                "python3-libgpiod"
            ],
            "pip_packages": [
                "adafruit-circuitpython-dht",
                "lgpio",
                "gpiod"
            ],
            "python_module": "drivers.dht22"
        },
        "targets": [
            "raspberrypi"
        ],
        "verified": {
            "by": null,
            "os": null,
            "date": null,
            "board": "Raspberry Pi",
            "reviewed_by": null,
            "evidence_url": null
        },
        "interface": "gpio-single-wire",
        "connection": {
            "pins": [
                {
                    "role": "data",
                    "notes": "Any free GPIO.",
                    "required": true
                }
            ],
            "pullup_ohms": 10000,
            "supply_voltage": "3.3V or 5V"
        },
        "constraints": {
            "warmup_seconds": null,
            "read_timeout_seconds": 5,
            "min_read_interval_seconds": 2
        },
        "failure_modes": [
            "Intermittent read failure is expected behaviour. The driver raises RuntimeError on a checksum or timing failure and the caller must retry on the next cycle.",
            "A successful call can still return None for either value. Both temperature and humidity must be checked for None before publishing.",
            "Polling faster than every 2 seconds returns stale or failed reads.",
            "use_pulseio must be false on Raspberry Pi. With pulseio enabled the read path fails continuously under load.",
            "Sustained failure across many consecutive cycles indicates wiring rather than the expected intermittency."
        ]
    },
    "source": "platform-seed",
    "status": "draft",
    "platform": {
        "name": "DHT22 Temperature & Humidity Sensor",
        "protocol": "1wire",
        "readings": [
            {
                "slug": "temperature",
                "unit": "degrees celsius",
                "label": "Temperature",
                "data_type": "float",
                "range_max": 80,
                "range_min": -40,
                "unit_symbol": "°C",
                "device_class": "temperature",
                "decimal_places": 1,
                "threshold_crit_low": 0,
                "threshold_warn_low": 10,
                "threshold_crit_high": 40,
                "threshold_warn_high": 30
            },
            {
                "slug": "humidity",
                "unit": "percent",
                "label": "Relative Humidity",
                "data_type": "float",
                "range_max": 100,
                "range_min": 0,
                "unit_symbol": "%",
                "device_class": "humidity",
                "decimal_places": 1,
                "threshold_crit_low": 20,
                "threshold_warn_low": 30,
                "threshold_crit_high": 85,
                "threshold_warn_high": 70
            }
        ],
        "description": "Digital capacitive humidity and temperature sensor. Single-wire serial output. Suitable for indoor climate monitoring.",
        "sensor_type": "environmental",
        "manufacturer": "Aosong",
        "model_number": "DHT22",
        "datasheet_url": "https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf",
        "read_interval_seconds": 30
    },
    "revision": 1
}