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

I can read values from "heating.circuits.0.operating.modes.active" but I can not t set values to it.

Hello, when I try to set a value I receive 

"viErrorId":"req-6b18cc6eb63a4664985181cc0addf4a7","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"

 

Might it be I have chosen the wrong package „Basic free“ under https://developer.viessmann.com/start/pricing.html

????

It says „ Free access to basic functionalities with a limited number of API calls, which allows you to directly start integrating and developing your application.“

Is setting a value for "heating.circuits.0.operating.modes.active" not covered by  the package?

Your API documentation does not say it.

Or is the bash script -see pdf-- just wrong ?

regards hgt

 

 

9 ANTWORTEN 9

Hello @hgt,

 

For all features you can access with the basic package of the API, you should currently also be able to set values if the feature has the option to do so.

 

The error seems like an temporary issue you are experiencing. Could you please try again and let me know what the response is? Also, could you write down the complete CURL command for setting the value, deriving the variables from the bash script you attached? Please make sure you are doing a POST call for setting values.

 

Regards,

 

Michael

Hello Michael, here is the bash shell script:

#!/bin/bash
#ACCOUNT_JSON_FILE=".account.json"

TOKEN_JSON_FILE=".token.json"
#SETTING_JSON_FILE=".setting.json"

 

installationId=$(cat .setting.json | jq -r '.installationId')
gatewaySerial=$(cat .setting.json | jq -r '.gatewaySerial')


# if token is already present load it
if [[ -f $TOKEN_JSON_FILE ]]; then
access_token=$(cat .token.json | jq -r '.access_token')
else
echo " design error 1"
exit 1
fi
echo "curl "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-s \
-H "Authorization: Bearer $access_token""

curl "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-s \
-H "Authorization: Bearer $access_token"


echo " " ;echo " "
echo "curl "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-s \
-d {} \
-H "Authorization: Bearer $access_token" "
curl "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-s \
-d {} \
-H "Authorization: Bearer $access_token"


echo " " ;echo " "
echo "curl "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-s \
-d "{}" \
-H "Authorization: Bearer $access_token" "
curl "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-s \
-d "{}" \
-H "Authorization: Bearer $access_token"


echo " ";echo " "
echo " curl "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-s \
-d '{}' \
-H "Authorization: Bearer $access_token" "
curl "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-s \
-d '{}' \
-H "Authorization: Bearer $access_token"


echo " ";echo " "
echo "curl -d'{}' -X POST -s -H "Authorization: Bearer $access_token" "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." "
curl -d'{}' -X POST -s -H "Authorization: Bearer $access_token" "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." "
curl -d'{}' -X POST -s -H "Authorization: Bearer $access_token" "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." "
curl -d'{}' -X POST -s -H "Authorization: Bearer $access_token" "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..."

 

 

 

 

And this is the result:

curl https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/... -s -H Authorization: Bearer whatever

{"data":{"properties":{"active":{"value":false,"type":"boolean"}},"commands":{"activate":{"uri":"https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/...","name":"activate","isExecutable":true,"params":{}},"deactivate":{"uri":"https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/...","name":"deactivate","isExecutable":false,"params":{}}},"apiVersion":1,"uri":"https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/...","gatewayId":"123456789012345","feature":"heating.dhw.oneTimeCharge","timestamp":"2022-10-10T16:46:36.391Z","isEnabled":true,"isReady":true,"deviceId":"0"}}

 

curl https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/... -s -d {} -H Authorization: Bearer whatever

