Skip to content
soprez
Journal

Connecting a Viessmann boiler to Home Assistant over Optolink: lessons learned and mistakes to avoid

Cable, protocol, reliable addresses, writes, MQTT, oil, hot water, stability: what the Optolink link to a Vitotronic 200 KO1B/KO2B (20CB) taught us, and the mistakes not to repeat.

The first article introduced the kit and the smart heating. This one is the technical logbook: what was verified on a Vitorondens 222-F with a Vitotronic 200 KO1B/KO2B controller, and the mistakes you can skip. All the detail (poll list, addresses, YAML) lives in the Soprez/viessmann-optolink-ha repository.

1. Hardware

  • An Optolink USB head that sits on the controller's optical port. The one used here has a CH340 USB-serial chip; any equivalent head will do.
  • A Raspberry Pi, always on, near the boiler (here a Pi 3 that also runs a few other small services).
  • Home Assistant with the Mosquitto add-on.

A useful first step: give the port a stable name with a udev rule (USB IDs 1a86:7523 for the CH340), for example /dev/vitocom. Without it, ttyUSB0 can change number whenever something is plugged in.

2. Protocol

The controller answered in VS2 ("300") at 4800 baud, 8 data bits, even parity, 2 stop bits (8E2). The conversation is handled by philippoo66's optolink-splitter, which publishes values to MQTT.

The older KW protocol was not tested here, so we can't say anything about it on this model.

Optolink is a slow serial link shared with the controller. Polling faster than the splitter's default gains nothing and risks overloading it.

3. Identify the controller

First of all, read the device ID at address 0x00F8 (8 bytes, read once). The kit targets IDs starting with 20CB, the Vitotronic 200 KO1B/KO2B. That ID, not the boiler's marketing name, decides which addresses are valid.

Keep the full ID to yourself: only the prefix matters for choosing addresses.

4. Read first, then validate writes

The rule that prevented bad surprises: read everything, compare with the boiler's display, and only then write, one address at a time.

Reads validated on 20CB (checked against the display): outside (0x0800), boiler (0x0802), hot water (0x0804), flue gas (0x0808), flow (0x0810) and room (0x0896) temperatures; burner on (0x0842), burner fault (0x0884), burner starts (0x088A), running hours (0x08A7), modulation (0xA38F); tank charge pump (0x6513).

Validated writes: comfort and reduced setpoints (0x2306 / 0x2307), hot-water setpoint (0x6300), heating-curve slope and level (0x27D3 / 0x27D4), operating mode (0x2323).

20CB-specific traps:

AddressWhat happens
0x2304 / 0x2305No usable answer.
0x55021-byte answer instead of 2, implausible value: rejected.
0x6500"Current" hot-water setpoint is often stale: use 0x6300.
0x6515Returns a constant; not a circulation-pump status.
0x7574Oil consumption: always 0 without a physical flow meter.
0x2302 / 0x2303Spar / Party: the write is acknowledged… then ignored.
0x2301Mode can be read, write refused (RetCode 3). Write through 0x2323.
0x6300 > 60Refused (RetCode 3): the controller caps hot water at 60 °C.

Operating mode (0x2323) deserves its own note: 1 = hot water only, 2 = heating + hot water. Value 3 switches everything off (tested). And 0x2301 uses its own numbering: it can read 3 while 0x2323 is set to 2. Don't mix them up.

How a write behaves: the command goes out over MQTT as w;<address>;<length>;<value> (for example w;0x2323;1;2). The new value usually comes back within 3 to 5 seconds; Home Assistant shows no "optimistic" value in the meantime. Right after a write, the bridge may still echo the old value for about thirty seconds. Room setpoints accept whole degrees only.

5. MQTT and Home Assistant discovery

  • A dedicated MQTT user for the bridge, never the Home Assistant account.
  • The poll list uses MQTT discovery: about thirty entities show up on their own as sensor.chaudiere_*, with number and select entities for writes. Deleting those blocks is enough to stay read-only.
  • Topics are prefixed (chaudiere/…), availability goes through an LWT topic, and the bridge only publishes when a value changes.
  • Polling frequency is set by groups: with a 30 s cycle, the "SOMETIMES" group means roughly one read every 30 minutes.

