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/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 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..ba9448f04 100644 --- a/web/display/cards/index.html +++ b/web/display/cards/index.html @@ -19,6 +19,7 @@ +
@@ -652,7 +653,7 @@

12:36

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

12:36

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

12:36

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

12:36

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

12:36

}); $('#backend .reloadBtn').click(function() { - location.reload(); + window.location = window.location.pathname; });
@@ -1933,6 +1934,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){ @@ -1952,7 +1956,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); @@ -2225,6 +2229,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 +2338,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 +2374,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 @@ -2412,7 +2418,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/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..86f11a7ec 100644 --- a/web/display/colors/index.html +++ b/web/display/colors/index.html @@ -27,7 +27,7 @@ - +
@@ -292,7 +292,7 @@

11:11

}); $('#backend .reloadBtn').click(function () { - location.reload(); + window.location = window.location.pathname; });
@@ -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; @@ -956,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); + }); }); 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(); } } 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 @@