Skip to main content

GitHub Tag PyPI - Version

viessmann-optolink2mqtt

Open-source MQTT bridge for Viessmann heating systems using the Optolink interface.

This project connects a Viessmann device such as a heat pump or gas boiler to a local MQTT broker, allowing you to read live telemetry, control writable registers, and integrate everything into Home Assistant or any other MQTT-capable automation stack without sending data to a vendor cloud.

Table of contents

Some Viessmann devices, especially those manufactured before roughly 2014, expose an optical interface called Optolink for communication with third-party tools.

This interface is normally located in the Vitotronic panel and is officially intended for use with the VitoConnect device. But it also allows advanced users to read and write registers on the heating system to collect telemetry such as temperatures and component states, and to change settings such as heating mode or target temperatures.

This project lets you connect to that interface and publish the data to a local MQTT broker, keeping the information on your own network instead of routing it through a vendor cloud.

🏗️ Architecture

Architecture

🛠️ Hardware requirements

  • A small single-board computer (SBC) capable of running Python and exposing a USB-A port if you use the original Viessmann Optolink USB cable. A typical choice is a Raspberry Pi; the author has also used an OLinuXino A64 as a lower-cost alternative.
  • An Optolink-to-USB cable. You can either:

✨ Features

This project is designed to be:

  • reliable and ready to run 24/7, with robust error handling, automatic reconnection to the MQTT broker, and serial-port recovery after transient failures
  • easy to configure through a single YAML file for all device parameters and metadata
  • capable of both reading values from the heating system and writing writable registers such as heating modes or target temperatures
  • Home Assistant friendly, with MQTT discovery support to make entities appear automatically in Home Assistant
  • straightforward to install via PyPI or Docker, with simple upgrade paths

Current limitation:

🚀 Installation

This project supports two main setup paths: PyPI and Docker. Both are intended for Linux systems with the USB cable connected to the Optolink interface.

PyPI package

python3 -m venv optolink2mqtt-venv
source optolink2mqtt-venv/bin/activate
pip install viessmann-optolink2mqtt

optolink2mqtt --help

Docker

When using Docker, provide the YAML config path and the serial port name in the command line. For example, /dev/ttyUSB0:

docker run -d -v <your config file>:/etc/optolink2mqtt/optolink2mqtt.yaml \
    --device=/dev/ttyUSB0 \
    --hostname $(hostname) \
    --name optolink2mqtt \
    --restart=unless-stopped \
    ghcr.io/f18m/optolink2mqtt:latest

docker logs -f optolink2mqtt

The --restart=unless-stopped option ensures the container is restarted after a system reboot.

The Docker image supports three architectures: amd64, armv7, and arm64.

If your MQTT broker requires authentication, set MQTT_BROKER_PASSWORD to provide the password as an environment variable. Alternatively, mount a Docker secret file and set MQTT_BROKER_PASSWORD_FILE to the file path:

docker run -d -v <your config file>:/etc/optolink2mqtt/optolink2mqtt.yaml \
    -v <path to secret file>:/run/secrets/mqtt_broker_password:ro \
    --env MQTT_BROKER_PASSWORD_FILE=/run/secrets/mqtt_broker_password \
    --device=/dev/ttyUSB0 \
    --hostname $(hostname) \
    --name optolink2mqtt \
    --restart=unless-stopped \
    ghcr.io/f18m/optolink2mqtt:latest

The broker username is configured in mqtt.broker.username in the YAML file. MQTT_BROKER_PASSWORD takes precedence over MQTT_BROKER_PASSWORD_FILE, and either environment variable overrides mqtt.broker.password in the YAML configuration. A trailing newline in the password file is ignored.

Docker Compose

If you prefer Docker Compose, use the provided docker-compose.yml file and adapt the serial port name to your system, for example replacing /dev/ttyUSB0 with the actual port provided by your device.

⚙️ Configuration

This software accepts declarative configuration in YAML format. Use optolink2mqtt.yaml as the reference for the supported syntax and configuration structure.

How to discover register addresses

This section is still to be written.