Discovery is published by the Pi. Any fix made on the Home Assistant side (labels, value table) is overwritten the next time the bridge restarts. Fixes belong in the poll list.

6. Oil, from burner hours

The boiler's own oil counter (0x7574) stays at 0. The estimate starts from the burner running hours (0x08A7), returned in seconds (factor 1/3600):

litres ≈ hours × nominal burner flow (kg/h, nameplate) ÷ 0.84 (heating-oil density, kg/L)

It is an estimate, roughly ± 15 %. Re-calibrate it against real deliveries. For per-period counters (day, month, season), make sure each one tracks a single source: we had a double-counting case, fixed since.

7. Hot water, from the charge pump

In the evening, raising the setpoint seems to do nothing: the controller gives hot water priority. To make it visible, the "Hot water in progress" indicator combines:

  • burner on (0x0842),
  • and either the tank charge pump at 1 (0x6513) or a tank more than 1 °C below the setpoint (0x6300).

Space heating alone never drives that pump. Two details matter:

  • 0x6513 is only read about every 30 minutes if left in the default group: move it to "OFTEN";
  • a one-minute off delay stops it flickering between two polls.

The estimated end time comes from the tank's rise rate (a 10-minute derivative of 0x0804).

8. Stability

  • A systemd service with Restart=always and RestartSec=10, started after the network (network-online.target): the bridge comes back on its own after a power cut or a Pi reboot.
  • A stable port name (udev) so the service always finds the Optolink head.
  • LWT availability: Home Assistant sees right away when the bridge is gone.
  • If Home Assistant goes down, the boiler keeps the last setpoint written and carries on regulating. The Vitotronic display remains the reference.

Mistakes to avoid

SymptomCauseFix
Heating stops completely, hot water includedValue 3 written to 0x2323Only use 1 and 2; restrict the select to those two values
Mode shows "Unknown" in HA0x2301's value table applied to 0x2323 (or the reverse)Read and write the mode through 0x2323, with its own table, in the poll list
A fix made in HA disappearsMQTT discovery republished by the Pi on restartFix it in the poll list on the Pi
"Eco" or "party" mode does nothingSpar / Party writes ignored on 20CBDon't build on them; act on setpoints
A 65 °C hot-water setpoint is refusedController cap at 60 °CStay at 60 °C or below
Oil counter stays at 00x7574 needs a flow meterEstimate from burner hours
Hot-water indicator lags by half an hour0x6513 in a slow poll groupMove 0x6513 to "OFTEN"
An automation thinks someone changed a value right after a writeOld value echoed for ~30 sRequire 60 s of stability before reacting
A 19.5 °C setpoint turns into something elseWhole degrees onlyRound before writing
Absurd or missing values on some addressesAddress from another Vitotronic generationCheck the device ID (0x00F8) and validate every address read-only
Bridge doesn't come back after a Pi rebootService not enabled or port renamedsystemctl enable + udev rule

What remains uncertain

  • Other boilers with the same controller are probably compatible but not tested here.
  • Other Vitotronic generations (gas Vitodens, for example) use different addresses: the method carries over, the table doesn't.
  • The KW protocol was not tried.

Reports from other models are welcome in the repository's issues.

☕ Buy me a coffee

This kit and these notes are free. If they saved you time, a coffee is much appreciated: buymeacoffee.com/soprez.

Heating installers and engineers: this work saves you a lot of time on every job. A coffee is welcome and helps keep the project maintained.

Credits: optolink-splitter (philippoo66), the openv community address tables (issue 377 for Spar / Party), vcontrold (issue 131 for the oil counter). Independent project, not affiliated with Viessmann.

→ The full kit: github.com/Soprez/viessmann-optolink-ha · Overview: the first article