From 5838cb391aa11ce69c93bc4cce1c9028f2866c08 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sat, 9 Dec 2023 12:24:17 +0100 Subject: [PATCH 01/10] Added debugging vor Hausverbauch calculation, in case discrepancies come up --- loadvars.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/loadvars.sh b/loadvars.sh index 3ba4f54ae..663200988 100755 --- a/loadvars.sh +++ b/loadvars.sh @@ -1073,6 +1073,7 @@ loadvars(){ verb3_w=$(printf "%.0f\n" $verb3_w) #hausverbrauch=$((wattbezugint - pvwatt - ladeleistung - speicherleistung - shd1_w - shd2_w - shd3_w - shd4_w - shd5_w - shd6_w - shd7_w - shd8_w - shd9_w - verb1_w - verb2_w - verb3_w)) + openwbDebugLog "Main" 0 "Hausverbrauch: Wattbezug: $wattbezugint ; PVWatt: $pvwatt ; Ladeleistung: $ladeleistung ; Speicherleistung: $speicherleistung ; SHDall: $shdall_w ; Verb1: $verb1_w ; Verb2: $verb2_w ; Verb3: $verb3_w" hausverbrauch=$((wattbezugint - pvwatt - ladeleistung - speicherleistung - shdall_w - verb1_w - verb2_w - verb3_w)) if ((hausverbrauch < 0)); then if [ -f /var/www/html/openWB/ramdisk/hausverbrauch.invalid ]; then From 140da82746dd244552eb0b1d560333ba58de4284 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sat, 9 Dec 2023 13:16:46 +0100 Subject: [PATCH 02/10] changed the cards theme to instantly show the code box --- web/display/cards/index.html | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/web/display/cards/index.html b/web/display/cards/index.html index 3106ead10..fa054e741 100644 --- a/web/display/cards/index.html +++ b/web/display/cards/index.html @@ -652,7 +652,7 @@

12:36

$('#ladepunktConfigModal').find('[data-config-lp="'+currentLp+'"]').removeClass('hide'); $('#ladepunktConfigModal').modal("show"); } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } }); @@ -660,7 +660,7 @@

12:36

if( displaylocked == false ){ $("#chargeModeModal").modal("show"); } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } }); @@ -677,7 +677,7 @@

12:36

} } } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } }); @@ -688,7 +688,7 @@

12:36

$('#socModal').find('.socLp').text(currentLp); $('#socModal').modal("show"); } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } } }); @@ -1933,6 +1933,9 @@

12:36

