[VitoConnect] Getting readings from Viessmann Heating system via VitoConnect

Hi, I also tried the new methods. But I can not connect. This is the error message:

php GetValues.php

Message: Unable to get data for feature 
Reason: INSTALLATION_NOT_FOUND
Code: 1

I used the Serialnumber from the app for Installation and Gateway. Both have 16 caracter. I don’t know if this is correct and I don’t know how to read with the new methods getInstallationId and getGatewayID.

Maybe you can help me?
Thank you. BR

Please show the content of your GetValues.php file.

GetValues.php

<?php

include __DIR__ . '/bootstrap.php';

echo $viessmannApi->getBoilerTemperature();

echo "@";

…and running this .php file you get the posted error? I might be misunderstanding your post!

yes I am running it in the console of my openhabian installation. Which should work in my opinion.

Did it work before the new methods were included?
What did you change?
Which php-curl version do you have?
Does the GetValues.php have the correct permissions?

Yes, it worked pefectly with Viessmann-Api-1.3.0-SNAPSHOT.phar.
Now Viessmann did the API change and I was banned. Now I want to try it again.
I changed to Viessmann-Api-1.4.0-SNAPSHOT.phar, replaced the bootstrap.php and added the two more values in the credentials.properties.
Also I did an update from OH 2.5.2 to 2.5.3
I am running PHP 7.3.14-1.
How do I check the permissions?
Thank you

If you have changed anything on the GetValues file it should be fine.
For some clarification, Viessmann installed a limit on their server last week, however the so called file "Viessmann-API-xx-SNAPSHOT.phar is not from Viessmann!
@thetrueavatar did build those!
Have you been banned by Viessmann ( that would have happened during the start of this week) or did it work after you installed the new .phar file?

[Edit:]
When trying to run the GetValues files, did you cd to the folder holding this file (as well as all the other needed files)?

In order to get the correct values for InstallationId and GatewayId you need to the two get methods once (in a file similar to GetValues) and copy the recieved values into your credentials file.

1 Like

Yes, I know the .phar is not from Viessmann. But it is great work to take access to the API.
I have been banned on monday and I could not access anymore. Now the app is working again, but I still could not receive values from openhab.
So I tried to update to the new .phar file and get it work again. So it was never running with the new version. Now I am trying to figure out what I am doing wrong.

And yes I cd to the folder of the file /etc/openhab2/scripts$ and running it form there. Also there are the ohter files.

Sorry for those questions, but I have to make sure what problem we are talking about.
So you changed to the 1.4 phar file, used the updated bootstrap file and entered some ( bogus?) values for InstallationId and GatewayId? Correct?
If yes, the problem might be the entered values ( if not read with the above methods you do NOT have the correct ones). However that is just a guess!

It is working now.
I did not manage to read out the GetInstallationInformation. So my installationID was wrong.

Now I could read out the information.
To get the GetInstallationInformation I had to delete the entries in the bootstrap.php file (of course).
After that I could fill in the right InstallationInformation and add the entries again in the bootstrap.php.

Thank you for you help and the work of @thetrueavatar. The error message was pretty clear :slight_smile:
Have a nice day. Stay healthy.

1 Like

If you put only username/pwd and use the provided bootstrap then it will autodiscover installationId and gatewayId. However, since those value never change it’s an unnecessary request so I have added the possibility to optimize things by adding those value in credentials.properties. But both solution are supposed to work.

1 Like

@thetrueavatar merci beaucoup pour ce plugin formidable! And your quick response to the new developments…

Unfortunately I’m not able to get data with the latest version 1.3.2. ‘php bootstrap.php’ returns:
Message: Class 'Viessmann\API\DateTime' not found

I’m not that familiar with php, but a quick search reveals that there might be a need to replace DateTime with \DateTime here. Just wondering why this seems to happen only for me…

Oh, btw, I edited bootstrap.php by commenting out the readout of lines 3 and 4 of the credentials file (since it’s not working without those two lines, and I need to read them somehow in the first place)

Finally, I managed to clone the code and try to debug myself. Seems that changing DateTime to \DateTime in lines 82 and 83 did the job indeed. Unfortunately, I’m not familiar enough with git (yet) to create a pull-request myself…

My bad there was indeed a missing import…
Oh I hate those interpreted language. At least with compiled language import are being checked at compiled time…
I have made a 1.3.3 with this fix. However, this error only happens upon parsing reset limit date. This means you’re currently banned by viesmmann because you have done too much request…
You should get the gatewayId and installationId and add it to credentials.properties to reduce load.

1 Like

Great, thanks. Indeed, I was trying to get those ID, but was banned. Will try that today, limit should be reset now.

Another question: When I do the git checkout for 1.3.3, a lot of files are missing (e.g. in the vendor directory), compared to the develop branch. Is this intended and I’m using git in the wrong way, or should those file also be tagged?

Btw, is this the right place for such discussion or should we move somewhere else? Open a ticket on git?

This is a acutally a very good question.

In fact, the vendor directory contains only the third-party libraries.

It’s usually a good practice to not embed third-party library in our source code but to manage those with a dependency manager(here composer).

Before compiling the phar I have to install those dependencies managed by composer(through composer install).

However, in the develop branch, I have left those dependencies for people who would like to rebuild the phar themselve and are not used to manage dependencies with composer.

Regards
PS: In the future a ticket on git would be indeed more relevant as this could be seen by every user of the api not only the openhab one.

Hi there!

Ist there a way to get gas consumption data?

Hi community,

I have just installed OH 3.0.0 M2 and its additional Exec Binding and would like to get some values from my Viessmann heating system.
I have followed the example from @opus (many thanks) which works fine when i run in the php script getvalues.php in the Ubuntu command line i get values. But when using in de openhab script the function executeCommandLine(“php@@/etc/openhab2/scripts/GetValues.php”,5000) doesn’t seem to work. It seems that the arguments passed with the function is not in the correct order, some change’s in the 3.0.0 Binding?