question

wima avatar image
wima asked

Api does not return values, only meta-data

Hi

I tryed to make some requests with postman. The response does not contains expected data. For example the request to widgets/TankSummary returns:

{

"success": true,

"records": {

"data": {

"hasOldData": false,

"secondsAgo": {

"value": 0,

"valueFormattedWithUnit": "0s"

}

},

"meta": {

"328": {

"code": "tc",

"description": "Tank capacity",

"formatValueOnly": "%.3F",

"formatWithUnit": "%.3F M3",

"axisGroup": null

},

....

I also tryed other requests. But the data always only contains the hasOldData and secondsAgo. Whats going wrong here?

Thank you.

api
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
matthew-hodder avatar image
matthew-hodder answered ·

I have the same issue - did you ever resolve it?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mp3k avatar image
mp3k answered ·

very same problem here. I'm starting with API/coding for my victron, and I'm not sure whether I'm doing something wrong or is it API problem.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

matthew-hodder avatar image
matthew-hodder answered ·

yeah fixed it - was just misunderstanding of the API documentation and command. When you pass the command, you have to include the 'instance' number for the device you want to retrieve the data for.

If you run the 'devices connected' command off the API website first:

https://vrm-api-docs.victronenergy.com/#/operations/installations/idSite/system-overview

It will spit out all your devices and an 'instance' number against each one, put that in the URL for the specific widget or dataset you want and away you go.

For example, if I had a site ID123456 and a device with instance ID 123, and wanted the battery summary data the URL would look like the following:

url = URI("https://vrmapi.victronenergy.com/v2/installations/123456/widgets/BatterySummary?instance=123")

https://vrm-api-docs.victronenergy.com/#/operations/installations/idSite/widgets/BatterySummary

You can use the API website to test to see what stats you get back, but the Instance number is the key.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic