question

Fideri avatar image
Fideri asked

Node Red, VRM API, and global context

Hi All,

I'm using @Dirk-Jan Faber (Victron Energy)'s excellent VRM API node in Node Red over the Internet. Two questions concerning that:

1. Is there a clever way of getting all the installation stats in one go without having to specify an attribute and therefore making multiple trips? In my case, I'm interested in consumption and battery soc values, so I have to make 2 trips to the API when all the values I need are under installation stats. See screenshot attached as an example. This strikes me as inefficient.

2. If I tick the option to store the value in the global context, do I need to first configure my global context storage? How do I access my stored values? How long are the global context values stored? How can I periodically overwrite my stored values?

Can I read all about this somewhere? Not the generic Node Red and VRM API docs, I have read those .

As a suggestion to @Dirk-Jan Faber (Victron Energy), consider having the ability to customize/overwrite a query URL.

Fideri

1719736128772-1719736124652-screenshot-2024-06-30.pngImage Caption

Node-RED
3 comments
2 |3000

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

Fideri avatar image Fideri commented ·

Two related questions:

1. How do I get the VRM instance numbers for use in Node Red? Following some posts here, I was using instance numbers listed under "Device list" of the VRM portal. But I always get the error "resource not found". I tried various listed instance numbers with the same error. See real example in screenshot with installation id changed.

2. Talking of instance numbers, what instance number does one use for the entire installation, e.g to get system summary stats?

screenshot-2024-06-30-064211-vrm-sc.png

1719747655038-screenshot-2024-06-30-064634-vrm-sc2.png

0 Likes 0 ·

That site is needs to be the is of your site, not 123456.

You can find the correct number in the url when checking your site via the regular VRM portal.

0 Likes 0 ·
Fideri avatar image Fideri Dirk-Jan Faber (Victron Energy) ♦♦ commented ·
I just changed that number to "123456" only for posting purposes. I get that error when I use the proper number.

For now, I have found a work around. I'm using the diagnostic data instead. Everything I need is there and I don't have to specify an attribute and an instance number. The only small problem is that I get back a lot of data which I don't need, so I have to filter it out.

F.

0 Likes 0 ·
1 Answer
Dirk-Jan Faber (Victron Energy) avatar image
Dirk-Jan Faber (Victron Energy) answered ·

You probably will need to query 2 times to get more information from the VRM API.

Regarding the context, you can find it via the menu on the top right corner of Node-RED:

1719825079302.png
If you hit the refresh button next to the Global menu afterwards, you will find the retrieved VRM api info there.

You might also want to check https://nodered.org/docs/user-guide/context on that.
And, if you haven't seen it already, https://community.victronenergy.com/content/kbentry/293324/node-red-vrm-api-and-dynamic-ess-1.html migth also be of interest for you.

And adding a custom url to query is a nice suggestion. Thanks for that. I've created an issue on github for this (https://github.com/dirkjanfaber/victron-vrm-api/issues/20). It might still take a while before getting implemented, but at least it does not get forgotten.


1719825079302.png (29.0 KiB)
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.

Fideri avatar image Fideri commented ·

Very helpful, thank you. I'm trying those options.

0 Likes 0 ·