VRM API error

Hi,

I am needing some assistance.

I created a node red flow using the VRM API node to fetch future consumption and yield to help manage my ESS.

The node, flow and code was fetching data, then it stopped working, around the time when Victron was having issues with VRM overload.

The VRM API node no longer works at all, giving an ‘error fetching VRM data’ as below, with no message at the output.

Here is a snapshot of a simple test setup i have created to illustrate the issue:

What I have tried so far;

  1. deleted and inserted new VRM API nodes (including config);
  2. deleted and created new tokens;

Any ideas?

Thanks,

David

That is a weird one. Does it work with other queries? E.g. the basic user query?
What does the verbose url query show in the debug tab?

If you can’t get this to work, I’d like to take a closer look at your system. You would need to enable remote support then and allow me to test a couple of times.

Hi Dirk,

The basic user query also didn’t work.
The verbose url essentially provides the following which I have tested using a curl in cmd (which does return data):

curl -H “Content-Type: application/json” -H “x-authorization: Token ” “https://vrmapi.victronenergy.com/v2/installations//stats?type=kwh&interval=hours&attributeCodes%5B%5D=solar_yield_forecast”

I have another issue that has appeared today, where VRM is not working for me.

It times out in my browser, using https://vrm.victronenergy.com/installation/485779/advanced, so I can’t login to give you access.

I can still see my system through the UI locally.

David

I removed my access token and site ID… from above, but had them in of course in the VRM API and in the console test:

Sorry, I put the wrong content above, this is the version that was sourced from the verbose URL:

curl -H “Content-Type: application/json” -H “x-authorization: Token ###########” “https://vrmapi.victronenergy.com/v2/installations/######/stats?type=custom&attributeCodes[]=solar_yield_forecast&interval=hours&start=1760439600&end=1760526000

While looking into it, a thought came into mind. Just a guess, but do you happen to be connected via Optus? There is this thread on issues of the combination of VRM and Optus.

no. 2degrees in NZ.

You should be able to remote access now

This, strangely enough, looks like to be caused by a timeout. Going to try to see if I can fix that.

Managed to get it working for you, by adding:

``
const https = require('https');
const http = require('http');
axios.defaults.httpAgent = new http.Agent({ family: 4 });
axios.defaults.httpsAgent = new https.Agent({ family: 4 });
```

So forcing your system to use ipv4 for this. It looks like the resolving for ipv6 isn’t working or timing out.
What would be interesting to know if this is still a problem on the beta venus firmware (where the victron-vrm-api node gets updated to 0.3.6 instead of 0.2.13).

Your system should be good to go for now. You can disable the remote support again. Thanks for having me take a look at it.

1 Like

Thanks so much for your assistance.

David

1 Like

Hey Dirk,

For my knowledge, where did you put those lines?

David

I’ve put it in /usr/lib/node_modules/victron-vrm-api/src/nodes/vrm-api.js. Which isn’t ideal, as that won’t survive a firmware update.
I just created [Feature]ability to force ipv4 · Issue #40 · dirkjanfaber/victron-vrm-api · GitHub , to solve it properly.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.