WiFi thermostat project at Github: WiFi thermostat
Support the WiFi thermostat project via PayPal. Support will allow you to add new features in the future and open the source code of the application: PayPal donate
ESP8266 ESP32 WiFi DS18B20 OneWire Dallas HTML Webserver WebSocket JSON mDNS UART

Launch of the WiFi Thermostat Project - ESP8266 / ESP32

The WiFi thermostat project is available in multiple versions, which can be accessed through the official GitHub repository. Each version offers different functionalities, primarily concerning advanced usage options and the ability to update firmware remotely.

The firmware is provided in a compiled binary form, which is pre-tested and ready for use with the target platform. This universal firmware ensures consistent functionality across various microcontrollers that are compatible with the program.

Note: The free version is available only as a compiled binary program, without access to the source code in .ino format.

Firmware distribution based on supported WiFi platforms


  • ESP8266 - target platform with ESP8266 chip in versions 12E to 12F (conditioned by flash DIO method)
  • ESP32 - target platform with ESP-32S chip (AI-Thinker), ESP32-WROOM-32 (Espressif Systems)

  • Firmware distribution by function


    Available firmware (.bin) for ESP8266 and ESP32 microcontrollers. Firmware upload is done via esptool - part of the downloaded .zip firmware archive.
    Firmware name Firmware features ESP8266 ESP32
    WiFi_TERMOSTAT Thermostat with the possibility of setting the target temperature and hysteresis via a web interface, controlled automatically ESP8266 EN firmware ESP32 EN firmware
    WiFi_TERMOSTAT_mDNS Thermostat with the possibility of setting the target temperature and hysteresis via a web interface, controlled automatically. Possibility to use a domain name within the LAN network (mDNS record) for connection with thermostat ESP8266 EN firmware ESP32 EN firmware
    WiFi_TERMOSTAT_MANUAL_experimental Thermostat with the possibility of setting the target temperature and hysteresis via a web interface, controlled automatically. Experimental possibility of manual control of SW output by a button from a web server. Switching heating control modes automatic / manual. ESP8266 SK firmware ESP32 SK firmware

    Uploading Firmware to the ESP Platform

    To upload the binary program to the ESP platform, the ESPTOOL tool must be used. This tool can be accessed through the Arduino IDE or the Espressif Systems' development framework, ESP-IDF, for uploading compiled programs.

    Note: For the ESP32 platform, hold the BOOT button until the "Connecting ........_____....." message appears or use a pulldown on GPIO 0 if your development kit does not have a BOOT button.

    An automated executable .bat script is included in each firmware folder. This script has the COM port set to COM7 for ESP8266 and COM17 for ESP32, automatically launching ESPTOOL to upload the firmware to the microcontroller.

    Device Manager - Windows - a registered ESP microcontroller
    Device Manager showing a registered ESP microcontroller

    The destination COM port must be adjusted based on the COM port where your board/microcontroller is logged in. This can be found in the Peripherals and Drivers Manager on your computer.

    The ESP8266 microcontroller on NodeMCU/Wemos D1 Mini development kits typically uses the CH340 USB-UART converter, which appears in the device manager under that name. The ESP32 often uses the CP2102 USB-UART converter from Silicon Labs, listed as the "CP210X USB UART Bridge."

    The program implementation for the ESP8266 assumes the board already has the essential parts of the flash memory loaded, such as the partition table. The binary program provided is exclusively the thermostat application, with no additional bundled parts.

    Once the firmware is loaded, ESPTOOL automatically shuts down and performs a software restart of the ESP platform, which boots the new firmware, preparing the WiFi thermostat for use.

    For the ESP8266, the firmware is written to the standard offset 0x00000 (no partition table included). For ESP32, the partition table is written to offset 0x8000, the bootloader to offset 0x1000, and the firmware itself is written to 0x10000.

    ESPTOOL - a tool for uploading firmware to the ESP8266 / ESP32 microcontroller
    ESPTOOL tool for uploading firmware to ESP8266/ESP32 microcontrollers

    Once the binary program (firmware) is successfully loaded, the thermostat is fully operational.

    If the WiFi credentials are not stored in the flash memory (e.g., after a fresh flash), the device will start broadcasting its own SSID: WiFi_TERMOSTAT_AP.

    Connect to the WiFi network using a smartphone or computer, and then access the WiFi Manager web interface at 192.168.4.1. From there, you can configure the WiFi thermostat to connect to your home WiFi network by entering the network name (SSID) and password.

    Important: The WiFi thermostat will only be operational after successfully connecting to your LAN network and receiving an IP address.

    After connecting to the home WiFi network, the ESP will stop broadcasting the SSID, switch to STA (Station) mode, and operate as a thermostat. The WiFi credentials are stored in the flash memory, so there is no need to enter them again after a restart or power failure.

    If the network is unavailable, the ESP will begin broadcasting its SSID again as WiFi_TERMOSTAT_AP, allowing you to re-enter the credentials. The thermostat can be accessed by its IP address (which is also displayed every 10 seconds on the UART) or via the local mDNS address: http://WiFi-thermostat.local. The mDNS service is available only after connecting to a WiFi network.

    Once the thermostat starts broadcasting its SSID, access via the domain name will no longer be possible.

    The system operates based on the project’s wiring diagram and logic as described.


    WiFi thermostat settings (ESP8266 / ESP32) via WiFiManager


    WiFi thermostat - ESP8266 / ESP32 - Android - network connection via WiFiManager

    WiFi thermostat - HTTP web server - functional thermostat after connecting to the LAN network


    Refresh the web interface automatically every 30 seconds
    A working WiFi thermostat at an IP address in the local WiFi network available to clients

    WiFiManager - UART output - system information and logic listing


    Output to UART automatically every 10 seconds + temperature measurement on the OneWire bus by the DS18B20 sensor
    ESP - WiFi thermostat - UART statement - system logic - boiler control, assigned IP address in the home LAN