function addLockNumber(e){ var v = $( "#Lockbox" ).val(); $( "#Lockbox" ).val( v + e.value ); + if ($( "#Lockbox" ).val().length == 4) { + submitLockForm(PINbox); + } } function clearLockForm(e){ @@ -2225,6 +2228,14 @@

var lockTimeout = 60000; var displaylocked = true; + function triggerUnlockDisplay() { + if( displaylocked == true ){ + $("#lockModal").modal("show"); + } else { + lockDisplay(true); + } + } + function lockDisplay( lock = true ){ if( lock == false ){ displaylocked = false; @@ -2326,7 +2337,7 @@

$('.sidenav').find('a[href^="#"]').on("click", function(event) { if( $(this).hasClass('displayLock') && displaylocked == true ) { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } else { // hide all panels $('.resume').addClass('hide'); @@ -2362,13 +2373,7 @@

} ); - $('#displaylock').on("click", function(){ - if( displaylocked == true ){ - $("#lockModal").modal("show"); - } else { - lockDisplay(true); - } - }); + $('#displaylock').on("click", triggerUnlockDisplay); $('.btn-group-toggle').change(function(event){ // only charge limitation has class btn-group-toggle so far From 4244b7099d2db8de2a66f58e860b86e48fa99758 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sat, 9 Dec 2023 13:20:05 +0100 Subject: [PATCH 03/10] Changed the "success" period from 1000ms to 250ms so screen usable more instantly after a successful code input. --- web/display/cards/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/display/cards/index.html b/web/display/cards/index.html index fa054e741..9551df8bd 100644 --- a/web/display/cards/index.html +++ b/web/display/cards/index.html @@ -1955,7 +1955,7 @@

12:36

$('#Lockcode').find('.enter').prop('disabled', false); $( "#Lockbox" ).val( "" ); $("#lockModal").modal("hide"); - }, 1000); + }, 300); } else { $('#lockModal').find('.modal-body').addClass('bg-danger'); $('#Lockcode').find('.enter').prop('disabled', true); From 6c8a066317c38b9721ddf8210fe2e209cb1737ea Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sat, 9 Dec 2023 14:00:09 +0100 Subject: [PATCH 04/10] adding instant unlock screen to the "colors" theme fixing a bug where in the colors theme the tap on the loading point would raise an exception due to a change in the modeButtonClicked method signature --- web/display/colors/chargePointList.js | 31 ++++++++++++++------------- web/display/colors/index.html | 13 ++++++++++- web/display/colors/powerdata.js | 2 +- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/web/display/colors/chargePointList.js b/web/display/colors/chargePointList.js index ba2346d27..311290449 100644 --- a/web/display/colors/chargePointList.js +++ b/web/display/colors/chargePointList.js @@ -27,18 +27,19 @@ class ChargePointList { const chargePoint = this.cplist .selectAll("rows") .data(this.chargepoints).enter() - .append("div").attr("class", "container-fluid mt-3 p-0") - ; + .append("div").attr("class", "container-fluid mt-3 p-0"); chargePoint.html((row, index) => ` -
- ${this.cpNameRow(row, index)} -
-
- ${this.cpChargeInfoRow(row, index)} -
-
- ${this.cpChargeModeRow(row, index)} -
` + +
+ ${this.cpNameRow(row, index)} +
+
+ ${this.cpChargeInfoRow(row, index)} +
+
+ ${this.cpChargeModeRow(row, index)} +
` + ) this.updateValues(); } @@ -212,7 +213,7 @@ function configButtonClicked(index) { // $('#ladepunktConfigModal').find('[data-config-lp="' + (index + 1) + '"]').removeClass('hide'); $('#ladepunktConfigModal').modal("show"); } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } } @@ -270,7 +271,7 @@ function modeButtonClicked(index) { $("#chargeModeModal").modal("show"); } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } } @@ -278,14 +279,14 @@ function socSetButtonClicked(index) { if (wbdata.displaylocked == false) { $("#socModal").modal("show"); } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } } function socLoadButtonClicked(index) { if (wbdata.displaylocked == false) { publish("1", "openWB/set/lp/" + (+index + 1) + "/ForceSoCUpdate"); } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } } var chargePointList = new ChargePointList(); diff --git a/web/display/colors/index.html b/web/display/colors/index.html index 744ca49a8..a6a3453d9 100644 --- a/web/display/colors/index.html +++ b/web/display/colors/index.html @@ -504,6 +504,9 @@

11:11

function addLockNumber(e) { var v = $("#Lockbox").val(); $("#Lockbox").val(v + e.value); + if ($("#Lockbox").val().length == 4) { + submitLockForm(PINbox); + } } function clearLockForm(e) { @@ -523,7 +526,7 @@

11:11

$('#Lockcode').find('.enter').prop('disabled', false); $("#Lockbox").val(""); $("#lockModal").modal("hide"); - }, 1000); + }, 250); } else { $('#lockModal').find('.modal-body').addClass('bg-danger'); $('#Lockcode').find('.enter').prop('disabled', true); @@ -829,6 +832,14 @@

var lockTimeout = 60000; wbdata.displaylocked = true; + function triggerUnlockDisplay() { + if(wbdata.displaylocked == true){ + $("#lockModal").modal("show"); + } else { + lockDisplay(true); + } + } + function lockDisplay(lock = true) { if (lock == false) { wbdata.displaylocked = false; diff --git a/web/display/colors/powerdata.js b/web/display/colors/powerdata.js index dee29ce9a..15decd758 100644 --- a/web/display/colors/powerdata.js +++ b/web/display/colors/powerdata.js @@ -476,7 +476,7 @@ function showStatus() { if (wbdata.displaylocked == false) { $("#statusModal").modal("show"); } else { - $("#lockInfoModal").modal("show"); + triggerUnlockDisplay(); } } From ef251bc95ac38f518c0c5ca7505272aa746a6d73 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sat, 9 Dec 2023 14:00:56 +0100 Subject: [PATCH 05/10] removed unnecessary white spaces in backets --- web/display/cards/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/display/cards/index.html b/web/display/cards/index.html index 9551df8bd..fb81687c2 100644 --- a/web/display/cards/index.html +++ b/web/display/cards/index.html @@ -2229,7 +2229,7 @@

var displaylocked = true; function triggerUnlockDisplay() { - if( displaylocked == true ){ + if(displaylocked == true){ $("#lockModal").modal("show"); } else { lockDisplay(true); From fdfdb0bc6718f7df9ac5f3b62511b16a834a1500 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sat, 9 Dec 2023 19:42:00 +0100 Subject: [PATCH 06/10] Implemented a flag signaling valid rfids which would allow the screen to unlock if an rfid is assigned to a car or part of the rfid list when rfid modus=2 --- openwb.conf | 1 + web/display/cards/index.html | 27 +++++++++++++++++++++++- web/settings/misc.php | 19 +++++++++++++++++ web/values.php | 40 ++++++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 1 deletion(-) diff --git a/openwb.conf b/openwb.conf index c5600b81c..aa8253481 100755 --- a/openwb.conf +++ b/openwb.conf @@ -270,3 +270,4 @@ soc_aiwayslp2_user='' soc_aiwayslp2_pass='' soc_aiwayslp2_vin='' soc_aiwayslp2_intervall='' +unlockscreenrfid=0 diff --git a/web/display/cards/index.html b/web/display/cards/index.html index 3106ead10..c140f8ed8 100644 --- a/web/display/cards/index.html +++ b/web/display/cards/index.html @@ -42,9 +42,14 @@

12:36

+
+
@@ -2412,7 +2417,27 @@

} }, 2000); }); - + // + var queryString = window.location.search; + var urlParams = new URLSearchParams(queryString); + var ids = urlParams.get('rfidlist') + rfidArray = ids.split(",").filter(n => parseInt(n) > 0); + + $(document).keydown(function (e) { + if (e.keyCode >= 48 && e.keyCode <= 57 && $('#rfidwebread').val().length < 10) { + var old = $('#rfidwebread').val(); + $('#rfidwebread').val(old+String.fromCharCode(e.keyCode)); + } else if (event.keyCode == 13 || $('#rfidwebread').val().length == 10) { + var rfid = $('#rfidwebread').val(); + $('#rfidwebread').val(''); + if (rfidArray.includes(rfid)) { + lockDisplay(false); + } + } + window.setTimeout(function() { + $('#rfidwebread').val('') + }, 3000); + }); }); diff --git a/web/settings/misc.php b/web/settings/misc.php index d46e19233..c454754ac 100644 --- a/web/settings/misc.php +++ b/web/settings/misc.php @@ -344,6 +344,15 @@ function visibility_cpminlaufzeit() {

+
+
+
+
+ + > Display entsperren wenn Auto zugwiesen. Display sperrt sich automatisch nach der eingestellten Zeit. +
+
+

@@ -770,6 +779,16 @@ function visibility_cpminlaufzeit() {
Im Modus 2 wird eine Kommaseparierte Liste mit gültigen RFID Tags hinterlegt. Gescannt werden kann an jedem möglichen RFID Leser. Heißt auch bei mehreren Ladepunkten kann an einem zentralen RFID Leser gescannt werden. Der gescannte Tag wird dem zuletzt angeschlossenenen Auto zugewiesen, schaltet den Ladepunkt frei und vermerkt dies für das Ladelog. Wird erst gescannt und dann ein Auto angeschlossen wird der Tag dem Auto zugewiesen das als nächstes ansteckt. Wird 5 Minuten nach Scannen kein Auto angeschlossen wird der Tag verworfen. Jeder Ladepunkt wird nach abstecken automatisch wieder gesperrt.
+ +
+
+
+ + > Display entsperren wenn Auto zugwiesen. Display sperrt sich automatisch nach der eingestellten Zeit. +
+
+
+
diff --git a/web/values.php b/web/values.php index 6adf41b5f..2ba509a93 100644 --- a/web/values.php +++ b/web/values.php @@ -1,4 +1,7 @@ Date: Sun, 10 Dec 2023 11:08:08 +0100 Subject: [PATCH 07/10] reloading the dashboard without query parameters --- web/display/colors/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/display/colors/index.html b/web/display/colors/index.html index a6a3453d9..8dc2ed2e4 100644 --- a/web/display/colors/index.html +++ b/web/display/colors/index.html @@ -292,7 +292,7 @@

11:11

}); $('#backend .reloadBtn').click(function () { - location.reload(); + window.location = window.location.pathname; });
From d264a14e544c7462fd5cbfaae174e2d00bc55e7c Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sun, 10 Dec 2023 11:11:27 +0100 Subject: [PATCH 08/10] Changed reload behaviour for the cards theme as well --- web/display/cards/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/display/cards/index.html b/web/display/cards/index.html index 15f490ea2..cf3e26fcc 100644 --- a/web/display/cards/index.html +++ b/web/display/cards/index.html @@ -853,7 +853,7 @@

12:36

}); $('#backend .reloadBtn').click(function() { - location.reload(); + window.location = window.location.pathname; });
From 5e8989c203e82db911b4be1e5d3860b1fbe4ee12 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sun, 10 Dec 2023 13:03:57 +0100 Subject: [PATCH 09/10] - adjusted .gitignore to ignor sed temp files - implemented rfid screen unlock for the colors theme --- .gitignore | 1 + web/display/colors/index.html | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7c31173ed..b248b56a3 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ modules/soc_vwid/secrets.py __pycache__ openwb.conf.* web/backup/*.tar.gz +sed* \ No newline at end of file diff --git a/web/display/colors/index.html b/web/display/colors/index.html index 8dc2ed2e4..86f11a7ec 100644 --- a/web/display/colors/index.html +++ b/web/display/colors/index.html @@ -27,7 +27,7 @@ - +
@@ -967,6 +967,27 @@

var option = $('input[name="' + elementId + '"]:checked').data('option').toString(); wbdata.setChargeLimitMode(option) }); + + var urlParams = new URLSearchParams(queryString); + var ids = urlParams.get('rfidlist') + rfidArray = ids.split(",").filter(n => parseInt(n) > 0); + + $(document).keydown(function (e) { + if (e.keyCode >= 48 && e.keyCode <= 57 && $('#rfidwebread').val().length < 10) { + var old = $('#rfidwebread').val(); + $('#rfidwebread').val(old+String.fromCharCode(e.keyCode)); + console.log($('#rfidwebread').val()); + } else if (event.keyCode == 13 || $('#rfidwebread').val().length == 10) { + var rfid = $('#rfidwebread').val(); + $('#rfidwebread').val(''); + if (rfidArray.includes(rfid)) { + lockDisplay(false); + } + } + window.setTimeout(function() { + $('#rfidwebread').val('') + }, 3000); + }); }); From 515e33bd4bfece645f53634a072a5f5c3ec0e4f7 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Lendholt Date: Sun, 10 Dec 2023 13:18:21 +0100 Subject: [PATCH 10/10] removed unnecessary html comment and moved hidden field to top of document --- web/display/cards/index.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/web/display/cards/index.html b/web/display/cards/index.html index cf3e26fcc..ba9448f04 100644 --- a/web/display/cards/index.html +++ b/web/display/cards/index.html @@ -19,6 +19,7 @@ +
@@ -42,14 +43,9 @@

12:36

-
-