Browse Source

add General overview for several inverters

pull/160/head
Sandner, Denny 3 years ago
parent
commit
3e82044840
  1. 1
      .gitignore
  2. 51
      tools/esp8266/app.cpp
  3. 2
      tools/esp8266/html/h/style_css.h
  4. 22
      tools/esp8266/html/style.css
  5. 24
      tools/esp8266/platformio.ini

1
.gitignore

@ -17,3 +17,4 @@ tools/esp8266/binaries
*.db
*.suo
*.ipch
/**/.vscode

51
tools/esp8266/app.cpp

@ -676,8 +676,13 @@ void app::showFavicon(void) {
//-----------------------------------------------------------------------------
void app::showLiveData(void) {
DPRINTLN(DBG_VERBOSE, F("app::showLiveData"));
String modHtml;
String modHtml, totalModHtml;
float totalYield = 0, totalYieldToday = 0, totalActual = 0;
uint8_t count = 0;
for(uint8_t id = 0; id < mSys->getNumInverters(); id++) {
count++;
Inverter<> *iv = mSys->getInverterByPos(id);
if(NULL != iv) {
#ifdef LIVEDATA_VISUALIZED
@ -695,6 +700,19 @@ void app::showLiveData(void) {
for(uint8_t fld = 0; fld < 10; fld++) {
pos = (iv->getPosByChFld(CH0, list[fld]));
if(fld == 6){
totalYield += iv->getValue(pos);
}
if(fld == 7){
totalYieldToday += iv->getValue(pos);
}
if(fld == 2){
totalActual += iv->getValue(pos);
}
if(0xff != pos) {
modHtml += F("<div class=\"subgrp\">");
modHtml += F("<span class=\"value\">") + String(iv->getValue(pos));
@ -745,7 +763,36 @@ void app::showLiveData(void) {
#endif
}
}
mWeb->send(200, F("text/html"), modHtml);
if(count > 1){
totalModHtml += F("<div class=\"iv\">"
"<div class=\"ch-all\"><span class=\"head\">Gesamt</span>");
totalModHtml += F("<div class=\"subgrp\">");
totalModHtml += F("<span class=\"value\">") + String(totalActual);
totalModHtml += F("<span class=\"unit\">W</span></span>");
totalModHtml += F("<span class=\"info\">P_AC All</span>");
totalModHtml += F("</div>");
totalModHtml += F("<div class=\"subgrp\">");
totalModHtml += F("<span class=\"value\">") + String(totalYieldToday);
totalModHtml += F("<span class=\"unit\">Wh</span></span>");
totalModHtml += F("<span class=\"info\">YieldDayAll</span>");
totalModHtml += F("</div>");
totalModHtml += F("<div class=\"subgrp\">");
totalModHtml += F("<span class=\"value\">") + String(totalYield);
totalModHtml += F("<span class=\"unit\">kWh</span></span>");
totalModHtml += F("<span class=\"info\">YieldTotalAll</span>");
totalModHtml += F("</div>");
totalModHtml += F("</div>");
totalModHtml += F("</div>");
mWeb->send(200, F("text/html"), totalModHtml + modHtml);
} else {
mWeb->send(200, F("text/html"), modHtml);
}
}

2
tools/esp8266/html/h/style_css.h

@ -1,4 +1,4 @@
#ifndef __STYLE_CSS_H__
#define __STYLE_CSS_H__
const char style_css[] PROGMEM = "h1 {margin:0;padding:20pt;font-size:22pt;color:#fff;background-color:#006ec0;display:block;text-transform:uppercase;}html, body {font-family:Arial;margin:0;padding:0;}p {text-align:justify;font-size:13pt;}p.lic, p.lic a {font-size:8pt;color:#999;}.des {margin-top:35px;font-size:13pt;color:#006ec0;}.subdes {font-size:12pt;color:#006ec0;margin-left:7px;}.subsubdes {font-size:12pt;color:#006ec0;margin:0 0 7px 12px;}.hide {display:none;}a:link, a:visited {text-decoration:none;font-size:13pt;color:#006ec0;}a:hover, a:focus {color:#f00;}a.erase {background-color:#006ec0;color:#fff;padding:7px;display:inline-block;margin-top:30px;float:right;}#content {padding:15px 15px 60px 15px;}#footer {position:fixed;bottom:0px;height:45px;background-color:#006ec0;width:100%;border-top:5px solid #fff;}#footer p, #footer a {color:#fff;padding:0 7px 0 7px;font-size:10pt !important;}div.content {background-color:#fff;padding-bottom:65px;overflow:auto;}input, select {padding:7px;font-size:13pt;}input.text, select {width:70%;box-sizing:border-box;margin-bottom:10px;border:1px solid #ccc;}input.sh {max-width:150px !important;margin-right:10px;}input.btn {background-color:#006ec0;color:#fff;border:0px;float:right;margin:10px 0 30px;text-transform:uppercase;}input.cb {margin-bottom:20px;}label {width:20%;display:inline-block;font-size:12pt;padding-right:10px;margin-left:15px;}.left {float:left;}.right {float:right;}div.ch-iv {width:100%;background-color:#32b004;display:inline-block;margin-bottom:15px;padding-bottom:20px;overflow:auto;}div.ch {width:220px;min-height:350px;background-color:#006ec0;display:inline-block;margin:0 10px 15px 10px;overflow:auto;padding-bottom:20px;}div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head {color:#fff;display:block;width:100%;text-align:center;}.subgrp {float:left;width:220px;}div.ch .unit, div.ch-iv .unit {font-size:19px;margin-left:10px;}div.ch .value, div.ch-iv .value {margin-top:20px;font-size:24px;}div.ch .info, div.ch-iv .info {margin-top:3px;font-size:10px;}div.ch .head {background-color:#003c80;padding:10px 0 10px 0;}div.ch-iv .head {background-color:#1c6800;padding:10px 0 10px 0;}div.iv {max-width:960px;margin-bottom:40px;}div.ts {font-size:13px;background-color:#ddd;border-top:7px solid #999;padding:7px;}#note {margin:50px 10px 10px 10px;padding-top:10px;width:100%;border-top:1px solid #bbb;}@media(max-width:500px) {div.ch .unit, div.ch-iv .unit {font-size:18px;}div.ch {width:170px;min-height:100px;}.subgrp {width:180px;}}";
const char style_css[] PROGMEM = "h1 {margin:0;padding:20pt;font-size:22pt;color:#fff;background-color:#006ec0;display:block;text-transform:uppercase;}html, body {font-family:Arial;margin:0;padding:0;}p {text-align:justify;font-size:13pt;}p.lic, p.lic a {font-size:8pt;color:#999;}.des {margin-top:35px;font-size:13pt;color:#006ec0;}.subdes {font-size:12pt;color:#006ec0;margin-left:7px;}.subsubdes {font-size:12pt;color:#006ec0;margin:0 0 7px 12px;}.hide {display:none;}a:link, a:visited {text-decoration:none;font-size:13pt;color:#006ec0;}a:hover, a:focus {color:#f00;}a.erase {background-color:#006ec0;color:#fff;padding:7px;display:inline-block;margin-top:30px;float:right;}#content {padding:15px 15px 60px 15px;}#footer {position:fixed;bottom:0px;height:45px;background-color:#006ec0;width:100%;border-top:5px solid #fff;}#footer p, #footer a {color:#fff;padding:0 7px 0 7px;font-size:10pt !important;}div.content {background-color:#fff;padding-bottom:65px;overflow:auto;}input, select {padding:7px;font-size:13pt;}input.text, select {width:70%;box-sizing:border-box;margin-bottom:10px;border:1px solid #ccc;}input.sh {max-width:150px !important;margin-right:10px;}input.btn {background-color:#006ec0;color:#fff;border:0px;float:right;margin:10px 0 30px;text-transform:uppercase;}input.cb {margin-bottom:20px;}label {width:20%;display:inline-block;font-size:12pt;padding-right:10px;margin-left:15px;}.left {float:left;}.right {float:right;}div.ch-iv {width:100%;background-color:#32b004;display:inline-block;margin-bottom:15px;padding-bottom:20px;overflow:auto;}div.ch-all {width:100%;background-color:#b06e04;display:inline-block;margin-bottom:15px;padding-bottom:20px;overflow:auto;}div.ch {width:220px;min-height:350px;background-color:#006ec0;display:inline-block;margin:0 10px 15px 10px;overflow:auto;padding-bottom:20px;}div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head, div.ch-all .value, div.ch-all .info, div.ch-all .head {color:#fff;display:block;width:100%;text-align:center;}.subgrp {float:left;width:220px;}div.ch .unit, div.ch-iv .unit, div.ch-all .unit {font-size:19px;margin-left:10px;}div.ch .value, div.ch-iv .value, div.ch-all .value {margin-top:20px;font-size:24px;}div.ch .info, div.ch-iv .info, div.ch-all .info {margin-top:3px;font-size:10px;}div.ch .head {background-color:#003c80;padding:10px 0 10px 0;}div.ch-iv .head {background-color:#1c6800;padding:10px 0 10px 0;}div.ch-all .head {background-color:#8e5903;padding:10px 0 10px 0;}div.iv {max-width:960px;margin-bottom:40px;}div.ts {font-size:13px;background-color:#ddd;border-top:7px solid #999;padding:7px;}#note {margin:50px 10px 10px 10px;padding-top:10px;width:100%;border-top:1px solid #bbb;}@media(max-width:500px) {div.ch .unit, div.ch-iv .unit {font-size:18px;}div.ch {width:170px;min-height:100px;}.subgrp {width:180px;}}";
#endif /*__STYLE_CSS_H__*/

22
tools/esp8266/html/style.css

@ -145,6 +145,15 @@ div.ch-iv {
overflow: auto;
}
div.ch-all {
width: 100%;
background-color: #b06e04;
display: inline-block;
margin-bottom: 15px;
padding-bottom: 20px;
overflow: auto;
}
div.ch {
width: 220px;
min-height: 350px;
@ -155,7 +164,7 @@ div.ch {
padding-bottom: 20px;
}
div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head {
div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, div.ch-iv .head, div.ch-all .value, div.ch-all .info, div.ch-all .head {
color: #fff;
display: block;
width: 100%;
@ -167,17 +176,17 @@ div.ch .value, div.ch .info, div.ch .head, div.ch-iv .value, div.ch-iv .info, d
width: 220px;
}
div.ch .unit, div.ch-iv .unit {
div.ch .unit, div.ch-iv .unit, div.ch-all .unit {
font-size: 19px;
margin-left: 10px;
}
div.ch .value, div.ch-iv .value {
div.ch .value, div.ch-iv .value, div.ch-all .value {
margin-top: 20px;
font-size: 24px;
}
div.ch .info, div.ch-iv .info {
div.ch .info, div.ch-iv .info, div.ch-all .info {
margin-top: 3px;
font-size: 10px;
}
@ -192,6 +201,11 @@ div.ch-iv .head {
padding: 10px 0 10px 0;
}
div.ch-all .head {
background-color: #8e5903;
padding: 10px 0 10px 0;
}
div.iv {
max-width: 960px;
margin-bottom: 40px;

24
tools/esp8266/platformio.ini

@ -22,16 +22,16 @@ lib_deps =
;esp8266/SPI@1.0
;esp8266/Ticker@^1.0
[env:node_mcu_v2]
platform = espressif8266
framework = arduino
board = nodemcuv2
monitor_speed = 115200
board_build.f_cpu = 80000000L
upload_port = /dev/ttyUSB0
;[env:node_mcu_v2]
;platform = espressif8266
;framework = arduino
;board = nodemcuv2
;monitor_speed = 115200
;board_build.f_cpu = 80000000L
;upload_port = /dev/ttyUSB0
lib_deps =
nrf24/RF24@1.4.2
paulstoffregen/Time@^1.6.1
knolleary/PubSubClient@^2.8
bblanchon/ArduinoJson@^6.19.4
;lib_deps =
; nrf24/RF24@1.4.2
; paulstoffregen/Time@^1.6.1
; knolleary/PubSubClient@^2.8
; bblanchon/ArduinoJson@^6.19.4

Loading…
Cancel
Save