openv / vcontrold

:fire: vcontrold Daemon for control and logging of Viessmann® type heating devices
https://github.com/openv/openv/wiki
GNU General Public License v3.0
100 stars 54 forks source link

How to use setSystemTime ? #115

Open Phil1pp opened 1 year ago

Phil1pp commented 1 year ago

Could someone please explain how to use setSystemTime. What do I have to set in vito.xml and vcontrold.xml to be able to set the time by a vclient command?

spoilerhead commented 1 year ago

I use this line every 24h and it works fine:

vclient -h 127.0.0.1:3002 setSystemTime

riegelbrau commented 1 year ago

Without any parameter, like the actual OS system time?

Phil1pp commented 1 year ago

This command returns:

SRV ERR: >FRAMER: ERROR address 08FFFFFFE0 code 4 Error in recv, terminating Error executing setSystemTime setSystemTime: server error

Can you please tell me what you have set in vito.xml and vcontrol.xml for SystemTime

spoilerhead commented 1 year ago

in vcontrol.xml i have

 <unit name="SystemTime">
       <abbrev>TI</abbrev>
       <type>systime</type>
     </unit>

in vito.xml

 <command name="setSystemTime" protocmd="setaddr">
       <addr>088E</addr>
       <len>8</len>
       <unit>TI</unit>
       <description>Setze Systemzeit</description>
       <device ID="2053"/>
     </command>

the result is:

vclient -h 127.0.0.1:3002 setSystemTime setSystemTime: OK

edit: this is identical to what's in here

Phil1pp commented 1 year ago

It seems you have a different heating system. On my Vitocal 200-S heatpump (W01C) the dateTime is on addr 08E0. getSystemTime on this address works just fine, but setSystemTime fails.

spoilerhead commented 1 year ago

I got a vitodens 200 Ho2b (so it seems to more advanced vitotronic?)

riegelbrau commented 1 year ago

I have a Viessmann VScotHO1 with ID=20CB and the samples above did not work in my environment with version 0.98.10-24-ge424ec4 of both vcontrold and vclient. I checked the XML variants I have and compared them with the one from this repo as mentioned above without any new ideas. Then I did some internet searches again (as many times before) and found this entry: https://github.com/openv/openv/issues/185#issuecomment-1193357594 containing the very relevant information, that since v0.98.8 setSystemTime needs the system time as parameter using ISO format: grafik Unfortunately the sample of shell command date +%FT%H:%M:%S%z did not work for me. I checked the --help of the Linux date command and tested several format variants. The parameter -Iseconds led to the same format as the output of getSystemTime shows. I created a little shell script vclient_setSystemTime.sh for testing and eventually I could setSystemTime successfully, see the script output below: grafik

Works for me!!

You'll find my script here: vclient_setSystemTime.sh.txt

Btw: This command that I found in this entry of the FHEM forum: https://forum.fhem.de/index.php/topic,94809.msg883333.html?PHPSESSID=46hkruj0s8fq4l6egs6s7vp1g3#msg883333 switches unit off before and unit on after setSystemTime: $VITODIR/vclient -h localhost:3002 -c "unit off,setSystemTime $JETZT,unit on". This led to an unpredictable and so wrong SystemTime setting in my environment.

Regards Christoph

spoilerhead commented 1 year ago

Ah I wasn't up to date, still running 0.98.10-176