ESPHome turns a few-franc ESP32 board into a Home Assistant device, configured with a short YAML file. This one reports temperature and humidity from a DHT22 sensor on GPIO4.
esphome: name: living-room-sensor esp32: board: esp32dev wifi: ssid: !secret wifi_ssid password: !secret wifi_password logger: api: ota: - platform: esphome sensor: - platform: dht pin: GPIO4 model: DHT22 temperature: name: "Living room temperature" humidity: name: "Living room humidity" update_interval: 60s