Beide Wallboxen werden gleich bedient
carEG.php und carOG.php waren fast identisch und unterschieden sich nur im Transportweg: der go-e bekam seine Kommandos per HTTP, die Wattpilot ueber einen eigenen Python-Prozess je Klick, der sich einen Websocket aufbaute, anmeldete, ein Feld setzte und wieder starb. Beide haengen laengst am selben MQTT-Broker - der go-e mit eigenem Client (mce=true, mcr=false), die Wattpilot ueber wattpilot_bruecke.py. Beide nehmen Kommandos auf <praefix><schluessel>/set entgegen. Die Steuerung steht deshalb jetzt einmal in carSteuerung.php; was die Wallboxen wirklich trennt - Topic-Praefix, die Namen ate/att gegen ftt/fte und die Wattstunden je Prozent - steht als Tabelle in restricted/wallboxen.php. Nebenbei faellt damit /volume1/homes/wagner/wattpilot.py weg, das das Passwort der Wallbox im Klartext enthaelt und ausserhalb jedes Repos liegt. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+12
-58
@@ -1,58 +1,12 @@
|
||||
<?php
|
||||
|
||||
require_once("../helper.php");
|
||||
|
||||
|
||||
if (checkLogin()) {
|
||||
$close = 0;
|
||||
if (isset($_POST["evStart/Stop"])) {
|
||||
if ($_POST["evStart/Stop"] == "Laden starten") {
|
||||
$close = 1;
|
||||
httpGetJson("http://192.168.179.122/api/set?frc=2");
|
||||
} else if ($_POST["evStart/Stop"] == "Laden stoppen") {
|
||||
$close = 1;
|
||||
httpGetJson("http://192.168.179.122/api/set?frc=1");
|
||||
}
|
||||
$close = 1;
|
||||
} else if (isset($_POST["evMode"])) {
|
||||
if ($_POST["fte"] > 100)
|
||||
$_POST["fte"] = 100;
|
||||
else if ($_POST["fte"] < 0)
|
||||
$_POST["fte"] = 0;
|
||||
if ($_POST["evAmp"] > 16)
|
||||
$_POST["evAmp"] = 16;
|
||||
if ($_POST["evAmp"] < 6)
|
||||
$_POST["evAmp"] = 6;
|
||||
$_POST["fte"] = $_POST["fte"] * 90;
|
||||
$seconds = strtotime('1970-01-01 ' . $_POST["ftt"] . ':00GMT');
|
||||
if ($_POST["evMode"] == "eco") {
|
||||
$close = 1;
|
||||
if ($_POST["ftt"] && $_POST["fte"] > 0) {
|
||||
httpGetJson("http://192.168.179.122/api/set?ate=" . $_POST["fte"] . "&att=" . $seconds . "&=" . $_POST["evAmp"] . "&fup=true&lmo=4");
|
||||
} else {
|
||||
httpGetJson("http://192.168.179.122/api/set?amp=" . $_POST["evAmp"] . "&fup=true&lmo=4");
|
||||
}
|
||||
} else if ($_POST["evMode"] == "default") {
|
||||
$close = 1;
|
||||
if ($_POST["ftt"] && $_POST["fte"] > 0) {
|
||||
httpGetJson("http://192.168.179.122/api/set?ate=" . $_POST["fte"] . "&att=" . $seconds . "&=" . $_POST["evAmp"] . "&fup=true&lmo=3");
|
||||
} else {
|
||||
httpGetJson("http://192.168.179.122/api/set?amp=" . $_POST["evAmp"] . "&fup=true&lmo=3");
|
||||
}
|
||||
} else if ($_POST["evMode"] == "NextTrip") {
|
||||
$close = 1;
|
||||
if ($_POST["ftt"] && $_POST["fte"] > 0) {
|
||||
httpGetJson("http://192.168.179.122/api/set?ate=" . $_POST["fte"] . "&att=" . $seconds . "&=" . $_POST["evAmp"] . "&fup=true&lmo=5");
|
||||
} else {
|
||||
httpGetJson("http://192.168.179.122/api/set?amp=" . $_POST["evAmp"] . "&fup=true&lmo=5");
|
||||
}
|
||||
}
|
||||
$close = 1;
|
||||
}
|
||||
} else {
|
||||
$close = 1;
|
||||
}
|
||||
if (!$close) {
|
||||
$formId = "carOG_form";
|
||||
include __DIR__ . "/carForm.php";
|
||||
}
|
||||
<?php
|
||||
/*
|
||||
* Autoladung OG - der go-e Charger.
|
||||
*
|
||||
* Die Ansteuerung ist fuer beide Wallboxen dieselbe und steht in
|
||||
* carSteuerung.php; hier bleibt nur, welche gemeint ist.
|
||||
*/
|
||||
|
||||
$wallbox = "og";
|
||||
$formId = "carOG_form";
|
||||
|
||||
require __DIR__ . "/carSteuerung.php";
|
||||
|
||||
Reference in New Issue
Block a user