A networked thermostat needs two paths to work: measurements going out and heating commands coming back. Jorge’s thermostat prototype on Hackaday.io, created on August 2, 2016, explores both with an ESP8266 running MicroPython, an OLED display and an MQTT connection to OpenHab. The boiler is represented by an LED, keeping the demonstrated control path firmly on the workbench.
The interesting detail is how the device gets its next command. Jorge used retained MQTT messages so an on/off state would be available when the ESP8266 checked for one—a small implementation choice that also brings restart behavior and stale commands into focus.
A small device, with decisions elsewhere
The hardware combines a NodeMCU ESP12 board, a DHT22 temperature-and-humidity sensor and a 128×64 SSD1306 OLED connected over I2C. The ESP8266 displays readings locally and sends them over Wi-Fi to a Mosquitto MQTT broker. A Linux machine runs the broker and OpenHab; the component list specifies a Raspberry Pi for those jobs.
Jorge intended OpenHab to hold the automation logic and handle SQL data storage, rather than putting all the decision-making on the microcontroller. That division was also the basis for a broader plan: reuse similar modules for lights, blinds, appliances and valves. Those were proposed extensions, not demonstrated features of this thermostat.
The build came together one interface at a time. In the August 3, 2016 development log, Jorge describes starting with the DHT22, then trying simple OLED messages, then adding MQTT. Combining everything caused memory problems, and the display had to come out temporarily while he reduced memory use. It’s a useful reminder that separate working examples don’t necessarily fit comfortably together on a small board.
Why retain the command?
The OpenHab configuration log maps temperature and humidity to /sensor1/tem and /sensor1/hum, with LED commands on /sensor1/led. It also enables retained publishing and QoS 1.
The distinction matters: retention makes the latest command available to a subscriber; it doesn’t decide whether that command is still appropriate. Jorge’s aim was to have an on/off message waiting whenever the ESP8266 came to read it. His message-handling log, also dated August 3, says the device checked for messages in its main loop every ten seconds rather than using interrupts.
A December 2016 exchange shows why this mattered in practice. Commenter photojpl360 reported that LED commands worked, but the program appeared to stop at c.wait(), preventing other tasks from running. Jorge’s answer was to enable message persistence on the server so there would be something to read. That was his workaround for the waiting behavior, not evidence of a fully nonblocking control loop.
For an LED demonstration, receiving the remembered state is a convenient way to reconnect the pieces. For heating control, it raises a separate design question: should a device obey an old “on” command after rebooting, or first establish that its readings and controller connection are valid?
The unfinished part is failure handling
Connection loss was already on Jorge’s list in August 2016. He reported problems with the MQTT functions when the broker connection disappeared and planned to investigate umqtt.robust; the excerpt does not record a completed fix.
In his December 6, 2018 update, Jorge said he hadn’t done much more work on the project. He would then have chosen Home Assistant instead of OpenHab, but described that as a preference, not a completed migration. Unexpected reboots, Raspberry Pi failure and ESP8266 failure remained unresolved.
The linked project repository offers a starting point for exploring the implementation. Treat it as a period prototype rather than a current plug-and-play recipe: visible comments from 2016–2018 include MQTT import and subscription errors from other builders.
The lasting lesson is the separation between moving messages and making dependable control decisions. This project demonstrates the sensor-to-server and server-to-output paths. The next meaningful milestone would be an explicit, tested policy for startup, lost connections and outdated commands—before replacing the LED with anything that controls heat.