summaryrefslogtreecommitdiffstats
path: root/node.d/fronius.node.js
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2018-03-27 21:28:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2018-03-27 21:28:21 +0000
commitd4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c (patch)
treefaac99f51f182bb8c0a03e95e393d421ac9ddf42 /node.d/fronius.node.js
parentNew upstream version 1.9.0+dfsg (diff)
downloadnetdata-d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c.tar.xz
netdata-d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c.zip
New upstream version 1.10.0+dfsgupstream/1.10.0+dfsg
Diffstat (limited to 'node.d/fronius.node.js')
-rw-r--r--node.d/fronius.node.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/node.d/fronius.node.js b/node.d/fronius.node.js
index 7aa2c13b7..fc49e5d38 100644
--- a/node.d/fronius.node.js
+++ b/node.d/fronius.node.js
@@ -24,6 +24,7 @@ var fronius = {
consumptionLoadId: "p_load",
autonomyId: "rel_autonomy",
consumptionSelfId: "rel_selfconsumption",
+ solarConsumptionId: "solar_consumption",
energyTodayId: "e_day",
energyYearId: "e_year",
@@ -101,6 +102,7 @@ var fronius = {
var dim = {};
dim[fronius.autonomyId] = this.createBasicDimension(fronius.autonomyId, "autonomy", 1);
dim[fronius.consumptionSelfId] = this.createBasicDimension(fronius.consumptionSelfId, "self_consumption", 1);
+ dim[fronius.solarConsumptionId] = this.createBasicDimension(fronius.solarConsumptionId, "solar_consumption", 1);
chart = {
id: id, // the unique id of the chart
@@ -255,10 +257,17 @@ var fronius = {
parseAutonomyChart: function (service, site) {
var selfConsumption = site.rel_SelfConsumption;
+ var solarConsumption = 0;
+ var load = Math.abs(site.P_Load);
+ var power = Math.max(site.P_PV, 0);
+ if (power <= 0) solarConsumption = 0;
+ else if (load >= power) solarConsumption = 100;
+ else solarConsumption = 100 / power * load;
return this.getChart(this.getSiteAutonomyChart(service, "autonomy"),
[
this.getDimension(this.autonomyId, Math.round(site.rel_Autonomy)),
- this.getDimension(this.consumptionSelfId, Math.round(selfConsumption === null ? 100 : selfConsumption))
+ this.getDimension(this.consumptionSelfId, Math.round(selfConsumption === null ? 100 : selfConsumption)),
+ this.getDimension(this.solarConsumptionId, Math.round(solarConsumption))
]
);
},