Open source interface between a Viessmann device (heat pump, gas heater, etc) and MQTT
Project description
viessmann-optolink2mqtt
This project provides an open source interface between a Viessmann device (heat pump, gas heater, etc) and MQTT.
[!IMPORTANT] This project is an independent work and is not associated with, sponsored by, or connected to the Viessmann company in any manner. Viessmann and all related trademarks, product names, and device names are trademarks or registered trademarks of Viessmann and remain the exclusive property of Viessmann.
What is Optolink?
Some Viessmann devices (at least those manufactured before roughly year 2014) expose an optical interface for communication with external devices named "Optolink".
This interface is typically located in the Vitotronic panel and officially supports a connection to the VitoConnect device. On the other hand such interface also allows tinkerers to read and write registers of the Viessmann devices to e.g. read telemetry data (temperatures, status of internal parts, etc) and write settings (e.g. heating mode, target temperatures, etc).
This project allows you to take control of your Viessmann device by hooking into the Optolink interface and sending all data to a local MQTT server, so that all your data is local and is never transiting the cloud of any vendor.
Architecture
Hardware Required
- A Single Board Computer (SBC) which is capable of running Python and has a USB-A connector (if you plan to use the original Viessmann Optolink USB cable). A typical choice is the Raspberry; myself I've been using the OLinuXino A64 as (slightly cheaper) alternative.
- The Optolink USB cable to read/write; you have two main options: a) buy the original Viessmann cable on specialized shops such as https://www.loebbeshop.de/; see exact item here or b) build your own cable, more details available from other tinkerers like MyVitotronicLogger or at Optolink splitter readme
Software features
This project main features are:
- Written to be reliable and run 24/7: careful exception handling, reconnects automatically to the MQTT broker in case of transient network issues, etc.
- One-file configuration: configure all aspects of your Viessmann device from a single YAML config file (easy to backup and/or version in git); no need to hand-write HomeAssistant MQTT entity definitions!
- Read and write support: allows both to read from your Viessmann device and also to set writable registers to e.g. change heating mode, change target temperatures, etc.
- HomeAssistant friendly: although this project can be used with any home automation platform; it provides a number of features that make it very HomeAssistant friendly: in particular MQTT discovery messages make it possible to magically have all your Viessmann entities appear in HomeAssistant.
- Easy installation via Pypi and docker
What this project does NOT have at this time:
- Compatibility with the VitoConnect: if you are interested in that I suggest you to look at the Optolink Splitter or Optolink Bridge
Installation
This project supports 2 main installation methods: PyPi and Docker. Both methods are meant to be used from a Linux Operating system which has the USB/DIY cable attached (see "Hardware" section above).
Pypi package
python3 -m venv optolink2mqtt-venv
source optolink2mqtt-venv/bin/activate
pip install viessmann-optolink2mqtt
optolink2mqtt --help
Docker
When using Docker you will need to provide the YAML config file path in the docker run command and
also provide the name of the serial port (e.g. /dev/ttyUSB0 in the following example):
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
Please note that the --restart=unless-stopped makes sure that the optolink2mqtt docker will
be restarted after a reboot.
The docker image of optolink2mqtt supports 3 main architectures: amd64, armv7 and arm64.
Configuration file
This software accepts a declarative configuration in YAML format. Please look at the optolink2mqtt.yaml file as reference source for the syntax.
How to discover register addresses
TO BE WRITTEN
HomeAssistant Integration
This project allows a very easy integration with HomeAssistant.
It's enough to populae the ha_discovery section of each register defined in the configuration file
with some metadata specific for each sensor, to get the sensor automatically appear inside your HomeAssistant:
This makes it possible to build in your HomeAssistant dashboard visual representation of your Viessmann device. E.g.. for my heat pump I was able to build the following dashboard:
Labelling of the HW
Most likely your Viessmann device will stay around for a lot of time (many years hopefully), and so will do the SBC that connects it to your home automation platform. For this reason I suggest to provide some documentation for what is running on your SBC. A simple approach I like is to print a QR code pointing at this page and stick it physically on the SBC, to make it obvious to anybody inspecting it where to find the docs.
Here you can find a QR code I produced with the optimal miniQR code generator:
Related projects
-
Optolink Splitter: this is the original project that inspired this one
-
Optolink Bridge: inspired from the "Optolink Splitter"; requires you to own a VitoConnect device and allows you to setup a "man in the middle" device
-
openv vcontrold: seems abandoned but contains a C-based implementation of the VS1 and VS2 protocols apparently. Its wiki has plenty of details although in German
-
VitoWiFi: a C++ implementation of VS1 (KW) and VS2 (P300) Optolink protocols, for use on ESP microcontrollers but also Linux systems
-
FloorHeatingController: firmware for a controller of floor heating valves, to help replace physical thermostat with HomeAssistant virtual thermostats
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file viessmann_optolink2mqtt-1.0.2.tar.gz.
File metadata
- Download URL: viessmann_optolink2mqtt-1.0.2.tar.gz
- Upload date:
- Size: 696.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbc1dc619acfda327ab32cb58112a1426c5fe215223de6599d7f146275c2f2a1
|
|
| MD5 |
5d17505e0c13802742f35427518c4eff
|
|
| BLAKE2b-256 |
947f6d8a203781318ca31c0ab74a5921082e6697eb9c8efc633cd6a101a39a38
|
Provenance
The following attestation bundles were made for viessmann_optolink2mqtt-1.0.2.tar.gz:
Publisher:
pypi-release.yml on f18m/viessmann-optolink2mqtt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
viessmann_optolink2mqtt-1.0.2.tar.gz -
Subject digest:
bbc1dc619acfda327ab32cb58112a1426c5fe215223de6599d7f146275c2f2a1 - Sigstore transparency entry: 835066574
- Sigstore integration time:
-
Permalink:
f18m/viessmann-optolink2mqtt@934d4f0c2f7c26ec56fd4a84a5e61a057f751a98 -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/f18m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@934d4f0c2f7c26ec56fd4a84a5e61a057f751a98 -
Trigger Event:
push
-
Statement type:
File details
Details for the file viessmann_optolink2mqtt-1.0.2-py3-none-any.whl.
File metadata
- Download URL: viessmann_optolink2mqtt-1.0.2-py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e3030b0e4751e4ff9cdc34d0731477e6cce6556cfa189defbec0403a14cb727
|
|
| MD5 |
3a891729d3f65aa0b1c26ed3fe6abde0
|
|
| BLAKE2b-256 |
987797a251a9341ef38dbf88f2fb7d4c3fe51fdfe5bf0a6f86fc9631303a82d9
|
Provenance
The following attestation bundles were made for viessmann_optolink2mqtt-1.0.2-py3-none-any.whl:
Publisher:
pypi-release.yml on f18m/viessmann-optolink2mqtt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
viessmann_optolink2mqtt-1.0.2-py3-none-any.whl -
Subject digest:
5e3030b0e4751e4ff9cdc34d0731477e6cce6556cfa189defbec0403a14cb727 - Sigstore transparency entry: 835066609
- Sigstore integration time:
-
Permalink:
f18m/viessmann-optolink2mqtt@934d4f0c2f7c26ec56fd4a84a5e61a057f751a98 -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/f18m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@934d4f0c2f7c26ec56fd4a84a5e61a057f751a98 -
Trigger Event:
push
-
Statement type: