Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ modules/soc_vwid/secrets.py
__pycache__
openwb.conf.*
web/backup/*.tar.gz
sed*
1 change: 1 addition & 0 deletions loadvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions openwb.conf
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,4 @@ soc_aiwayslp2_user=''
soc_aiwayslp2_pass=''
soc_aiwayslp2_vin=''
soc_aiwayslp2_intervall=''
unlockscreenrfid=0
56 changes: 41 additions & 15 deletions web/display/cards/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</head>

<body>
<input type="hidden" value="" id="rfidwebread" />
<!-- Side navigation -->
<div class="sidenav pt-3">
<!-- date and lock status -->
Expand Down Expand Up @@ -652,15 +653,15 @@ <h4 id="time" class="col text-center text-light">12:36</h4>
$('#ladepunktConfigModal').find('[data-config-lp="'+currentLp+'"]').removeClass('hide');
$('#ladepunktConfigModal').modal("show");
} else {
$("#lockInfoModal").modal("show");
triggerUnlockDisplay();
}
});

$('.chargeModeSelectBtn').on("click", function(event){
if( displaylocked == false ){
$("#chargeModeModal").modal("show");
} else {
$("#lockInfoModal").modal("show");
triggerUnlockDisplay();
}
});

Expand All @@ -677,7 +678,7 @@ <h4 id="time" class="col text-center text-light">12:36</h4>
}
}
} else {
$("#lockInfoModal").modal("show");
triggerUnlockDisplay();
}
});

Expand All @@ -688,7 +689,7 @@ <h4 id="time" class="col text-center text-light">12:36</h4>
$('#socModal').find('.socLp').text(currentLp);
$('#socModal').modal("show");
} else {
$("#lockInfoModal").modal("show");
triggerUnlockDisplay();
}
}
});
Expand Down Expand Up @@ -848,7 +849,7 @@ <h4 id="time" class="col text-center text-light">12:36</h4>
});

$('#backend .reloadBtn').click(function() {
location.reload();
window.location = window.location.pathname;
});
</script>
</div>
Expand Down Expand Up @@ -1933,6 +1934,9 @@ <h4 id="time" class="col text-center text-light">12:36</h4>
function addLockNumber(e){
var v = $( "#Lockbox" ).val();
$( "#Lockbox" ).val( v + e.value );
if ($( "#Lockbox" ).val().length == 4) {
submitLockForm(PINbox);
}
}

function clearLockForm(e){
Expand All @@ -1952,7 +1956,7 @@ <h4 id="time" class="col text-center text-light">12:36</h4>
$('#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);
Expand Down Expand Up @@ -2225,6 +2229,14 @@ <h4 class="text-light text-center">
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;
Expand Down Expand Up @@ -2326,7 +2338,7 @@ <h4 class="text-light text-center">

$('.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');
Expand Down Expand Up @@ -2362,13 +2374,7 @@ <h4 class="text-light text-center">
}
);

$('#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
Expand Down Expand Up @@ -2412,7 +2418,27 @@ <h4 class="text-light text-center">
}
}, 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);
});
});
</script>
</body>
Expand Down
31 changes: 16 additions & 15 deletions web/display/colors/chargePointList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => `
<div class="row m-0 p-0" onclick="modeButtonClicked(${row.isEnabled},${index})">
${this.cpNameRow(row, index)}
</div>
<div class = "row m-0 p-0" onclick="modeButtonClicked(${row.isEnabled},${index})">
${this.cpChargeInfoRow(row, index)}
</div>
<div class = "row m-0 p-0">
${this.cpChargeModeRow(row, index)}
</div>`

<div class="row m-0 p-0" onclick="modeButtonClicked(${index})">
${this.cpNameRow(row, index)}
</div>
<div class = "row m-0 p-0" onclick="modeButtonClicked(${index})">
${this.cpChargeInfoRow(row, index)}
</div>
<div class = "row m-0 p-0">
${this.cpChargeModeRow(row, index)}
</div>`

)
this.updateValues();
}
Expand Down Expand Up @@ -212,7 +213,7 @@ function configButtonClicked(index) {
// $('#ladepunktConfigModal').find('[data-config-lp="' + (index + 1) + '"]').removeClass('hide');
$('#ladepunktConfigModal').modal("show");
} else {
$("#lockInfoModal").modal("show");
triggerUnlockDisplay();
}
}

Expand Down Expand Up @@ -270,22 +271,22 @@ function modeButtonClicked(index) {

$("#chargeModeModal").modal("show");
} else {
$("#lockInfoModal").modal("show");
triggerUnlockDisplay();
}
}

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();
38 changes: 35 additions & 3 deletions web/display/colors/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</head>

<body>

<input type="hidden" value="" id="rfidwebread" />
<div class="container-fluid">
<div class="row pt-0">

Expand Down Expand Up @@ -292,7 +292,7 @@ <h4 id="time" class="text-center text-light pb-2 mb-1">11:11</h4>
});

$('#backend .reloadBtn').click(function () {
location.reload();
window.location = window.location.pathname;
});
</script>
</div>
Expand Down Expand Up @@ -504,6 +504,9 @@ <h4 id="time" class="text-center text-light pb-2 mb-1">11:11</h4>
function addLockNumber(e) {
var v = $("#Lockbox").val();
$("#Lockbox").val(v + e.value);
if ($("#Lockbox").val().length == 4) {
submitLockForm(PINbox);
}
}

function clearLockForm(e) {
Expand All @@ -523,7 +526,7 @@ <h4 id="time" class="text-center text-light pb-2 mb-1">11:11</h4>
$('#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);
Expand Down Expand Up @@ -829,6 +832,14 @@ <h4 class="text-light text-center">
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;
Expand Down Expand Up @@ -956,6 +967,27 @@ <h4 class="text-light text-center">
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);
});
});
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion web/display/colors/powerdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ function showStatus() {
if (wbdata.displaylocked == false) {
$("#statusModal").modal("show");
} else {
$("#lockInfoModal").modal("show");
triggerUnlockDisplay();
}
}

Expand Down
19 changes: 19 additions & 0 deletions web/settings/misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,15 @@ function visibility_cpminlaufzeit() {
</div>
</div>
<div id="rfidan1div" class="hide">
<hr class="border-secondary">
<div class="form-group mb-1">
<div class="form-row">
<div class="col">
<input type="hidden" name="unlockscreenrfid" value="0" />
<input type="checkbox" name="unlockscreenrfid" id="unlockscreenrfid" value="1" <?php if ($unlockscreenrfidold == 1) { echo "checked"; } ?>> Display entsperren wenn Auto zugwiesen. Display sperrt sich automatisch nach der eingestellten Zeit.
</div>
</div>
</div>
<hr class="border-secondary">
<div class="form-group mb-1">
<div class="form-row">
Expand Down Expand Up @@ -770,6 +779,16 @@ function visibility_cpminlaufzeit() {
<div class="alert alert-info">
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.
</div>

<div class="form-group mb-1">
<div class="form-row">
<div class="col">
<input type="hidden" name="unlockscreenrfid" value="0" />
<input type="checkbox" name="unlockscreenrfid" id="unlockscreenrfid" value="1" <?php if ($unlockscreenrfidold == 1) { echo "checked"; } ?>> Display entsperren wenn Auto zugwiesen. Display sperrt sich automatisch nach der eingestellten Zeit.
</div>
</div>
</div>
<hr class="border-secondary">
<div class="form-group mb-1">
<div class="form-row">
<div class="col">
Expand Down
40 changes: 40 additions & 0 deletions web/values.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$result = '';
$lines = file($_SERVER['DOCUMENT_ROOT'] . '/openWB/openwb.conf');
foreach($lines as $line) {
Expand Down Expand Up @@ -158,7 +161,44 @@
if(strpos($line, "ssdisplay=") !== false) {
list(, $ssdisplayold) = explode("=", $line);
}
if(strpos($line, "unlockscreenrfid=") !== false) {
list(, $unlockscreenrfidold) = explode("=", $line);
}
if(strpos($line, "rfidlist=") !== false) {
list(, $rfidlistold) = explode("=", $line);
}
if(strpos($line, "rfidlist=") !== false) {
list(, $rfidlistold) = explode("=", $line);
}
if(strpos($line, "rfidlp1c1=") !== false) {
list(, $rfidlp1c1old) = explode("=", $line);
}
if(strpos($line, "rfidlp1c2=") !== false) {
list(, $rfidlp1c2old) = explode("=", $line);
}
if(strpos($line, "rfidlp1c3=") !== false) {
list(, $rfidlp1c3old) = explode("=", $line);
}
if(strpos($line, "rfidlp2c1=") !== false) {
list(, $rfidlp2c1old) = explode("=", $line);
}
if(strpos($line, "rfidlp2c2=") !== false) {
list(, $rfidlp2c2old) = explode("=", $line);
}
if(strpos($line, "rfidlp2c3=") !== false) {
list(, $rfidlp2c3old) = explode("=", $line);
}
}

if (!isset($_GET['rfidlist']) || strlen($_GET['rfidlist']) == 0) {
$rfidlist = trim($rfidlistold).",".trim($rfidlp1c1old).",".trim($rfidlp1c2old).",".trim($rfidlp1c3old).",".trim($rfidlp2c1old).",".trim($rfidlp2c2old).",".trim($rfidlp2c3old);
if (isset($unlockscreenrfidold) && trim($unlockscreenrfidold) == "1") {
header('Location: '.$_SERVER['PHP_SELF'].'?rfidlist='.$rfidlist);
die;
}
}


$displaypincodeold = str_replace("\n", '', $displaypincodeold);
$themeold = preg_replace('~[\r\n]+~', '', $themeold);

Expand Down