D01 Particulate Matter Sensor
The d01 sensor platform allows you to use YYS D01 particulate matter sensors (datasheet)
with ESPHome. This is a similar form factor to the PM1006 sensor, though not a direct replacement. The sensor itself is based on the GD32 MCU and outputs UART. It reports a range of 5~2500µg/m³ particle concentration, though these are the uncalibrated limits. See the filter section below for proper calculation. The effective range is 0~1000µg/m³.

Communication is done using UART, so for setup, you need to have an UART bus in your configuration with the rx_pin connected to the TX pin of the D01. The baud rate needs to be set to 9600.
# Example configuration entryuart: rx_pin: GPIO4 #D2 baud_rate: 9600
sensor: - platform: d01 name: "D01 PM2.5 Concentration" filters: - lambda: return (x - 5.0) * 0.4;This implementation will passively pick up whatever the sensor reports. It automatically sends out its packets every 1.4 seconds upon receiving 5v.
Configuration variables
Section titled “Configuration variables”- uart_id (Optional, ID): Manually specify the ID of the UART Component if you want to use multiple UART buses.
- All other options from Sensor.