viessmann: complete docs for installation ID (#21568)
This commit is contained in:
parent
1acf621219
commit
19379ec7f0
1 changed files with 67 additions and 2 deletions
|
|
@ -45,7 +45,48 @@ params:
|
|||
de: Installation ID
|
||||
en: Installation ID
|
||||
help:
|
||||
de: siehe https://docs.evcc.io/en/docs/devices/heating#viessmann
|
||||
de: |
|
||||
Leider kann man die Installation ID nicht einfach in der Viessmann App einsehen - stattdessen müssen wir die folgenden Kommandos in der Kommandozeile ausführen. Es ist uns bewusst, dass das nicht für jeden Benutzer einfach umsetzbar ist, aber bisher haben wir leider keinen besseren Ablauf...<br/>
|
||||
|
||||
Vorraussetzungen: curl, jq, und die folgenden Umgebungsvariblen:
|
||||
|
||||
```
|
||||
VIESSMANN_USER=<your-user>
|
||||
VIESSMANN_PASS=<your-password>
|
||||
VIESSMANN_CLIENT_ID=<your-clientid>
|
||||
```
|
||||
|
||||
Dann holen wir uns einen oauth token (n.b. am besten den gesamten Block in das Terminal kopieren, da die Zwischenvariable 'CODE' nur 20 Sekunden gültig ist):
|
||||
|
||||
```
|
||||
VIESSMANN_REDIRECT_URI="http://localhost:4200/"
|
||||
VIESSMANN_CODE_CHALLENGE="5M5nhkBfkWZCGfLZYcTL-l7esjPUN7PpZ4rq8k4cmys"
|
||||
VIESSMANN_CODE_VERIFIER="6PygdmeK8JKPuuftlkc6q4ceyvjhMM_a_cJrPbcmcLc-SPjx2ZXTYr-SOofPUBydQ3McNYRy7Hibc2L2WtVLJFpOQ~Qbgic455ArKjUz9_UiTLnO6q8A3e.I_fIF8hAo"
|
||||
|
||||
VIESSMANN_CODE=$(curl -X POST --silent \
|
||||
--user $VIESSMANN_USER:$VIESSMANN_PASS \
|
||||
--output /dev/null \
|
||||
--dump-header - \
|
||||
"https://iam.viessmann.com/idp/v3/authorize?client_id=$VIESSMANN_CLIENT_ID&redirect_uri=$VIESSMANN_REDIRECT_URI&scope=IoT%20User%20offline_access&response_type=code&code_challenge=$VIESSMANN_CODE_CHALLENGE&code_challenge_method=S256" \
|
||||
| grep "^location: " \
|
||||
| sed 's/.*\?code=\(.*\).*/\1/' \
|
||||
| tr -d '[:space:]')
|
||||
|
||||
TOKEN_RESPONSE=$(curl -XPOST --silent \
|
||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
||||
--data "grant_type=authorization_code&client_id=$VIESSMANN_CLIENT_ID&redirect_uri=$VIESSMANN_REDIRECT_URI&code_verifier=$VIESSMANN_CODE_VERIFIER&code=$VIESSMANN_CODE" \
|
||||
https://iam.viessmann.com/idp/v3/token)
|
||||
|
||||
VIESSMANN_TOKEN=$(echo $TOKEN_RESPONSE | jq --raw-output .access_token)
|
||||
```
|
||||
|
||||
Damit können wir jetzt die Installation ID abfragen:
|
||||
|
||||
```
|
||||
curl --silent -H "Authorization: Bearer $VIESSMANN_TOKEN" \
|
||||
https://api.viessmann.com/iot/v1/equipment/installations?includeGateways=true \
|
||||
| jq '.data[].id'
|
||||
```
|
||||
en: |
|
||||
Unfortunately you cannot simply lookup this number in the Viessmann app - instead you need to use the following commands on the command line... we're aware this is not for every user, but currently we don't have a better workflow...<br/>
|
||||
|
||||
|
|
@ -57,12 +98,36 @@ params:
|
|||
VIESSMANN_CLIENT_ID=<your-clientid>
|
||||
```
|
||||
|
||||
Then execute the following (n.b. it's best to paste the entire block as-is, since the intermediate 'CODE' is only valid for 20 seconds):
|
||||
Then execute the following to get an oauth token (n.b. it's best to paste the entire block as-is, since the intermediate 'CODE' is only valid for 20 seconds):
|
||||
|
||||
```
|
||||
VIESSMANN_REDIRECT_URI="http://localhost:4200/"
|
||||
VIESSMANN_CODE_CHALLENGE="5M5nhkBfkWZCGfLZYcTL-l7esjPUN7PpZ4rq8k4cmys"
|
||||
VIESSMANN_CODE_VERIFIER="6PygdmeK8JKPuuftlkc6q4ceyvjhMM_a_cJrPbcmcLc-SPjx2ZXTYr-SOofPUBydQ3McNYRy7Hibc2L2WtVLJFpOQ~Qbgic455ArKjUz9_UiTLnO6q8A3e.I_fIF8hAo"
|
||||
|
||||
VIESSMANN_CODE=$(curl -X POST --silent \
|
||||
--user $VIESSMANN_USER:$VIESSMANN_PASS \
|
||||
--output /dev/null \
|
||||
--dump-header - \
|
||||
"https://iam.viessmann.com/idp/v3/authorize?client_id=$VIESSMANN_CLIENT_ID&redirect_uri=$VIESSMANN_REDIRECT_URI&scope=IoT%20User%20offline_access&response_type=code&code_challenge=$VIESSMANN_CODE_CHALLENGE&code_challenge_method=S256" \
|
||||
| grep "^location: " \
|
||||
| sed 's/.*\?code=\(.*\).*/\1/' \
|
||||
| tr -d '[:space:]')
|
||||
|
||||
TOKEN_RESPONSE=$(curl -XPOST --silent \
|
||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
||||
--data "grant_type=authorization_code&client_id=$VIESSMANN_CLIENT_ID&redirect_uri=$VIESSMANN_REDIRECT_URI&code_verifier=$VIESSMANN_CODE_VERIFIER&code=$VIESSMANN_CODE" \
|
||||
https://iam.viessmann.com/idp/v3/token)
|
||||
|
||||
VIESSMANN_TOKEN=$(echo $TOKEN_RESPONSE | jq --raw-output .access_token)
|
||||
```
|
||||
|
||||
Finally, get the installation id:
|
||||
|
||||
```
|
||||
curl --silent -H "Authorization: Bearer $VIESSMANN_TOKEN" \
|
||||
https://api.viessmann.com/iot/v1/equipment/installations?includeGateways=true \
|
||||
| jq '.data[].id'
|
||||
```
|
||||
- name: device_id
|
||||
required: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue