Skip to content

Commit

Permalink
Improve Standby support, update of web interface (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
steff393 committed Aug 29, 2023
1 parent 9af72bf commit 913e081
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
25 changes: 25 additions & 0 deletions data/web.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
--theme-color-3: rgb(239, 239, 243);
--theme-color-4: rgb(0, 0, 0);
--theme-color-5: rgb(169, 169, 169);
--theme-color-6: rgb(255, 165, 0);
}

:root {
Expand All @@ -14,6 +15,7 @@

--headline-1-color: var(--theme-color-2);
--headline-2-color: var(--theme-color-3);
--connection-color: var(--theme-color-6);

--box-background-color: var(--theme-color-3);
--box-text-color: var(--theme-color-4);
Expand Down Expand Up @@ -47,6 +49,29 @@ h2 {
font-weight: normal;
}

.containerHeader {
display: flex;
justify-content: center;
align-items: center;
position: relative;
padding-top: var(--grid-size);
padding-bottom: calc(3*var(--grid-size));
}

.title {
text-align: center;
position: absolute;
left: 50%;
transform: translateX(-50%);
}

.connectionOff {
position: absolute;
right: 0;
color: var(--connection-color);
font-size: 0.75em;
}

footer {
margin-top: 20px;
text-align: center;
Expand Down
5 changes: 4 additions & 1 deletion data/web.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
<button id="btnExit" class="top-nav-item">&times;</button>
</nav>
<h1>wbec</h1>
<h2>Heidelberg Wallbox Energy Control</h2>
<div class="containerHeader">
<h2 class="title">Heidelberg Wallbox Energy Control</h2>
<span class="connectionOff" id="connection">Offline /<br>Standby</span>
</div>
</header>

<section class="box-group" id="boxSelection">
Expand Down
2 changes: 2 additions & 0 deletions data/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ window.addEventListener('DOMContentLoaded', () => {
let sliderSliding = false;

function init() {
setSectionVisibility('connection', false);
setSectionVisibility('boxSelection', wallboxButtons.length > 1);
setSectionVisibility('pvLaden', false);

Expand Down Expand Up @@ -107,6 +108,7 @@ window.addEventListener('DOMContentLoaded', () => {
for (const element of pvModeButtons) {
setClass(element, 'active', message.pvMode === parseInt(element.getAttribute('data-pv-mode')));
}
setSectionVisibility('connection', message.failCnt >= 10);
setSectionVisibility('pvLaden', message.pvMode >= 1 && message.pvMode <= 3);

for (const element of wallboxButtons) {
Expand Down
2 changes: 1 addition & 1 deletion src/globalConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void loadConfig() {
cfgBootlogSize = doc["cfgBootlogSize"] | 2000;
cfgBtnDebounce = doc["cfgBtnDebounce"] | 0;
cfgWifiConnectTimeout = doc["cfgWifiConnectTimeout"] | 10;
cfgResetOnTimeout = doc["cfgResetOnTimeout"] | 1;
cfgResetOnTimeout = doc["cfgResetOnTimeout"] | 0;

LOG(m, "cfgWbecVersion: %s", cfgWbecVersion);
LOG(m, "cfgBuildDate: %s" , cfgBuildDate);
Expand Down
1 change: 1 addition & 0 deletions src/webSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void webSocket_loop() {
data[F("energyI")] = (float)((uint32_t) content[id][13] << 16 | (uint32_t)content[id][14]) / 1000.0;
data[F("energyC")] = (float)goE_getEnergySincePlugged(id) / 1000.0;
data[F("currLim")] = (float)content[id][53]/10.0;
data[F("failCnt")] = mb_getFailureCnt(id);
data[F("watt")] = pv_getWatt();
data[F("pvMode")] = pv_getMode();
data[F("timeNow")] = log_time();
Expand Down

0 comments on commit 913e081

Please sign in to comment.