> "PHP Notice: Undefined offset: 0 in phar:///etc/openhab2/scripts/Viessmann-Api-1.1-SNAPSHOT.phar/src/Oauth/ViessmannOauthClientImpl.php on line 60
> Message: Call to a member function getProperty() on null
> Code: 0
> Trace:#0 phar:///etc/openhab2/scripts/Viessmann-Api-1.1-SNAPSHOT.phar/src/API/ViessmannAPI.php(44): Viessmann\Oauth\ViessmannOauthClientImpl->__construct(Array)
> #1 /etc/openhab2/scripts/bootstrap.php(32): Viessmann\API\ViessmannAPI->__construct(Array)
> #2 /etc/openhab2/scripts/GetBoilerStatistics.php(2): include('/etc/openhab2/s...')
> #3 {main}
Php file looks like
<?php
include __DIR__.'/bootstrap.php';
echo $viessmannApi->getBoilerTemperature()
Have you updated your phar to the very last version(1hour ago). Viessman server has been updated and I had to do some tweak in the way to do the Oauth part. Please update with the very last version since the error message is exactly what I had before fixing this.
I was getting the same error starting probably yesterday (7.July 10 local). Changed to the 1.1.0 API Version, the error is gone!
Merci beaucoup.
[Edit:]
Editional info: Viessmann had server troubles today which resulted in the ViCareApp not showing data. Did they have trouble with the change as well?
Iāve no āThingsā to bind the Item. In āPaper UIā , the binding with Vicare donāt exist => Impossible to add Thing manually
I supposed, i have to create file.things manually, Can you please tell me what i have to write in file.things for this Viessman-Api
Thanks a lot
Ludovic
thank you for your API to connect with the Viessmann Server.
I tried it, but it doesnāt work for me.
PHP and PHP-CURL is installed on my Raspi.
My PHP-Version is
PHP 7.3.10-1+0~20191008.45+debian8~1.gbp365209 (cli) (built: Oct 9 2019 00:23:11) ( NTS )
My GetValues.php looks like:
<?php
include __DIR__.'/bootstrap.php';
echo $viessmannApi->getOutsideTemperature();
when I start āphp GetValues.phpā via SSH I get following error-message:
PHP Notice: Undefined variable: viessmannApi in /etc/openhab2/scripts/GetValues.php on line 3
PHP Fatal error: Uncaught Error: Call to a member function getOutsideTemperature() on null in /etc/openhab2/scripts/GetValues.php:3
Stack trace:
#0 {main}
thrown in /etc/openhab2/scripts/GetValues.php on line 3
It complains that variable viessmannApi has not been declared before using it. It should have been created in the bootstrap.php. Do you have such a file in the /etc/openhab2/scripts/ directory ?
Regards
Nor a problem related to the API itselfā¦ I have made a bootstrap.php file sample in the example directory but I wonāt give in depth support for simple php instanciationā¦ Could you just give me the content for the boostrap.php ? For right on linux just use the chmod or chown function on the file(have a look on google/ or man for usage explanation)
Ok.
It was not a problem of the rights / permissions.
Iāve checked and downloaded all files again. (including the brand-new API-File).
Now I get the following warnings:
php GetValues.php
PHP Warning: session_start(): Cannot start session when headers already sent in phar:///etc/openhab2/scripts/Viessmann-Api-1.2.0-SNAPSHOT.phar/src/bootstrap.php on line 2
PHP Warning: session_start(): Cannot start session when headers already sent in phar:///etc/openhab2/scripts/Viessmann-Api-1.2.0-SNAPSHOT.phar/vendor/lusitanian/oauth/src/OAuth/Common/Storage/Session.php on line 40
hum I have already seen. afair it was because with the same session several http request have been made. However, I thought it was fixed. As itās still a warning this shouldānt prevent the api to work. Could you try another feature($viessmannApi->getOutsideTemperature() ?) to test if you get a result.
First of all thank you to all who contributed to this feature and to this tread.
Iām new to this so please be gentle
Iām able to get some data but as Iām operating a heatpump (Vitocal 200-S) there is a lot of items that donāt fit my heating lay-out. E.g. getBoilerTemperature returns with FEATURE_NOT_FOUND.
However when I use getAvailableFeatures there are a lot of items that are useful but how can these be made available? Is this something I can do myself or is this upto @thetrueavatar to put into the API?
E.g. one of the items that shows up is heating.compressor. My guess is that this is the variable showing if the compressor of the heatpump is running or not. It is a useful piece of information to have in determining how efficient the heatpump is running. getCompressor is not working so Iām pretty sure Iām overlooking something. As said at the beginning Iām new to all this.
Here is the compleet list of items after running getAvailableFeatures:
Hello, Iām the developper of the API. I have implemented feature of my own heating system and feature found in a demo package in the ViCare app. However, this indeed doesnāt cover the whole set of feature. Basically, itās quite easy to add some new feature by yourself. I have written a small guide to help people to contribute: https://github.com/thetrueavatar/Viessmann-Api/wiki/How-to-add-you-own-feature-to-the-api
Feel free to give me any feedback that could help or clarify the process.
Hi @thetrueavatar, Iāve been toying around with your guide but Iām a bit stuck. Shouldnāt be the first step be to update the Viessmann.Feature.php with the missing items that are found after running the getAvailableFeatures?
For example running the getAvailableFeatures gave me heating.compressor. In order to get the raw JSON data, this heating.compressor should be added to Viessmann.Feature.php in the form of const HEATING_COMRESSOR = "heating.compressor";. Then the raw JSON data can be obtained.
With that it is known what the properties, type and value, are. These can then be used to complete the getEntity method in your guide. At least that is what Iām thinking at the moment.
In fact feature heating.compressor is an intermediate object that only define link to subfeature such as heating.compressor.0.something for instance. You have to reach the leaf to get the property value. For heating.compressors.0.statistics I have added the āintermediateā feature āheating.compressorā as constant in ViessmannApi but youāll have to append circuitId and the statistics to it.
To help you to know if itās a leaf feature you can do a getRawJsonData(āheating.compressorā) to see if there is any interesting value in the json or if it only contains subfeature links without properties/actions field
Btw I have added a bootstrap-dev.php that to help dev. It will include directory src instead of the phar, so you wonāt have to rebuild the phar on every change. Moreover, I have enable kind of debugging.