Hi There
I am struggling to get the Consumption Forecast, is this possible? Please see below:
This site is now in read-only archive mode. Please move all discussion, and create a new account at the new Victron Community site.
Hi There
I am struggling to get the Consumption Forecast, is this possible? Please see below:
Yes, you need to do it using http request node.
function -> http request (GET) -> json
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=forecast&interval=hours&start=" + start + "&end=" + end, 'headers': { 'x-authorization': "Token " + VRM_ACCESS_TOKEN } } ];
You can use the flow as shown below:
After injecting the timestamp, the information on the solar yield gets fetched:
The records part shows, per hour, the expected yield. The first field in that hourly array is the timestamp, the second one the expected yield for that hour.
The totals shows the expected totals for the day. Note that this only works on sites that produce solar. If your site does not produce solar, the records and totals will show 'false':
For full reference:
Webinar Part 1 - Intro to Node-Red
Webinar Part 2- Basic Palettes
Webinar Part 3 - Advanced example
Victron Node-RED for dummies guide by Fideri
Node Red Community Space (normally hidden)
Venus OS Large (Node-RED) manual
Victron Node-RED github readme
Victron Node-RED custom nodes docs
Additional resources still need to be added for this topic
49 People are following this question.