pio\libdeps\esp32dev\DHT sensor library\DHT_U.h:36:29: fatal error: Adafruit_Sensor.h: No such file or directory

The DHT library doesn’t work smoothly with PlatformIO. See other threads in this forum (e.g. Library dependency problem related to Core 5.0?).

The solution is simple. Add the following include statements to main.cpp:

#include <Adafruit_Sensor.h>
#include <DHT.h>