abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Help please about API connection

Good morning.
I'm trying to connect to Viessmann API through a Shelly device, (IoT which is able to send HTTP GET and POST requests in Javascript language.
I've been able to communicate with my account using Postman, but I am not able to pass through the procedure of authentication when trying with the Shelly script.
I think the answer I receive is too big, since it's intended to be used on a browser...
The question is: why not establish a procedure that grants me a token (if possible shorter than the present one) with unlimited time duration, so that I can easily use it in my script requests?
Or, is there some example on how I could implement the present procedure with a javascript code? 
Thank you!

14 ANTWORTEN 14

Hi Marc_ben

i also try to port my Windows Application to Linux and run into several problems. My PHP  program does not work as it did on Windows.

What i found out using the shell Curl command:

HackyJ_0-1697965548438.png

First of all, the spaces before the ampersands do not work. Omit them.

The reply then tells me to enable Javascript in the browser otherwise the call will not work.

Hi HackyJ,
thank you for your answer.

Following my post of yesterday I did some more steps:

1) using the PHP script found on this forum I was able to get a 'refresh token' which simplifies the request of a new token and has a duration of about six months.
2) my problem now is that the "access token" length (1104 characters) is too big for the javascript capabilities of my IoT device (Shelly 1 Plus): it definitely cannot manage such a long string!
So now I am at a dead end.

What I would ask to Viessman API designers now is to make possible to use the "refresh token" itself as an access token for the calls to the API.

If I have a "refresh token" I can use to get a new access token, why not give me the possibility to directly use it for my requests to the API?

 

HackyJ_0-1698015125794.png

HTTP Requests more than 3072 Bytes cannot be handled.

Your curl cpmmands will fail anyway.

You're right!
This is why I think it should be possible to have some kind of access token which doesn't expire and with a limited character length.
It could be an alternative to the present, very long and short-lasting access token we need to use now.

 

By the way, yesterday I succeeded in connecting my Viessman boiler to Google Home and then, using Google Home on the WEB (home.google.com) I could create a routine in YAML script which makes the ambient setpoint change according to events in the Shelly world.
Functionalities are a bit limited, but it could be enough for my needs.

I suggest you to make a Feature tequest to Michael Hanna, providing a plain text Web Access without a graphical overhead. Also a reduced S126 or S64 Security.

please close the issue then.

regards, Hacky

Hi @marc_ben , thank you for stating your request here in the forum. I like to see the enthuasims you and @Konto wurde gelöscht are working on your integrations.

To provide some answers to the questions raised concerning the authentication: The hurdles you are experiences are due to security reasons as well as the standard for an OAuth 2.0 authentication process, which we need to address. Therefore, the length of the access token cannot be shortened. Also, using the refresh token as an access token does not work as well.

Let me know if there is anything else that we could support you in.

Best regards,

Michael

Hi @MichaelHanna , thank you for your reply.

Sorry to hear there is no possibility to make a bit less heavy the procedure to interact with Viessmann API.
Once I have my credentials (mail and password) and my client_id I can have access to the API, it's just a matter of writing the code to obtain a token, and this is not possible in my system (Shelly script), so I think it would not be so unsafe to have a shorter (in terms of characters) token which lasts let's say three months...
Anyway...
Since I now succeeded in putting Shelly's and Viessman's worlds together via Google Home, my new request is to make it possible to send a bigger seires of commands to the Boiler via Google Home.
At present, the only command I can send seems to be a change in the temperature Setpoint.
This changes one of the three temperature levels that my Vitodens 100-W boiler can manage; it changes the present value (maybe it's Eco, Normal or Comfort).
I'd like to have the possibility to switch heating ON or OFF or to change to "vacation" mode or "vacation at home" mode.
In other words, please add commands to the Google Home interface
Thank you again for your attention to my requests and best regards.

Hi Marc_Ben, if this is the only reason, why don't you consider to use VICARE on your mobile.

 

You also can get a list of all your Systems features and select them for the enabled token.

there you will find for every writeable feature the link.

 

Regards, Hacky

Hi Hacky,
thank you for your support.
At present I am using Vicare on my iPhone and it's easy and convenient.
What I wanted to obtain is to automatically turn ON and OFF my boiler according to some events that are generated in the Shelly devices that I already have in my home.
Mainly due to the length of the token and also for the very heavy procedure (this is my opinion) to obtain it, I have seen it's not possible to directly interact between a Shelly device and the Viessmann's APIs.
Now, using Google Home scripting procedures (available at home.google.com) I can write a script that reacts to a Shelly condition (e.g. when one Shelly is turned ON) and modifies the set temperature in the Vitodens 100W boiler. 
But sending this commands results in the modification of the temperature setpoint that is active in that moment (maybe Reduced, Normal or Comfort, according to the daily time schedule).
It would be preferable to me to have the possibility to switch between Heat and Echo or Off mode for the heating system, but this seems not to be possible.
Don't exactly know f it mainly depends on Google home or on Viessmann, but I'm askung both, maybe I'll receive some positive answer...
Best regards. 
Marco

Hello Marco,

this are the commandable features for my Pellet System derived with the features command from the API

filtered for 'command":{'

 

You can also perform this using the php i sent you.

Regards,

Hacky

 

 

Thank you, Hacky
it's very kind of you!
I'll try to see what I can do.
Best regards.

@MichaelHanna; Please be so nice and remove the pdf.file from the post.

marco, please copy it private.

Regards, Hacky

Done!

@Konto wurde gelöscht done 🙂