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.
BrainDoctor committed
Jul 6, 2017 at 22:01 UTC
29e6fa69521b5b478bc7bc8ae23890e0e5febfa2
1 file changed
+2
-1
node.d/fronius.node.js
+2
-1
@@ -233,7 +233,8 @@ var fronius = {
233
// Site Autonomy Chart
234
service.begin(fronius.getSiteAutonomyChart(service, 'fronius_' + service.name + '.autonomy'));
235
service.set(fronius.autonomyId, Math.round(site.rel_Autonomy));
236
- service.set(fronius.consumptionSelfId, Math.round(site.rel_SelfConsumption));
236
+ var selfConsumption = site.rel_SelfConsumption;
237
+ service.set(fronius.consumptionSelfId, Math.round(selfConsumption === null ? 100 : selfConsumption));
238
service.end();
239
240
// Site Energy Today Chart