summaryrefslogtreecommitdiffstats
path: root/node.d
diff options
context:
space:
mode:
authorBrainDoctor <github.account@chrigel.net>2017-07-06 22:01:56 +0200
committerBrainDoctor <github.account@chrigel.net>2017-07-06 22:01:56 +0200
commit29e6fa69521b5b478bc7bc8ae23890e0e5febfa2 (patch)
treec7b39a608553bbb283d68568d8f0fd5f4c1644f4 /node.d
parentb25815c0a753516f73f7c288418b3a3a391d94b2 (diff)
Fixed a bug where the self consumption would jump to zero when collected a null value from the API, which should be 100% in this case.
Diffstat (limited to 'node.d')
-rw-r--r--node.d/fronius.node.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/node.d/fronius.node.js b/node.d/fronius.node.js
index 555df2b95c..eb7fd1b7c9 100644
--- a/node.d/fronius.node.js
+++ b/node.d/fronius.node.js
@@ -233,7 +233,8 @@ var fronius = {
// Site Autonomy Chart
service.begin(fronius.getSiteAutonomyChart(service, 'fronius_' + service.name + '.autonomy'));
service.set(fronius.autonomyId, Math.round(site.rel_Autonomy));
- service.set(fronius.consumptionSelfId, Math.round(site.rel_SelfConsumption));
+ var selfConsumption = site.rel_SelfConsumption;
+ service.set(fronius.consumptionSelfId, Math.round(selfConsumption === null ? 100 : selfConsumption));
service.end();
// Site Energy Today Chart