Viessmann OpenV vcontrold Client (Optolink)

Had an opportunity to try this out with a Viessman optolink. It is very good at getting values, but I haven’t had success in setting values. There also is a disparity in the get & set on the mode control in particular. This is what my mqtt/select looks like:

  - name: "Viessmann Operating Mode"
    unique_id: "vcontroldgetOperatingMode"
    state_topic: "openv/getBetriebArt"
    icon: mdi:water-boiler
    device:
      identifiers: vcontrold
      manufacturer: Viessmann
    command_topic: "openv/setBetriebArt"
    options:
      - "Heating & Domestic Hot Water"
      - "Domestic Hot Water"
      - "Reduced"
      - "Normal"
      - "Antifreeze"
      - "Shutdown"
    command_template: |-
      {% if value == 'Heating & Domestic Hot Water' %}
        H+WW
      {% elif value == 'Domestic Hot Water' %}
        WW
      {% elif value == 'Reduced' %}
        RED
      {% elif value == 'Normal' %}
        NORM
      {% elif value == 'Antifreeze' %}
        H+WW FS
      {% elif value == 'Shutdown' %}
        ABSCHALT
      {% endif %}
    value_template: |-
      {% if value == 'H+WW' %}
        "Heating & Domestic Hot Water"
      {% elif value == 'WW' %}
        "Domestic Hot Water"
      {% elif value == 'RED' %}
        Reduced
      {% elif value == 'NORM' %}
        Normal
      {% elif value == 'H+WW FS' %}
        Antifreeze
      {% elif value == 'ABSCHALT' %}
        Shutdown
      {% endif %}

This is based off the example (and translated to English) here.

Unfortunately, it does nothing. I also noticed that there is a disparity in the vito.xml in regards to setBetriebArt. There is “setBetriebArtM1” and also a “getBetriebArtM2” and “getBetriebArt”, but no “getBetriebArtM1”. Unfortunately, modifying my select to use “getBetriebArt” and “setBetriebArtM1” still has no effect on changing the mode of the Viessmann.

It would be nice if someone adapted the Vicare Integration to use vcontrold and optolink. The Vicare API has been notoriously unreliable for me. Right now it can’t connect at all, and of course, I hate using the cloud altogether.

@CM000n, glad to see that you finally got it to work. Unfortunately you are the second person that had problems with the Wemos D1 mini. A few minute ago I read in Optolink platform to integrate Viessmann heating units into Home Assistant by j0ta29 · Pull Request #4453 · esphome/esphome · GitHub that another guy had to replace the D1 mini with a esp32-s2-wroom.

Hi.
Do you already have a template or configuration with which you can set the heating times?
I would appreciate an example.
Thx.

Hi,

I did not dig through the whole thread but wanted to share my solution, maybe it helps someone. In my configuration, the vcontrold service runs on a different machine and HASSOS is running in a VM. At the time when implementing, I did not know how to use the vclient executable, so I wrote a python wrapper connecting via the network (currently only readout):

File: /config/python_scripts/gastherme.py

#!/usr/bin/python3
import sys
import telnetlib
import re

#start telnet to vcontrold
tn = telnetlib.Telnet("192.168.10.2",3002)
tn.read_until(b">")

value = 128.5
while value==128.5:
    tn.write(sys.argv[1].encode('ascii') + b"\n")
    value = round(float(re.findall('^(?!\s)-?\d+\.?\d*', (tn.read_until(b'vctrld>', timeout=5).decode('ascii')))[0]),1)
    if value < 100:
        print(value)
tn.write(b"quit\n")

In command_line.yaml I have:

- sensor:
    command: 'python3 /config/python_scripts/gastherme.py getTempWWist'
    name: "Warmwassertemperatur"
    unique_id: gastherme_warmwasseristtemperatur
    unit_of_measurement: "°C"
    scan_interval: 30
- sensor:
    command: 'python3 /config/python_scripts/gastherme.py getTempKist'
    name: "Kesseltemperatur"
    unique_id: gastherme_kesseltemperatur
    unit_of_measurement: "°C"
    scan_interval: 61
- sensor:
    command: 'python3 /config/python_scripts/gastherme.py getTempWWsoll'
    name: "Warmwassersolltemperatur"
    unique_id: gastherme_warmwassersolltemperatur
    unit_of_measurement: "°C"
    scan_interval: 301
- sensor:
    command: 'python3 /config/python_scripts/gastherme.py getTempAtp'
    name: "Außentemperatur TP"
    unique_id: gastherme_warmwasseraussentemperatur_tp
    unit_of_measurement: "°C"
    scan_interval: 299
- sensor:
    command: 'python3 /config/python_scripts/gastherme.py getTempStp'
    name: "Speichertemperatur TP"
    unique_id: gastherme_speichertemperatur_tp
    unit_of_measurement: "°C"
    scan_interval: 298
- sensor:
    command: 'python3 /config/python_scripts/gastherme.py getTempA'
    name: "Außentemperatur"
    unique_id: gastherme_aussentemperatur
    unit_of_measurement: "°C"
    scan_interval: 62

