Viessmann OpenV vcontrold Client (Optolink)

Hi all,

we agreed on a different configuration structure and the PR was merges, so the branch was merged into the main add-on and I deleted the branch in my GitHub-Repo. The changes are now in main repo and branch and will are live since the 1.6.0 release tonight (see PR) - that means you will get the new feature with an update of the add-on in HA.

Cheers,
Roman

1 Like

Hello all,

I was just looking for integrate my heater and found your great work to add into ha with possibility of remote vcontrold, so thank you.
I just have a question. I don’t know if it’s normal or not, but it seems to be slow to get all values (like mor than 1 minutes for 30 commands).
Ex logs :
[10:02:03] INFO: Looping vclient…
[10:03:35] INFO: Looping vclient…
[10:05:05] INFO: Looping vclient…

Is it normal or I have a problem somewhere ?

Thanks for the help.

Best,
Alessandro

From my experience it’s rather slow in general. Baud rate is rather low (4800 AFAIK), it has quite some overhead and reconnects before executing each command. Probably good to limit to those values you really need and not poll like very 10 seconds. From your log I cannot see any commands/values. What I see is that the vclient loop is executed every 90 seconds.

Hi @Schm1tz1

Thanky you sooo much for your work (had been away for too long, sorry ^^)

Sadly it does not work properly on my site :frowning:
vcontrold is running:

vctrld>getTempA
0.800000 Grad Celsius
vctrld>

I reduced the Add on config to just get this one reading:

tty: /dev/ttyUSB0
refresh: 30
device_id: "2098"
vcontrol_host: 10.55.xx.xxx
vcontrol_port: 3002
debug: true
commands:
  - getTempA:FLOAT
  - getBrennerStatus:FLOAT

And the mqtt config:

sensor:
  - name: "Aussentemperatur"
    unique_id: "vcontroldgetTempA"
    device_class: temperature
    state_topic: "openv/getTempA"
    unit_of_measurement: "°C"
    value_template: |-
      {{ value | round(2) }}
    device:
      identifiers: vcontrold
      manufacturer: Viessmann

But sadly, the sensor stays at unknown :frowning:

Hi @rene-bayer,
ok, vcontrold is up. Let’s check where the issue is… Please set the debug flag in config so we can see whether we get a connection to vcontrold at all from vclient. Maybe it’s just a network connectivity thing…
Can you use some MQTT-Client (like MQTT Explorer) to see whether there is some openv topic with the data appearing?
It should look similar to this:
image

Oh crap … it had something to do with the vcontrold … reboot of the remote pi → solved

Tinkering through all the commands and will report :slight_smile:

Oh no :sweat_smile: !
Maybe you can share your special settings / service config here?
I am also having at running on a remote RPi but the service is exiting upon reboot without any error log but then works once I start it with systemctl start. I am using the default vcontrold from the latest release… Will need to investigate further on the weekend…

I have an idea, but unfortunately I can’t implement it! I would like to make the circulation pump smart, but it should remain autonomous on the heating if the home assistant fails. You can read the pump via getPumpeStatusZirku, switch it on and off via setPumpeStatusZirku 1 or 0…theoretically the log says OK, but nothing changes! Now I’ve been wondering if you can manage it with a “fake” schedule? unfortunately the schedules only work individually: e.g. getTimerZirkuMo etc. and not getTimerZirku 1-7 like on the heating. do you have an idea how to create a schedule monday to sunday from 0-24 o’clock. as “on” mode and the schedule “off” as off mode? I hope I wrote it clearly.

something like:

    - name: "getTimerZirkuMo"
      unique_id: "getTimerZirkuMo"
      state_topic: "openv/getTimerZirkuMo"
      command_topic: "openv/setTimerZirkuMo"
      device:
        identifiers: vcontrold
        manufacturer: Viessmann
      payload_on: "setTimerZirkuMo 1:An:05:30 Aus:22:00 2:An:-- Aus:-- 3:An:-- Aus:-- 4:An:-- Aus:--"
      payload_off: "setTimerZirkuMo 1:An:-- Aus:-- 2:An:-- Aus:-- 3:An:-- Aus:-- 4:An:-- Aus:--"
      state_on: "on"
      state_off: "off"

