Skip to content

Commit db14894

Browse files
author
Steve R
committed
mysolarpv.php Add Solar Threshold to Edit options
1 parent 836553d commit db14894

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/OpenEnergyMonitor/mysolarpv/mysolarpv.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ function getTranslations(){
176176
'Cumulative solar generation in kWh': "<?php echo _('Cumulative solar generation in kWh') ?>",
177177
'Cumulative grid import in kWh': "<?php echo _('Cumulative grid import in kWh') ?>",
178178
'Display power as kW': "<?php echo _('Display power as kW') ?>",
179+
'Display solar power as 0 below this threshold in w': "<?php echo _('Display solar power as 0 below this threshold in w') ?>",
179180
'PERFECT BALANCE': "<?php echo _('PERFECT BALANCE') ?>",
180181
'EXPORTING': "<?php echo _('EXPORTING') ?>",
181182
'IMPORTING': "<?php echo _('IMPORTING') ?>",
@@ -211,7 +212,8 @@ function getTranslations(){
211212
"use_kwh":{"optional":true, "type":"feed", "autoname":"use_kwh", "description":_("Cumulative use in kWh")},
212213
"solar_kwh":{"optional":true, "type":"feed", "autoname":"solar_kwh", "description":_("Cumulative solar generation in kWh")},
213214
"import_kwh":{"optional":true, "type":"feed", "autoname":"import_kwh", "description":_("Cumulative grid import in kWh")},
214-
"kw":{"type":"checkbox", "default":0, "name": "Show kW", "description":_("Display power as kW")}
215+
"kw":{"type":"checkbox", "default":0, "name": "Show kW", "description":_("Display power as kW")},
216+
"solar_disp_min":{"type":"value", "default":10, "name": "Solar Threshold", "description":_("Display solar power as 0 below this threshold in w")}
215217
//"import_unitcost":{"type":"value", "default":0.1508, "name": "Import unit cost", "description":"Unit cost of imported grid electricity"}
216218
};
217219
config.name = "<?php echo $name; ?>";
@@ -434,7 +436,7 @@ function livefn()
434436
view.start = now - live_timerange;
435437
}
436438
// Lower limit for solar
437-
if (solar_now<10) solar_now = 0;
439+
if (solar_now<config.app.solar_disp_min.value) solar_now = 0;
438440

439441
var balance = solar_now - use_now;
440442
if (balance==0) {
@@ -537,7 +539,7 @@ function draw_powergraph() {
537539
// -------------------------------------------------------------------------------------------------------
538540
// Supply / demand balance calculation
539541
// -------------------------------------------------------------------------------------------------------
540-
if (solar_now<10) solar_now = 0;
542+
if (solar_now<config.app.solar_disp_min.value) solar_now = 0;
541543
var balance = solar_now - use_now;
542544

543545
if (balance>=0) total_use_direct_kwh += (use_now*interval)/(1000*3600);

0 commit comments

Comments
 (0)