However, starting now I would for sure use the integration :slight_smile:

Hallo @steini86

This seems to be a very interesting solution. Especially since it allows to set individual scan intervals (in seconds?). Could you also expand your script on the set commands? I’m still looking for a solution to set heating schedules.
I am not a programmer, but the ‘vctrld>’ reads out the values, definied in the vito.xml?
Would it also be possible to read not only float values but also string values?

I have a similar configuration to yours. I use a Raspberry Pi in the heating room to retrieve data from the Vitodens 333 using vcontrold. Home Assistant on my server then fetches the data.

Hi @SSX ,
currently I do not plan to improve my python script although would also like to get more values and set things. As I said, before investing more time into this I will try the addon. IMHO it makes more sense if people focus on one working solution :slight_smile:

supports remote vcontrold like your setup.

Anyway, for your questions:

Yes, that’s in seconds

In principle, could be done. I would probably write a new python file just to send commands.

My guess is that this would work with the integration but I did not dig into this. Important is to set the payload correctly: like setTimerWWDi 06:10 9:30 17:30 20:40

That is part of the response when you connect. For debugging, you can just connect with telnet to the port, for example on your rpi:

# telnet localhost 3002
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
vctrld>getTempWWist
40.5 Grad Celsius
vctrld>

So, the program first reads until > which is after the initialization of the connection. Then sends the command and reads until the next line “vctrld>” The value itself is extracted via regex: regex101: build, test, and debug regex

Yes, the regex needs to be adjusted accordingly. Easiest might be another python script which gets the string values. Use the telnet console to get your original readback, paste that into the regex101 website and adjust your regex until you have the correct output.

Good luck!

@steini86
Thank you for the response.
Yes, the adapter is working as expected. However, I wish it had an option for integrating that scan_interval feature.
The payload for the heating timer doesn’t work at all. I.e. this

select: 
    - name: "HZ01 Timer HZ Mo Sel"
      unique_id: "vcontroldgetTimerMoHeizen"
      state_topic: "openv/getTimerMoHeizen"
      device:
        identifiers: vcontrold
        manufacturer: Viessmann
      command_topic: "openv/setTimerMoHeizen"
      options:
        - "Zeit 1"
        - "Zeit 2"
      command_template: |-
        {% if value == 'Zeit 1' %}
        06:30 08:30 18:30 22:00
        {% elif value == 'Zeit 2' %}
        07:30 10:30 19:30 23:30
        {% endif %}

sends only the first “on”-time in the string “06:30”. It doesn’t send the other values.
Anyway, I hope that there will be a solution for that at some point as well.

Hi Simon
am struggeling at the same point. i don t get any data
are you also using the ESPhome projekt? or what code are you running on the esp?

I am currently (still) using the official Vitoconnect Hub, as we live here with my parents-in-law and my father-in-law would like to continue using the Viessmann app instead of Home Assistant. Some functions, such as setting timers for the heating circuit pumps, for example, cannot be implemented in Home Assistant or can only be implemented with difficulty.

However, it basically worked and I could read out the data. The problem for me was simply my Wemos D1 Mini. It just wouldn’t work with it. After I switched to a NodeMCU instead, it worked without any problems.

how can i use an external mqtt server in the local network and not the MQTT in the HA

Hey guys,

i desgined two housings for d1 mini clones (az delivery).
Maybe someone would like to use one of them.

This one is for using die V cutout like the original optolink:

This one is for mounting in the Vitotronic Lid:

Hello everyone,

I have a problem. After the last ESPHome update, the Viessmann Optolink update appeared.

Unfortunately, after starting the update, the process reports errors as below.
I will add that Optolink is still working (fortunately) and the update of the second ESP responsible for the DSC alarm went without a problem.

Please read breaking changes here:

Also review the documentation as there are some other things that have changed as well, e.g. the mapping for text sensors.

1 Like

Thank you much!
I have edited my yaml according to new requirements and it’s compile and all working fine.
By the way, I have a question about the new functions - DAY_SCHEDULE / _SYNCHRONIZED:

image

The description says: The mode DAY_SCHEDULE can be used to read daily schedule plans with On/Off time pairs, for example, to turn on or off heating or warm water. Each day of the week can have up to four time pairs. (…) The mode DAY_SCHEDULE_SYNCHRONIZED can be used to write a schedule plan back to the Viessmann unit.

Does this mean that if I want to display the heating plan for all days of the week, I have to prepare entries for each day separately? E.g. for Friday:

  • platform: optolink
    name: Heating schedule Friday
    mode: DAY_SCHEDULE
    day_of_week: FRIDAY
    address: 0x2000
    bytes: 56

Will all days be at the same address 0x2000?
Second question - what if I want to read (not save to the boiler) the warm water heating plan? Should I then enter the following entry in yaml:

  • platform: optolink
    name: Warm water schedule Friday
    mode: DAY_SCHEDULE
    day_of_week: FRIDAY
    address: ???
    bytes: 56

Thank you in advance.

I’d suggest to ask those questions in either the above PR discussion or on the author’s repo: Issues · j0ta29/esphome · GitHub