DIY: Cheap wifi-based temperature/humidity sensor based on ESP8266 & DHT22

https://shelly.cloud/product/shelly-wifi-humidity-and-temperature-sensor/

This thingy is ESP8266 based with a CR123A – 3V 1400mAh Battery and supposed to last 1 year.
And yes you can Reflash it.

Downside is the price of about 24$

Good day, everyone. Digging this old thread up, it’s the most relevant that I could find.
I have a few NodeMCU ESP-12P development boards and AM2302 (DHT22) sensors and the goal is to get them inputting via my Mosquitto MQTT. An added handicap is that I’ve done very little with Arduino and don’t quite get many of those programming commands yet.
I found a very simple program to load into the board and via serial monitor can get it to show output values. But when I get to the point of configuring values to feed to openhab via MQTT…it’s gets very fuzzy for me. Does someone have a good workable example I can use to learn? The code examples above are old and I’m having trouble getting them to work at all.
Thanks in advance for the help.

If you want an easy route: flash the esp8266 with Tasmota.

You’ll then be able to get at the data using the MQTT binding.

Related: Tasmota flashed Sonoff Basic with DHT22 via MQTT

Of course, if this is an exercise in getting your own code to work, check some similar projects to see how they handle MQTT.

Another solution available recently is an LYWSD03MMC + an ESP32, no soldering required, you will have a cheap, durable, low power solution to get temperature and humidity.
More info below:

Huh. I hadn’t thought of that. I have a few Sonoff Basics laying around and I may try this. I’d still like to get the NodeMCU work as well, it will help me learn some of those programming skills. But I have been successful in getting the Sonoff/Tasmotas on my system to work. Thanks, great suggestion!

You don’t need to use the Basics - you should be able to flash your NodeMCU with Tasmota too.