Skip to content

Commit

Permalink
Merge pull request #1 from ockernuts/develop
Browse files Browse the repository at this point in the history
kWh display and small SSDP Update
  • Loading branch information
ockernuts authored Dec 15, 2023
2 parents ba6fccb + 3ac7eda commit d9886ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ <h3><span id="current_quarter_title"></span></h3>
xAxis = this.xAxis,
points = this.points,
avg = 0,
counter = 0
counter = 0,
kWh = 0

this.yData.forEach(function(val) { counter++; avg += val; } );

this.yData.forEach(function(val) { counter++; avg += val; kWh += val*5/3600000 } );
if (counter != 0) {
avg /= counter;
} else {
Expand All @@ -186,7 +188,8 @@ <h3><span id="current_quarter_title"></span></h3>
}

return this.name + '<br>' + 'Laatst: ' + Math.abs(lastVal) + ' Watt<br>' +
'<span style="color: ' + color + '">Gem: ' + Math.abs(avg).toFixed(0) + ' Watt</span><br/>'
'<span style="color: ' + color + '">Gem: ' + Math.abs(avg).toFixed(0) + ' Watt</span><br/>' +
'Tot: ' + kWh.toFixed(3) + ' kWh'
}
}
});
Expand Down Expand Up @@ -347,6 +350,7 @@ <h3><span id="current_quarter_title"></span></h3>
chartT.series[1].addPoint([point_time, produced_power], false, false, false);
}
}
chartT.xAxis[0].setExtremes(quarter_date_time.getTime(), quarter_date_time.getTime() + 15*60*1000, false);
chartT.hideLoading();
chartT.redraw(false); // false -> no animation.
}
Expand All @@ -362,7 +366,7 @@ <h3><span id="current_quarter_title"></span></h3>
function getBaseUrl() {
root_part_of_url = window.location.origin
if (window.location.origin.startsWith("http://localhost")) {
root_part_of_url = "http://192.168.0.250"
root_part_of_url = "http://powerbeesie.local"
}
return root_part_of_url;

Expand Down
6 changes: 3 additions & 3 deletions lib/wifimanager/wifimanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,13 @@ void MyWiFiManager::PostWebServerStartSSDPInit() {
SSDP.setURL("index.html");
//set model name
//Null string if not set
SSDP.setModelName("Digitale Meter Monitor");
SSDP.setModelName(BOARD_NAME);
//set model description
//Null string if not set
SSDP.setModelDescription("This device can be controled by WiFi");
SSDP.setModelDescription("Digitale Meter Monitor");
//set model number
//Null string if not set
SSDP.setModelNumber(BOARD_NAME);
SSDP.setModelNumber(AUTO_VERSION);
//set model url
//Null string if not set
SSDP.setModelURL("https://github.com/ockernuts/digital-power-meter-monitor");
Expand Down

0 comments on commit d9886ff

Please sign in to comment.