question

Tommaso Girotto avatar image
Tommaso Girotto asked

API chart endpoint always returning empty array

https://vrmapi.victronenergy.com/v2/installations/<INSTALLATION_ID>/widgets/Graph?attributeCodes[]=OV1&attributeCodes[]=OV2&attributeCodes[]=OV3&attributeCodes[]=S&attributeCodes[]=iST


is always returning empty array


{ "success": true, "records": { "data": { "20": [], "21": [], "22": [], "40": [], "412": [] }, "meta": { "20": { "code": "OV1", "description": "Output voltage phase 1", "formatValueOnly": "%.1F", "formatWithUnit": "%.1F V" }, "21": { "code": "OV2", "description": "Output voltage phase 2", "formatValueOnly": "%.1F", "formatWithUnit": "%.1F V" }, "22": { "code": "OV3", "description": "Output voltage phase 3", "formatValueOnly": "%.1F", "formatWithUnit": "%.1F V" }, "40": { "code": "S", "description": "VE.Bus state", "formatValueOnly": "%s", "formatWithUnit": "%s" }, "412": { "code": "iST", "description": "Inverter state", "formatValueOnly": "%s", "formatWithUnit": "%s" } } }}


despite everything working fine both electrically and in the VRM dashboard.


What am I doing wrong? @Teun Lassche any advice?

VRMapi
1 comment
2 |3000

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

Hi Tommaso,

You need to specify the instance (device) for which you are requesting the data. You can find this in the device list as "VRM instance". Pass it as "instance=XXX" in the query string.

0 Likes 0 ·
2 Answers
Kristo Lippur (Victron Energy Staff) avatar image
Kristo Lippur (Victron Energy Staff) answered ·

Hi!

The attributes you are requesting are provided by the VE.Bus. For example, for installation 148798 you can get the OV1 and S attributes using instance ID 276:

/v2/installations/148798/widgets/Graph?attributeCodes[]=OV1&attributeCodes[]=S&instance=276

For the solar chargers, different attributes are used. For example, the solar charger voltage and current are attributes ScV and ScI respectively. You can request these with the solar charger instance ID:

/v2/installations/148798/widgets/Graph?attributeCodes[]=ScV&attributeCodes[]=ScI&instance=0

For both of these requests, you should see data returned as expected. You can find the right attributes to use for the solar chargers in the API documentation, https://docs.victronenergy.com/vrmapi/overview.html#retrieve-diagnostic-data-all-current-installation-data

2 |3000

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

Tommaso Girotto avatar image
Tommaso Girotto answered ·

Hi @Kristo Lippur (Victron Energy Staff) , thanks for the reply.


I have tried with all the instance numbers I have found in the VRM dasbhoard device list, but the result is always empty (just to be clear, I can see that instance numbers are usually integers lower than 1000). The devices I have tried to query are solar chargers, pv inverters and battery monitors, and I have tried both with start/end query strings and without (in s and ms formats). Do you have an example url as reference?


Thanks for the support.

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