Skip to content
MCU Atlas
ESP32ESP32-C3ESP8266

OTGateway: ESP32 OpenTherm boiler controller for Home Assistant

Controls OpenTherm gas boilers from an ESP32 with PID/weather-compensated heating and full Home Assistant integration.

Difficulty:IntermediateSource available

Key Facts

  • Chip: ESP32 / ESP8266; the build uses an ESP32-C3 (SuperMini module)
  • Protocol: OpenTherm
  • Control: PID, equithermic curves
  • Integration: Home Assistant via MQTT

About This Project

OTGateway speaks the OpenTherm protocol to compatible boilers and adds smart heating control: PID and equithermic (weather-compensation) curves, hot-water control, external sensors (1-Wire, NTC, BLE) and an emergency mode that keeps heating running if Wi-Fi or MQTT drops. It integrates with Home Assistant via MQTT auto-discovery. Requires an OpenTherm adapter board between the ESP and boiler.

Source & Attribution

Source: GitHub
Also from: otgw.app
License: GPL-3.0
Last verified: 10/15/2026
OTGateway: ESP32 OpenTherm boiler controller for Home Assistant

Illustration

How to Build It

OpenTherm Gateway (OTGateway) is ESP32/ESP8266 firmware for controlling a gas boiler over the OpenTherm protocol. It offers PID and weather-compensated (equithermic) heating curves, external temperature sensors, an emergency mode, and Home Assistant integration through MQTT.

Parts Needed

  • ESP32 or ESP8266 board from the supported-boards list
  • OpenTherm adapter (DIY or bought; see the adapters page)
  • DS18B20 or NTC sensors for indoor/outdoor temperature (optional BLE sensors)
  • MQTT broker (e.g. Mosquitto in Home Assistant)

Steps

  1. 1

    Choose a board and adapter

    Pick a supported board and OpenTherm adapter from the docs' Boards and OT adapters pages. Ready-made adapters are listed as well.

  2. 2

    Flash

    The easiest method is the project's Web Flasher in Chrome or Edge. You can also use Espressif's Flash Download Tool, or build with PlatformIO using the 'Build firmware' guide.

  3. 3

    Connect to the boiler

    With the boiler powered off, wire the adapter to its OpenTherm terminals (the two low-voltage wires usually used by the room thermostat) as shown in the Connection guide.

  4. 4

    Configure

    Join the gateway's hotspot and open its web UI to set your Wi-Fi, MQTT broker and sensor pins. Then choose PID or equithermic mode and tune the curve.

  5. 5

    Home Assistant

    Once MQTT is set up, the gateway's entities appear in Home Assistant automatically.

  6. 6

    Tips

    The on-board LEDs show OpenTherm link status. Emergency mode keeps the heating running if Wi-Fi, MQTT or a sensor drops out.

Bill of Materials

Parts list

3 parts · 2 linked

Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works

Not included: 3D-printed case, wire, solder, USB cable

Download CSV

Related Projects

Open-source ESP32 touchscreen smart thermostat
Illustration
ESP32ESP32-S3
A cloud-free smart thermostat on an ESP32: touchscreen control, Home Assistant integration and forecast-aware heating behaviour, with the full build documented.
Advanced·Code
5 parts listed
WLED: Wi-Fi control for addressable LED strips on ESP32
Illustration
ESP32
The go-to firmware for WS2812B-style LED strips on ESP32: 100+ effects, sound-reactive audio built in, browser installer, Home Assistant support, stable 16.0.1.
Beginner·Code
4 parts listed
PixelIt: pixel-art LED matrix display for ESP32
Illustration
ESP32
A WS2812B 8x32 matrix display that shows clock, pixel-art animations and smart-home notifications via MQTT or HTTP.
Beginner·Code
4 parts listed