A basic room thermostat does one thing: it closes a contact, the boiler fires, and the boiler heats its water to whatever flow temperature is set on its front panel. When the room is warm, the contact opens and the burner goes out. OpenTherm replaces that contact with a conversation. The thermostat tells the boiler which flow temperature it wants, and the boiler reports back what it is doing: whether the flame is on, how hard the burner is working, how warm the flow and return water are, and whether there is a fault.
That conversation is also the cleanest way to bring a boiler into a smart home. What follows explains how the protocol works at the wire level, how to check whether your boiler supports it, and the three ways to put your own controller on the line: a gateway between the existing thermostat and the boiler, a microcontroller that replaces the thermostat, or a commercial thermostat with OpenTherm.
On/off control versus a setpoint
With on/off control the boiler only knows "heat" or "don't heat". It runs at the flow temperature set on the boiler, so on a mild day it pushes hot water into the radiators, overshoots, switches off, cools down and starts again.
With OpenTherm the controller sends a control setpoint, the temperature of the water the boiler should supply to the central heating circuit. A modulating boiler can then turn its burner down and run longer at a lower temperature instead of cycling. Intergas, for example, describes the benefit of OpenTherm controls as output that is precisely controlled and less wear and tear on the boiler. How much gas that saves depends on the boiler, the radiators and the control algorithm, so treat claims of a fixed percentage with caution.
What happens on the two wires
The OpenTherm Association publishes the protocol specification. Version 2.2 is the one most DIY projects and libraries are based on, and it explains why you cannot connect an ESP32 directly to the boiler terminals.
- Two wires, any polarity. The same pair carries power and data. The room unit must work regardless of which wire goes where.
- The boiler powers the thermostat. The specification allows the room unit to draw up to 5 mA, so a wired OpenTherm thermostat does not need batteries.
- Different signals in each direction. The thermostat talks by changing the line voltage: at most 7 V for low (the idle state) and 15-18 V for high. The boiler answers by changing the current it draws: 5-9 mA for low and 17-23 mA for high. The open-circuit voltage of the boiler interface can be up to 42 V DC.
- Manchester encoding at 1000 bit/s. Every bit has a transition in the middle, which keeps the receivers synchronised and lets them reject garbled frames.
Neither 3.3 V nor 5 V logic fits these levels, so every DIY setup uses an adapter, typically with two optocouplers that also keep the microcontroller galvanically isolated from the boiler. The specification requires the boiler side to be isolated from mains, but you still want the isolation on your side.
Frames and data IDs
Each message is a 32-bit frame: a parity bit, a 3-bit message type (read, write and their acknowledgements, plus "data invalid" and "unknown data ID"), four spare bits, an 8-bit data ID and a 16-bit value. The thermostat is always the master and the boiler always the slave. The master starts every conversation, the boiler must answer within 20-800 ms, and the master has to send a message at least once a second.
A handful of data IDs do most of the work:
| Data ID | Meaning | Direction |
|---|---|---|
| 0 | Status flags: CH enable and DHW enable from the master; fault, CH active, DHW active and flame on from the boiler | Read |
| 1 | Control setpoint, the CH flow water temperature (°C) | Write |
| 3 | Boiler configuration, e.g. whether hot water is present and whether control is on/off only | Read |
| 17 | Relative modulation level (%) | Read |
| 25 | Boiler flow water temperature (°C) | Read |
| 28 | Return water temperature (°C) | Read |
| 56 | DHW setpoint (°C) | Read/write |
| 57 | Maximum CH water setpoint (°C) | Read/write |
CH means central heating and DHW domestic hot water. Only some IDs are mandatory, so a boiler may answer "unknown data ID" to anything beyond the basics. Return temperature, water pressure or burner counters are a bonus, not a given.
OpenTherm/plus and OpenTherm/Lite
The specification defines two levels on the same wiring. OpenTherm/plus (OT/+) is the digital protocol described above. OpenTherm/Lite (OT/-) is a simpler analogue variant: the thermostat sends a PWM signal at 100-500 Hz whose duty cycle represents the control setpoint, and the boiler can only report a lockout fault by holding the line at high current. Almost everything in the hobby world talks OT/+.
The short-circuit rule
A boiler must treat a short circuit across its OpenTherm terminals as a heat demand within 15 seconds, so an installer can test it with a piece of wire. The specification allows boilers to detect this in software as a low line voltage with no valid frame for at least 5 seconds. In practice this means a controller that crashes or stops talking does not necessarily leave the heating off. Depending on the boiler, it can look like a call for heat. Keep that in mind when you write your own firmware.
Does your boiler support it?
Look for the OpenTherm logo on the boiler or in its manual, and check the low-voltage terminal block. Some boilers have separate terminals for an on/off thermostat and for OpenTherm. Beyond that, it depends on the manufacturer:
- Intergas says all of its boilers are OpenTherm compatible. Ideal says the same of its Logic range, and Baxi of its current Combi 2 and System 2 boilers.
- Vaillant boilers use Vaillant's own eBUS. The VR 33 module, which goes into the boiler's electronics box, adds an OpenTherm connection for third-party controls.
- Viessmann says the boiler needs a pre-installed OpenTherm interface. Some Vitodens models have OpenTherm terminals on board, others need an expansion module.
- Worcester Bosch has said it does not use OpenTherm on any of its boilers.
If the manual is unclear, ask the manufacturer about your exact model before you buy hardware.
Option 1: a gateway between the thermostat and the boiler
The best-known DIY design is the OpenTherm Gateway (OTGW) by Schelte Bron. It sits on the two-wire link between the existing thermostat and the boiler, receives every message, can change it, and passes it on. The thermostat keeps working as before, and your home automation system gets full visibility plus the ability to override.
Things worth knowing from its firmware documentation:
- The gateway adds about 70 ms to each round trip. The boiler usually answers within 200 ms and the specification allows 800 ms, so this causes no problems.
- If the firmware resets because of a watchdog timeout, the gateway falls back to passing messages through in hardware, so the thermostat still controls the boiler. This fail-safe can be disabled with
FS=0if your thermostat and boiler only work properly with the gateway in between. TT=changes the room setpoint on the thermostat temporarily, until the next programme change, andTC=changes it permanently. These only work if the thermostat supports remote overrides.CS=overrides the control setpoint sent to the boiler. A value of 8 or higher has to be repeated at least once a minute, otherwise the gateway stops overriding. The documentation calls this a vigilance check against runaway heating if the controlling program crashes, and warns that overriding the setpoint can confuse the thermostat's own control algorithm.GW=0switches to monitor mode, which passes the signal through without decoding. That helps when diagnosing a freshly built board.
The gateway talks over a 9600 baud serial interface. The Dutch shop Nodo sells it as a kit, with optional Wi-Fi, Ethernet or serial boards. For the ESP8266 Wi-Fi board, the community project OTGW-firmware adds a web interface, a REST API and MQTT with Home Assistant discovery. Home Assistant also has its own OpenTherm Gateway integration. Choose a gateway if you want to keep the thermostat on the wall or prefer a fallback that does not depend on your own code.
Option 2: a microcontroller as the thermostat
The other route is to remove the thermostat and let a microcontroller act as the OpenTherm master. You need a master adapter. The ESPHome documentation lists the DIYLESS Master OpenTherm Shield, the elvinhome THRM ONE with Ethernet, Ihor Melnyk's OpenTherm Adapter and Jiří Praus' OpenTherm Gateway Arduino Shield.
Ihor Melnyk's adapter is a small board with two PC817 optocouplers that works with 3.3 V and 5 V controllers. Its two OT terminals connect to the boiler in place of the thermostat, in either polarity. His OpenTherm library for the Arduino IDE implements specification 2.2. Note that the input pin on the microcontroller has to support interrupts.
ESPHome has a native opentherm component. Two details from its documentation catch people out:
- The adapter labels its pins from its own point of view and ESPHome from the microcontroller's, so the adapter's
outpin goes to ESPHome'sin_pinand the other way round. - Components that briefly disable interrupts, Dallas temperature sensors in particular, can cause dropped frames.
sync_mode: truereduces them.
The component works only as a master. The documentation says plainly that your existing thermostat is not usable while ESPHome controls the boiler. In return you get the setpoint as a number or as an output that a PID climate controller can drive, switches for CH and DHW enable, and sensors for whatever the boiler reports, from flow and return temperature to modulation level and burner starts. Some boilers use non-standard IDs. The documentation's example is the Daikin D2C, which expects the DHW setpoint on ID 162 instead of 56. The before_send and before_process_response hooks let you rewrite messages on the fly.
This option gives you the most control and the most responsibility. If the ESP freezes or loses its room temperature sensor, nothing else on the line takes over. Set sensible min_value and max_value limits for the setpoint, decide what the controller should do when the room sensor is unavailable, and remember the short-circuit rule above.
Option 3: a commercial OpenTherm thermostat
If you want modulation but not a DIY project, several commercial thermostats speak OpenTherm. Google documents OpenTherm for its Nest thermostats, and tado says tado X works with boilers that have either a relay or an OpenTherm connection. Their smart home integration then goes through the vendor's app or cloud, which is a different trade-off from options 1 and 2.
Common mistakes
- Connecting GPIO pins straight to the boiler. The line runs at up to 18 V in normal operation and the boiler supplies the current. Use an adapter.
- Working on the wrong terminals. Low-voltage control terminals often sit next to mains terminals in the same boiler. Switch the boiler off before you touch the wiring.
- Mixing up
inandout. If the boiler never answers an ESPHome controller, check the pin mapping described above before you suspect the adapter. - Expecting every value. Many boilers support only the mandatory IDs and a few extras. Read what your boiler answers before planning automations around return temperature or water pressure.
- Ignoring failure modes. Decide what happens when Wi-Fi, the server or the room sensor disappears. The OTGW's one-minute rule for
CS=is a good model for any DIY controller.