[VitoConnect] Getting readings from Viessmann Heating system via VitoConnect

Instead of:

Viessmann_BurnerActive.postUpdate( transformRaw("JSONPATH", "$.IsBurnerAcive", jsonVitoData) )

try this ( not tested, written on a phone!)

var temp=transformRaw("JSONPATH", "$.IsBurnerAcive", jsonVitoData)
if temp=1 {
Viessmann_BurnerActive.postUpdate(temp) 
} else {
Viessmann_BurnerActive.postUpdate(0)
}
1 Like

Awesome. Thank you Jürgen. I’ve changed it a littlebit:

    var burner = transformRaw("JSONPATH", "$.IsBurnerAcive", jsonVitoData)
        if(burner==1) { Viessmann_BurnerActive.postUpdate(ON) }
        else { Viessmann_BurnerActive.postUpdate(OFF) }

      var standby = transformRaw("JSONPATH", "$.IsStandby", jsonVitoData)
        if(standby==1) { Viessmann_BurnerActive.postUpdate(ON) }
        else { Viessmann_BurnerActive.postUpdate(OFF) }

The burner and stanby items are now switch items.
There are still some other issues. One of it is a validation issue. Not urgent, but I dont like to see issues in my logs:

[INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'viessmann-api.rules', using it anyway:
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
The method transformRaw(String, String, String) from the type Transformation refers to the missing type Object
2019-12-17 09:59:29.222 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'viessmann-api.rules'

And the other one:

[ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'GetVitoconnetData': json string can not be null or empty

I think I have to live with this one…right?

For information, this is the way php manage boolean. The echo function displays empty when a boolean is false… However, there is a way to fix that by casting the boolean in int:
echo (int)$viessmannApi->isHeatingBurnerActive();

2 Likes

Ups! I did it the “old basic” way again. Yes, you need double == !
As for the Validation Issue, I use “transform” instead of “transformRaw” without issues!

1 Like

Hi @opus ,
thank you for your great tutorial.
I tried it and it works pretty good.

Just two comments on your description:
I had to put a semicolon behind the @. So it looks like this:

 <?php include __DIR__.'/bootstrap.php';
 echo $viessmannApi->getOutsideTemperature();
 echo "@";
 echo $viessmannApi->getHotWaterStorageTemperature();

And the item definition has a typing error. It is called:
String BoilerTemperature "BoilerTemeprature [%s °C]"

If you may correct this, so others will not do the same mistakes like me.
Thank you.

1 Like

Viessmann company has written to all(?) users of their API.

**From the coming week on, a threshold will become active that prevents from unauthorized use of the API** **.** This will affect all third-party solutions, which can thereby no longer be used.

 We are aware that the demand for APIs to our technologies for integration
  into other solutions and third-party systems is increasing. 

To provide you with an opportunity for this, we will launch a portal in the next two months for all developers to get access to our API. With the **Viessmann Developer Portal** , we intend to open ourselves up, release a documentation of the interface and co-develop new solutions together with you

So, don’t be surprised if the solution posted above stops to work!

What’s your source for this mail ? I didn’t receive it. Anyway I have never had the chance to receive any information from Viessmann even if I have filled in their form to participate in the test of their new api… I do fear they will force kind of subscription to allow us to use the api …

Hi there,
I read it here:
https://www.viessmann-community.com/t5/Experten-fragen/ViCare-Blick-zur%C3%BCck-und-nach-vorne/qaq-p/84614/comment-id/103306#

Ok the ban is quite long in fact. The limit is 1450 request/day. Once you have reached the quota you’re a banned for a lot of time. For instance, I’m currently ban till 17h20… I guess this is something like a 24h ban if you exceed the limit. Moreover this is per request. The problem is that with my api every information asked is a request. 10 informations every 5 min -> 1680 request/day -> boum !!! A workaround would be to use the getFeatures() method that retrieve all the information and to parse it…

Here is the response received
{
“errorType”: “RATE_LIMIT_EXCEEDED”,
“extendedPayload”: {
“clientId”: “XXX”,
“limitReset”: 1584462010106,
“name”: “ViCare day limit”,
“requestCountLimit”: 1450,
“userId”: “XXXX”
},
“message”: “API calls rate limit has been exceeded. Please wait until your limit will renew.”,
“statusCode”: 429,
“viErrorId”: “XXXXX”

This limit is pretty a non-sense as they have developped an approach HATEOAS which is means to force client to discover the api bit by bit and so implies a lot of call…

A new version is available in snaphost that provide a caching to avoid account to be blocked. This version has been developed while I don’t have access to my own account so please provide me feedback asap.

This cache only works if you do all the call in the same php file. Example:

$viessmannApi->getOutsideTemperature());

$viessmannApi->getBoilerTemperature());

$viessmannApi->getSlope());

$viessmannApi->getShift());

BTW I have added an error handling to display ratio limit error and new limitreset date

Of course I would like to test. Where can I find the new version? Github?
I already did all calls in a single file ( and misinterpreted that such would be a single API call already :blush:).
I stopped all calls from openHAB yesterday, however my ViCare App is still banned???

Indeed the version Ii on the github.

Will try and report (I looked earlier today into Github, obviously to early)

Tried it while ViCare was banned for the first time since yesterday. Got a responce that I’m banned until Thu, 19 Mar 2020 16:39:09 +0000.
I did not try any call during this whole before the above test!

At what time did you get banned again?

Thu, 19 Mar 2020 17:35:24 +0000

Le mer. 18 mars 2020 à 19:36, Jürgen Baginski via openHAB Community bot@community.openhab.org a écrit :

Here it is:
@thetrueavatar your assumption from above (calls counted based on “credentials”) is not correct. There was indeed an issue within the limitation, which I expect we will be having fixed tomorrow. However, I cannot say whether this is causing the problem for your implementation or not. So please make sure that your number of API calls are not exceeding the limitation once this is fixed.
Best,
Michael

Let’s see what happens tomorrow. I’m keeping my fingers crossed. Today my account got banned without doing an API call.

I am also on the Viessmann forum (JueBag)!
Doing a call for 2 values every 5 minutes is working now for 8 consecutive calls. Keeping fingers crossed.

As posted in the Viessmann forum, they fixed the issue. What remains unclear to me is how they are counting. Does a call for two values (in one file) count as one, two or *?
Should I/we do a test by trying intentionally to hit the 10 minute limute?