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.
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")
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
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.
@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
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.
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.
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.
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:
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:
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: