Use an ESP32 board to send DHT to MQTT and then deep sleep
Here is an example of how I post humidity and temperature values that I collect from a DHT11 sensor. I use an ESP32 (Lolin32) board and I post values to a MQTT open source message broker (Eclipse Mosquitto) that I run alongside openhab on a Rpi3. Finally, I deep sleep the board to save energy. I use the following libraries: Arduino library for DHT11/DHT22 by Adafruit [>>] Arduino Client for MQTT (PubSubClient) by Nick O'Leary [>>] Arduino core for ESP32 WiFi chip [>>] To install CP210x Driver v10.1.1 for Lolin32 ESP32 there installation issue with Windows 10, build 1803. Check this post: [>>] /* Project ESP32, DHT, MQTT and Deepsleep */ #include <WiFi.h> #include <PubSubClient.h> #include "DHT.h" // Library for DHT sensors #define wifi_ssid "My_APs_ssid" //wifi ssid #define wifi_password "my_password" //wifi password #define mqtt_server "mqtt_broker_IP" // server name or IP #define mqtt_user "username" // username #define mqtt_password "password" // password #define temperature_topic [...]