{"viErrorId":"req-2ba0bfa345084393bcafd195dab37eb1","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

 

curl https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/... -s -d {} -H Authorization: Bearer whatever

{"viErrorId":"req-ada86948c9704c6da5a873b9180f114b","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

 

curl https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/... -s -d '{}' -H Authorization: Bearer whatever

{"viErrorId":"req-60e21c31767749cfb7e7bf9c1d82a4a6","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

 

curl -d'{}' -X POST -s -H Authorization: Bearer whatever https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/...

{"viErrorId":"req-3aa51712b031476780285d6741921789","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}{"viErrorId":"req-ad7a24b75a4a4bc28b0cf63256e8a0ed","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

 

 

regards hgt

@hgt I can see in your POST commands, that "/commands" is missing in the URL path. Please try to use "https://api.viessmann.com/iot/v1/equipment/installations/1234567/gateways/123456789012345/devices/0/..."

 

Let me know if this works for you.

 

Regards,

 

Michael

Hello Michael,

it still does not work. See the 3rd curl request in the script.

Here is the script:

#!/bin/bash
#ACCOUNT_JSON_FILE=".account.json"

TOKEN_JSON_FILE=".token.json"
#SETTING_JSON_FILE=".setting.json"

 

installationId=$(cat .setting.json | jq -r '.installationId')
gatewaySerial=$(cat .setting.json | jq -r '.gatewaySerial')


# if token is already present load it
if [[ -f $TOKEN_JSON_FILE ]]; then
access_token=$(cat .token.json | jq -r '.access_token')
else
echo " design error 1"
exit 1
fi


curl -X GET "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-H "Authorization: Bearer $access_token"


echo " "
echo " "

curl -d {} -X POST https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev... -H "Authorization: Bearer $access_token"

echo " "
curl -d'{}' -X POST -s "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-H "Authorization: Bearer $access_token"
echo " "
curl -d "{}" -X POST -s "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-H "Authorization: Bearer $access_token"

echo " "
curl -d {} -X POST -s "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-H "Authorization: Bearer $access_token"
echo " "

curl -d {} -X POST -s "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dev..." \
-H "Authorization: Bearer $access_token"
echo " "

curl -d {} -X POST -s "https://api.viessmann.com/iot/v1/equipment/installations/$installationId/gateways/$gatewaySerial/dum..." \
-H "Authorization: Bearer $access_token"
echo " "

curl -d {} -X POST -s "https://api.viessmann.com/iot/v1/equipment/installations/0123456/gateways/0123456789012345/devices/0..." \
-H "Authorization: Bearer $access_token"
echo " "

 

And here the outcome:

{"data":{"properties":{"active":{"value":false,"type":"boolean"}},"commands":{"activate":{"uri":"https://api.viessmann.com/iot/v1/equipment/installations/123456/gateways/012345678912345/devices/0/f...","name":"activate","isExecutable":true,"params":{}},"deactivate":{"uri":"https://api.viessmann.com/iot/v1/equipment/installations/123456/gateways/012345678912345/devices/0/f...","name":"deactivate","isExecutable":false,"params":{}}},"apiVersion":1,"uri":"https://api.viessmann.com/iot/v1/equipment/installations/123456/gateways/012345678912345/devices/0/f...","gatewayId":"012345678912345","feature":"heating.dhw.oneTimeCharge","timestamp":"2022-10-12T07:36:22.751Z","isEnabled":true,"isReady":true,"deviceId":"0"}}

 

{"viErrorId":"req-1da7d25565c74621b30768e6c34af825","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

{"viErrorId":"req-9a0d4c28f42247e089394941c718bdc4","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

{"viErrorId":"req-3aec751d97e342cd8f1d85928ae217cb","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

{"viErrorId":"req-fb596d5fbd0149f4818fa9ba76e3b226","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

{"viErrorId":"req-e56db1e7ad1c4bd98283bb01970cbc6f","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

{"viErrorId":"req-7f9c755f5c4b4312959223de98410bab","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

{"viErrorId":"req-001641c3c78d455ca0a10e6926f48657","statusCode":500,"errorType":"INTERNAL_ERROR","message":"Internal server error"}

 

The syntax checking of the Viessmann server is really strange. Just analyse the last 3 requests.

regards 

hgt

@hgt could you send me your gateway serial number (via PN) so I could have a closer look?

 

Also, please make sure the system is connected to the internet and wifi strength is sufficient to avoid potential error sources.


Regards,

 

Michael

OK, I understand the API is not working for changing values. So it is useless for me. I will disconnect the box and you won't get any data from my heating system.

 

To whom  it may concern in Viessmann company.

Time goes by no solution no answer. Are you still there? Is anybody working on the answer?

regards 

hgt

Hi @hgt , thanks for reminder. But as I replied to you in a DM in that time, you should be able to to read and write both the features heating.circuits.0.operating.modes.active as well as heating.dhw.oneTimeCharge.

For example, for executing the command of heating.dhw.oneTimeCharge, you can use:

 

curl -X POST 'https://api.viessmann.com/iot/v1/features/installations/{{installationID}}/gateways/{{gatewaySerial}...' --header 'Content-Type: application/json' --data-raw '{}'

 

(of course adding a valid access token to the request)

 

Please try to execute the request. You can also use a tool like Postman to test API requests. More infos are available at the end of the getting started section of our API documentation: https://documentation.viessmann.com/static/getting-started

 

Let me know if it works for you.

 

Regards,

Michael

Hello Michael,

there was no reply to me in a DM in that time.

But nevertheless with the command in your last msg I was able to get a meaningfull reply from the system.

Thanks!

What I also need is the command to get "gas consumption" in cubic meters or kWh of my hybrid system 222-f.

Maybe I'm to stupid to read/understand the API documentation (https://documentation.viessmann.com/static/getting-started) but I could not find the command.

Can you please help again?

regards

george

Top-Lösungsautoren