Skip to content

set command not working, Vitotronic 200 WO1B, Vitocal 300-A, OpenHab 5.1 #23

@volkerg59

Description

@volkerg59

hello community,
I use the optolink adapter and the Java SW Vitotronic since a few years only for reading data.
After some experimentation, I was able to read my desired data.
Setting any data didn't work.
And yes, it works with the Vitocal 300-A

But now I've found the reason why.

The Vitotronic Java code has some bugs, after correcting it, setting values ​​is now possible.
For example, I can now set the room temperature and hot water setpoints.

Found mistakes:

  1. low byte and high byte swapped in Viessman300.java, row 110
  2. return byte instead of short in in ViessmanHandler.java, row 106

Viessman300.java
(row 83) public synchronized int setData(byte[] buffer, int address, int length, int value) { ....

(row 106)
case 2: localBuffer[5] = (byte)(value & 0xff); // mistake: Hibyte Lowbyte swapped !!!! localBuffer[6] = (byte)(value >> 8); // example: set 10 -> 00 0A was ok because only 1 byte is needed // but set 490 (hotwater 49°C) -> "01 EA" did not work because "value" is only one byte, (->FF EA), but must be short (2 bytes) " // must be corrected in ViessmannHandler.java too.

ViessmanHandler.java
(row 110)

default : float fl = (new Float(value)) * telegram.getDivider(); // all other writable channels are byte or ubyte ### short, 2 byte // log.debug(String.format("value: ", value)); // log.debug(String.format("fl: ", fl)); // locValue = (byte) fl; // must be 2byte short not byte !!!!!! locValue = (short) fl; break;

My SW/Hardware:

  • Openhab 5.1 on Raspberry 4 (Openhabian image)
  • Vitotronic on Raspberry 2 (normal Raspberry headless image)

attached my optolink.xml:

optolink.xml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions