question

Ulrich avatar image
Ulrich asked

reload past data from VRM to local influx db

I use Grafana to display data from my installation. (https://www.zoomsoft.de/grafana)

Sometimes it happens that the connection is lost and the data is not currently transferred to the local database.

Is there a script with which I can reload the data from VRM?

VRMgrafana
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.

Ulrich avatar image Ulrich commented ·
In influxdb.js i found this.lastWriteTime = Date.now()

But this is not the starttime to load data from vrm.

Where/how exactly could i set it?

​​​
0 Likes 0 ·
1 Answer
joanspark avatar image
joanspark answered ·

Do you mean something like this?

https://docs.victronenergy.com/vrmapi/overview.html#get-the-energy-readings-for-a-given-site-installation

"Get the energy readings for a given site/installation
The energy readings consist of various data attributes, which can be combined to give a total amount. The values of the different data attributes for the given period and interval are returned, and the sum of the attributes is also included in the response of the endpoint.

Endpoint:
https://vrmapi.victronenergy.com/v2/installations/{installation ID}/stats?type=kwh
Required parameters (GET):
start: Unix timestamp of the starting timestamp for which the stats should be retrieved
end: Unix timestamp of the ending timestamp for which the stats should be retrieved."

note this:

"There is a maximum allowed time period for each interval, which is:

  • 31 days for: 15mins
  • 31 days for hours
  • 180 days for days
  • 140 days for weeks
  • 24 months for months
  • 5 years for years

Requesting a larger time period will result in an error .."

Looks like the VRM db is a Grafana db as well, if one looks at the resolution of historical records and 15 min for the last 30 days is the highest resolution you will be able to acquire.
Your graphs seem to have a datapoint for every minute, so you'll be out of luck if you want this kind of resolution fromt he VRM as a sort of backup.

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.

Ulrich avatar image Ulrich commented ·

Unfortunately, I have dropouts for several hours. Filling these with 15 minute data would be better than having no data.

The description must be out of date, because when I request data from December 1st, 2020 in the VRM portal, I get values per hour. That would also be ok, especially for the annual overview, in which I don't show any more.

Unfortunately I cannot adapt the JS program so that the missing data is loaded.

It would be very useful if you could reload old data. Everyone who starts with Grafana would be happy if they had a lot of data right away.

Who can help me?

0 Likes 0 ·
Show more comments