question

dani-kalt avatar image
dani-kalt asked

Historical Data by Nodered in 15min interval like in download csv in cerbo

How i can read/export historical data (15min wise) via nodered like export in advanced mode on Cerbo? can i read that data in nodered?

cerbo gxNode-RED
2 |3000

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

2 Answers
Daniel Hillenbrand avatar image
Daniel Hillenbrand answered ·
    const VRM_ID = "XXXXXX";
    const VRM_ACCESS_TOKEN = "XXXXXXXXXXXXXXXX";
     
    let today = new Date();
     
    let startDate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0);
    let endDate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 23, 59, 59, 999);
     
    let start = Math.floor(startDate.getTime() / 1000);
    let end = Math.floor(endDate.getTime() / 1000);
     
    return [
        {
            'url': "https://vrmapi.victronenergy.com/v2/installations/" + VRM_ID + "/stats?type=custom&attributeCodes[]=Gb&interval=15mins&start=" + start + "&end=" + end,
            'headers': {
                'x-authorization': "Token " + VRM_ACCESS_TOKEN
            }
        }
    ];

Use http request node.

attributeCodes

Gb = Grid to battery

Bc = Battery direct use

Pb = Solar to battery

and so on. Didn't find an overview of all avail values in the docs, yet.


2 |3000

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

Daniel Hillenbrand avatar image
Daniel Hillenbrand answered ·

victron-vrm-api 0.0.11 now allows to select 15 mins interval.

2 |3000

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