I had similar ideas but then just modified it manually in my Vitodens as the setters don’t seem to work for Device 20CB. Did you test it already? If that doesn’t work, that might be something we need to discuss in the openv/vcontrold community.
Concerning the schedules: The way the parsing is implemented and configured in vito.xml / vcontrold.xml it assumes a fixed length at least for setting the schedules (it is getCycleTime and setCycleTime vcontrold/unit.c at 27c16f3e08de500286ef644b1b631d1243e846d9 · openv/vcontrold · GitHub and vcontrold/unit.c at 27c16f3e08de500286ef644b1b631d1243e846d9 · openv/vcontrold · GitHub). You can see that it has the same structure that is repeated for every day of the week, so you could read/write the whole block (example here: InsideViessmannVitosoft/Viessmann2MQTT.py at 73e8e8c607ac31e14c646fd6861530cbcdd1ce7a · sarnau/InsideViessmannVitosoft · GitHub. That would require modifications to vcontrold and some more testing to stay backwards compatible.

Regarding ESP: I wrote a component for the ESPHome platform, that manages communication between Viessmann-Optolink and Home Assistant.
If you do not hang on a raspi as hardware and vcontrol as software, take a look at ESPHome Optolink · openv/openv Wiki · GitHub and Viessmann Optolink — ESPHome.
The software is not yet part of the ESPHome release but can be tested as a PR (Optolink platform to integrate Viessmann heating units into Home Assistant by j0ta29 · Pull Request #4453 · esphome/esphome · GitHub).

4 Likes

That is great @jota29! I was just wondering if I can also somehow use the original USB optolink cable of the vitoconnect 100 for this?

In principle, I should be able to use a female USB A adapter whose cable I can then unravel and connect to the ESP?

1 Like

Hi, I’m trying to get the party switch working. However, when I add command to vcontrold, there comes an error:

SRV ERR: Error in unit conversion: , terminating Error executing setBetriebPartyM1

I don’t know exactly why. Maybe someone of you will have an idea?

My MQTT is nothing special:

switch:
  - name: "Tryb Party"
    unique_id: "vcontroldgetBetriebPartyM1"
    state_topic: "openv/getBetriebPartyM1"
    command_topic: "openv/setBetriebPartyM1"
    device:
       identifiers: vcontrold
       manufacturer: Viessmann
    value_template: | 
        {{ value|round(0) }}
    payload_on: 1
    payload_off: 0
    state_on: 1 
    state_off: 0

Am I doing something wrong?

EDIT:
I can see I am not the only one:

Hi. I was reading through all your discussion here. I also have a vcontrold setup running since years on a dedicated raspberry pi.
My HA is running in a Synology Nas via docker (no supervisor) so I can’t test the add-on here (sadly).
Did someone found a way how to publish data to the MQTT broker when vcontrol grabs the data via the optolink - current every 2 minutes via cronjob for me.
Best regards, Mark

Hello all,

at first - thank you for this great integration of vcontrold into the ha environment. I am really happy to have the possibility to include the data from my heating as well. My optolink cable is connected locally and since my heating has a different device ID and command addresses I wanted to change those data in the vito/vcontrold.xml.

Now my query is, where I can find both files that are used from the addon?
I have tried to put them into ha /etc/vcontrold path, which was not working. With changed device id the addon did not start with the error message:

Error loading /etc/vcontrold/vcontrold.xml, terminating
[08:18:07] WARNING: Halt add-on with exit code 1

It seems like I still miss the right place.

Thanks for the help.

Best regards,
Seb

@CM000n , unfortunately I don’t know the internal electronic parts of the original cable.
The LED and photo transistor should fit but the resistors may not fit cause USB uses 5V and the ESP uses 3.3V.

I just ordered my D1 Mini and the resistors + LED’s. I am already looking forward to the tinkering project. :slight_smile:
I still have one question @jota29 : How do I get the addresses for the sensors. Is that visible in the log? Is there possibly an overview for this?
Unfortunately, this is not so easy for me to see in your pull request.

@CM000n, the addresses for the sensors depend on the type of the Vitotronic controlling unit of your boiler. It’s best to start without any sensor configuration with just the component initialization:

optolink:
  protocol: P300
  device_info: Device Info
  state: Component state

Eventually replace P300 with KW (this also depends on your boiler type).
If your DIY adapter works correctly, you should see a sensor “Device Info” in Home Assistant or the web interface of your ESP. The device info (4 digit-letter-combination) must match to one value in the line “Gerätekennung” of the table at Adressen · openv/openv Wiki · GitHub. If a value matches you find valid addresses for more sensor configurations in the lines below.
Be aware: the table has more columns than you see in the first moment. Scroll horizontally to see all devices.
Good luck!

P.S.: Take a look at the PR discussion (Optolink platform to integrate Viessmann heating units into Home Assistant by j0ta29 · Pull Request #4453 · esphome/esphome · GitHub) for more common problems (especially regarding the DIY adapter)

1 Like

Thank you very much for clarification! Will give it a try :slight_smile:

I can’t get it to work, unfortunately, and I don’t know if it’s my pathetic soldering skills or if one of the LEDs or resistors is defective. :frowning:
I have already checked my solder joints and the correct position of the anodes/cathodes and collectors/emitters several times (I don’t see any IR signal through my smart phone camera).
Unfortunately I can’t get a device_info read out. Both with KW, and with P300 protocol. And with different positions of the LEDs on the Viessmann connector.
Unfortunately I am at my wit’s end and do not know how I can debug it further better. :-/ Eventually I wait and hope until there maybe the first pre-mounted read heads available.

.::edit::.
I have now added a remote_transmitter for the SIR 204 EVL diode and a remote_receiver for the SFH 309 FA diode for debugging.

remote_receiver:
  pin: 
    number: GPIO3
    inverted: True
  dump:
    - raw

remote_transmitter:
  pin: GPIO1
  carrier_duty_percent: 50%

switch:
  - platform: template
    name: "Panasonic TV Off"
    turn_on_action:
      remote_transmitter.transmit_panasonic:
        address: 0x4004
        command: 0x100BCBD
        repeat:
          times: 5
          wait_time: 1s

With the smart phone camera I could now also see that the SIR 204 EVL is sending a signal. But the SFH 309 FA seems to receive no signal when I look at the ESP logs. I will now order a new SFH 309 FA and try it again.

Signal on:

Signal off:

Maybe this approach is also helpful for someone else to debug.
Perhaps we should also create a separate thread for OpenV with ESP Home @jota29 ? So that it is better known and we do not spam everything here. :smiley:

I ordered new components and tested it again with these. Unfortunately still without success. I give it up for now with it :frowning:

…::edit::…
Today I replaced the Wemos D1 Mini with a NodeMCUv2 I had lying around. And with that it worked right away :smiley:
Screenshot 2023-05-09 193619