Skip to content

Commit

Permalink
only show cop points if less than 3 months
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea committed Nov 16, 2023
1 parent fc8bb70 commit 8393646
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions apps/OpenEnergyMonitor/myheatpump/myheatpump.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var inst_cop_max = 6;
var inst_cop_mv_av_dp = 0;
var kw_at_50 = 0;
var kw_at_50_for_volume = 0;
var show_daily_cop_series = true;

var realtime_cop_div_mode = "30min";

Expand Down Expand Up @@ -1204,19 +1205,21 @@ function bargraph_load(start,end)

// add series that shows COP points for each day
if (heat_enabled) {
cop_data = [];
for (var z in data["heatpump_elec_kwhd"]) {
time = data["heatpump_elec_kwhd"][z][0];
elec = data["heatpump_elec_kwhd"][z][1];
heat = data["heatpump_heat_kwhd"][z][1];
if (elec && heat) {
cop_data[z] = [ time, heat / elec ];
if ((end - start)<(3600*24*120*1000)) {
cop_data = [];
for (var z in data["heatpump_elec_kwhd"]) {
time = data["heatpump_elec_kwhd"][z][0];
elec = data["heatpump_elec_kwhd"][z][1];
heat = data["heatpump_heat_kwhd"][z][1];
if (elec && heat) {
cop_data[z] = [ time, heat / elec ];
}
}
bargraph_series.push({
data: cop_data, color: "#44b3e2", yaxis:3,
points: { show: true }
});
}
bargraph_series.push({
data: cop_data, color: "#44b3e2", yaxis:3,
points: { show: true }
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/OpenEnergyMonitor/myheatpump/myheatpump.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,4 @@
config.name = "<?php echo $name; ?>";
config.db = <?php echo json_encode($config); ?>;
</script>
<script type="text/javascript" src="<?php echo $path; ?>Modules/app/apps/OpenEnergyMonitor/myheatpump/myheatpump.js?v=70"></script>
<script type="text/javascript" src="<?php echo $path; ?>Modules/app/apps/OpenEnergyMonitor/myheatpump/myheatpump.js?v=71"></script>

0 comments on commit 8393646

Please sign in to comment.