🔌 Serial port naming

A common issue on some Linux platforms is that a USB serial adapter may be re-enumerated by the kernel after a bus reset, causing the device name to change from /dev/ttyUSB0 to /dev/ttyUSB1 or similar. In that case, a config file that references the old device path will stop working.

The recommended solution is to create a stable udev symlink for the adapter and use that path instead.

  1. Use lsusb to identify the Viessmann Optolink adapter details. For example:
Bus 002 Device 006: ID 1a86:7523 QinHeng Electronics CH340 serial converter

In this example, 1a86 is the vendor ID and 7523 is the product ID.

  1. Create a udev rule:
sudo nano /etc/udev/rules.d/99_optolink_usb.rules

Then add a line like:

SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="optolinkUSB"
  1. Unplug and reconnect the Optolink cable.

  2. Use /dev/optolinkUSB in optolink2mqtt.yaml and pass --device=/dev/optolinkUSB in Docker commands when needed.

🏠 Home Assistant integration

This project makes it easy to expose Viessmann entities to Home Assistant through MQTT discovery.

The ha_discovery section of each register in optolink2mqtt.yaml contains metadata that tells Home Assistant how to create entities automatically.

HA integration

This makes it possible to build a Home Assistant dashboard that reflects the state of your Viessmann system. For example, the dashboard below was created for a heat pump:

HA dashboard

Labelling the hardware

Your Viessmann device and the SBC used to monitor it may stay in service for many years. To make future maintenance easier, it's a good idea to document what is running where.

A simple approach is to print a QR code pointing to this project and attach it physically to the SBC so that anyone inspecting it can quickly find the relevant documentation.

Here's a QR code generated for that purpose:

QRCode

🗺️ Roadmap

Planned work includes:

  • Prometheus support for health statistics such as Optolink errors and network issues

If you are looking for a specific feature, open an issue.

  • Optolink Splitter: the original project that inspired this one
  • Optolink Bridge: an approach based on the Optolink Splitter idea that requires a VitoConnect device and creates a man-in-the-middle bridge
  • openv vcontrold: an older C-based implementation of the VS1 and VS2 protocols; its wiki contains extensive protocol details in German
  • VitoWiFi: a C++ implementation of the VS1 (KW) and VS2 (P300) Optolink protocols for Linux and ESP-based systems
  • FloorHeatingController: firmware for controlling floor-heating valves and replacing physical thermostats with Home Assistant virtual thermostats

Metadata

Release files for viessmann-optolink2mqtt 1.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viessmann-optolink2mqtt 1.2.7
File Size Uploaded Provenance Actions
viessmann_optolink2mqtt-1.2.7.tar.gz 706.1 kB With provenance Details for viessmann_optolink2mqtt-1.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for viessmann-optolink2mqtt 1.2.7
File Interpreter ABI Platform Actions
viessmann_optolink2mqtt-1.2.7-py3-none-any.whl Python 3 none any Details for viessmann_optolink2mqtt-1.2.7-py3-none-any.whl

Total release size: 758.1 kB

Release files / viessmann_optolink2mqtt-1.2.7.tar.gz

Download URL viessmann_optolink2mqtt-1.2.7.tar.gz
Size 706.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0632d847a1f11bfce2ec0eba58e43bab693dbfcb7a40bc5e2e7dc36432226d16
BLAKE2b-256 checksum
How to use checksums
861e09a73b45d6a4a9ced92059119b2ffe7c695b4134d9897df24368c11cab18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / viessmann_optolink2mqtt-1.2.7-py3-none-any.whl

Download URL viessmann_optolink2mqtt-1.2.7-py3-none-any.whl
Size 52.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76ff32f47ddae2b0cfd5e716c78a26e4efc5d9b15f68765e4b640c1b5014e6af
BLAKE2b-256 checksum
How to use checksums
135617e69a2532719b7da1448abb5904ee3fc97a44cd430895a7f8afd4ffb449
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for viessmann-optolink2mqtt 1.2.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for viessmann_optolink2mqtt-1.2.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page