Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d8f70ae37 | ||
|
|
537f1d4c20 | ||
|
|
2cf375a2b4 | ||
|
|
e33de56edc | ||
|
|
9b91543435 | ||
|
|
6dd3f1eaf2 | ||
|
|
b6155acafe | ||
|
|
4cc9ceea7c | ||
|
|
881acec3df | ||
|
|
bc78a10505 | ||
|
|
1f8cce48aa | ||
|
|
1933a41e64 | ||
|
|
e8edc8eb30 | ||
|
|
57b7969f8b |
@@ -1,3 +1,84 @@
|
||||
Version 5.4.0:
|
||||
- Cold Extraction hat eine eigene Seite: /Cold-Extraction, eigener Eintrag im Menü. Auf /Brew-Control
|
||||
steht nur noch ein Verweis darauf - die Seite war mit dem angehängten Block unübersichtlich geworden.
|
||||
- Die neue Seite ist in Abschnitte gegliedert (Grundeinstellung, Vorbenetzung, Hauptbezug, Bezugsende,
|
||||
Pumpenschutz), jeder mit einer kurzen Erklärung, warum der Wert so eingestellt gehört.
|
||||
- Wichtig für bestehende Installationen: Ein Speichern auf /Brew-Control fasst die Cold-Extraction-
|
||||
Einstellungen nicht mehr an. Vorher wertete dieser Handler die cx-Felder mit aus; nach dem Verschieben
|
||||
hätte ein Speichern dort die Freischaltung abgeschaltet, weil die Checkbox im Formular fehlt.
|
||||
- Das UART-Kommando "saveBrew" akzeptiert jetzt zusätzlich die Cold-Extraction-Felder (cxEnabled,
|
||||
cxMaxTemp, cxPreInf, cxPreInfDuty, cxPulseMs, cxDuty, cxTarget, cxMaxSecs, cxPumpMaxRun, cxPumpRest) -
|
||||
damit lässt sich die Funktion auch am Touch-Display vollständig einstellen.
|
||||
- Das State-JSON liefert die restlichen Parameter mit (cxPreInfDuty, cxDuty, cxPulseMs, cxPumpMaxRun,
|
||||
cxPumpRest), damit das Display seine Eingabefelder vorbelegen kann.
|
||||
|
||||
Version 5.3.6:
|
||||
- Cold Extraction: Die Vorbenetzung läuft nicht mehr mit voller Pumpenleistung, sondern gepulst mit
|
||||
eigener, niedriger Leistung (neue Einstellung „Pumpenleistung Vorbenetzung", Standard 10 %).
|
||||
Messung an der Maschine: Nach 7 s Vorbenetzung kommen heiß 1-2 Tropfen, kalt bei voller Leistung
|
||||
rund 10 g dünne Brühe ohne Crema - etwa zehnfacher Durchfluss trotz dreifacher Viskosität.
|
||||
Ursache ist nicht die Viskosität, sondern das Kaffeebett: Kaltes Mehl quillt nicht, ist schlecht
|
||||
benetzbar, es wandert kein Feinanteil und es lösen sich kaum Feststoffe, die das Bett verdichten.
|
||||
Volle Leistung auf den trockenen kalten Puck legt deshalb sofort Kanäle an, die sich - anders als
|
||||
bei heißem Bezug - nie wieder schließen; der restliche Bezug läuft daran vorbei statt zu extrahieren.
|
||||
- Standard der Pumpenleistung im Hauptbezug von 30 % auf 20 % gesenkt (gleicher Grund: das kalte Bett
|
||||
ist erheblich durchlässiger als ein heißes). Bestehende Installationen behalten ihren Wert.
|
||||
- Der Erklärtext auf /Brew-Control benennt den Zusammenhang jetzt und weist darauf hin, dass die
|
||||
Vorbenetzung deutlich schwächer eingestellt sein sollte als der Hauptbezug.
|
||||
|
||||
Version 5.3.5:
|
||||
- Cold Extraction lässt sich jetzt auch im Standby und bei noch warmem Kessel scharf schalten.
|
||||
Bisher galt „Standby aktiv" und „Kessel zu warm" auch fürs Aktivieren - das war falsch herum
|
||||
gedacht: Der Modus schaltet die Heizung AB, man kam aber erst an den Schalter, nachdem die
|
||||
Maschine aufgeweckt war und bereits zu heizen begonnen hatte. Genau der Ablauf, den die
|
||||
Funktion vermeiden soll.
|
||||
- Scharfschalten und Beziehen sind jetzt zwei getrennte Bedingungen:
|
||||
- Scharfschalten (neues State-Feld „cxArmable"): blockiert nur durch fehlende Freischaltung,
|
||||
Wartungsmodus, Reinigungsassistent, PID-Tuning oder einen laufenden Bezug/Spülvorgang.
|
||||
- Bezug (unverändert „cxAllowed"): zusätzlich kein Standby, Kessel unter der Freigabeschwelle,
|
||||
gültiger Sensorwert.
|
||||
Ist der Modus scharf, der Bezug aber noch gesperrt, sagen Web-UI und Display das jetzt
|
||||
ausdrücklich („Modus aktiv, Bezug noch gesperrt: …").
|
||||
- Wird bei warmem Kessel aktiviert, geht die Wasserheizung sofort aus und der Kessel kühlt ab;
|
||||
die Rückmeldung weist darauf hin, dass Bezüge bis zum Unterschreiten der Schwelle gesperrt sind.
|
||||
|
||||
Version 5.3.4:
|
||||
- Cold Extraction weist jetzt deutlich darauf hin, wenn keine Waage aktiv/verbunden ist. Ohne Waage
|
||||
greifen weder das Zielgewicht noch die Stillstands-Erkennung - der Bezug endet dann erst nach der
|
||||
maximalen Bezugsdauer, die damit faktisch zur Dosierung wird. Bisher passierte das stillschweigend.
|
||||
- Die Funktion bleibt ohne Waage bewusst nutzbar (Zeitsteuerung als Rückfallebene): Ein kurzzeitig
|
||||
abgemeldeter HX711 soll die kalte Extraktion nicht komplett blockieren.
|
||||
- Angezeigt wird das an vier Stellen: dauerhafter Warnhinweis auf /Brew-Control (dort ist das
|
||||
Zielgewicht-Feld zusätzlich als „nur mit Waage wirksam" beschriftet), Hinweiszeile unter dem
|
||||
Dashboard-Schalter, Statustext „Cold Extraction bereit (ohne Waage: Zeitsteuerung)" sowie eine
|
||||
einmalige Meldung beim Aktivieren.
|
||||
- Neuer Code im UART-Feld cxNotice: 4 = ohne Waage aktiviert (additiv, Protokoll bleibt v2).
|
||||
|
||||
Version 5.3.3:
|
||||
- Bug-Fix (Cold Extraction, hätte die Funktion mit Waage komplett unbrauchbar gemacht): Die
|
||||
Stillstands-Erkennung lief bereits während der Vorbenetzung mit. In dieser Phase sättigt der Puck
|
||||
aber erst, es kommt naturgemäß nichts in der Tasse an - bei einer Vorbenetzung länger als die
|
||||
15 s Stillstands-Zeit wurde deshalb JEDER kalte Bezug mit „kein Zulauf" abgebrochen. Mit dem
|
||||
bisherigen Standard von 30 s Vorbenetzung wäre das immer passiert. Die Erkennung startet jetzt
|
||||
erst mit dem Hauptbezug.
|
||||
- Standard der Vorbenetzung von 30 s auf 10 s gesenkt. In dieser Phase läuft die Pumpe bewusst
|
||||
ungepulst auf voller Leistung; bei heißem Bezug kommt der erste Tropfen nach etwa 7 s, kalt
|
||||
(rund dreifache Viskosität) entsprechend später. 30 s wären also längst voller Bezug bei vollem
|
||||
Druck gewesen, und die Hälfte des Pumpen-Laufzeitbudgets wäre vor dem eigentlichen Bezug
|
||||
verbraucht. Bestehende Installationen behalten ihren gespeicherten Wert - dort ggf. auf
|
||||
/Brew-Control nachziehen.
|
||||
- Die Beschriftung auf /Brew-Control sagt jetzt ausdrücklich, dass die Pumpe während der
|
||||
Vorbenetzung durchläuft und erst im Hauptbezug gepulst wird.
|
||||
|
||||
Version 5.3.2:
|
||||
- Cold Extraction sendet den Sperrgrund jetzt als Code („cxBlock") statt als Klartext („cxMessage"),
|
||||
dazu eine transiente Meldung als Code („cxNotice") und die Vorbenetzungsdauer („cxPreInf").
|
||||
Hintergrund: Die State-Zeile ans Touch-Display liegt real bereits bei rund 2,1 KB, und der P4
|
||||
verwirft eingehende Zeilen ab einer Obergrenze komplett - ein bis zu 110 Byte langer Klartext
|
||||
hätte die Zeile über diese Grenze gedrückt und damit die ganze Telemetrie unbrauchbar gemacht.
|
||||
Die Texte rendert jetzt das Display, analog zur bestehenden Trennung statusKey/statusText.
|
||||
- Der Klartext bleibt unverändert auf dem OLED und in den Web-/UART-Antworten (ack-message).
|
||||
|
||||
Version 5.3.1:
|
||||
- Cold Extraction ist jetzt persistent: Der Modus wird im EEPROM gespeichert und überlebt sowohl den
|
||||
Standby als auch einen Neustart. Zuvor wurde er beim Standby beendet und war nach dem Aufwachen aus -
|
||||
|
||||
@@ -323,17 +323,29 @@ Alle gültigen `action`-Strings aus `executeDashboardAction()` (Stand v4.8.1, Ze
|
||||
| `stopColdExtraction` | — | Modus beenden |
|
||||
| `toggleColdExtraction` | — | Modus umschalten |
|
||||
|
||||
Alle drei Aktionen werden abgewiesen (`ok:false` + `message`), solange die Bedingungen nicht
|
||||
erfüllt sind — Hauptfall ist ein zu warmer Wasserkessel (`cxAllowed:false`). Der Modus ist
|
||||
Für das Bedienelement zählt `cxArmable`, **nicht** `cxAllowed`: Der Modus schaltet die
|
||||
Wasserheizung ab und muss deshalb auch im Standby und bei noch warmem Kessel scharf zu
|
||||
stellen sein — sonst heizt die Maschine nach dem Aufwecken an, bevor man an den Schalter
|
||||
kommt. `cxAllowed` gilt nur für den einzelnen Bezug; ist der Modus scharf und `cxAllowed`
|
||||
false, sollte die UI „Modus aktiv, Bezug noch gesperrt" zeigen.
|
||||
|
||||
Ein Aufwecken direkt in die kalte Extraktion sendet `startColdExtraction` **vor**
|
||||
`deactivateStandby` — in dieser Reihenfolge, damit der Wasserkreis gar nicht erst anheizt.
|
||||
|
||||
Die Aktionen werden abgewiesen (`ok:false` + `message`), solange die Bedingungen nicht
|
||||
erfüllt sind. Der Modus ist
|
||||
**persistent** (EEPROM) und überlebt Standby und Neustart; er endet nur durch explizites
|
||||
Ausschalten, durch Entzug der Freischaltung auf `/Brew-Control` oder durch einen Werksreset.
|
||||
Das P4-UI sollte `cxActive` deshalb dauerhaft sichtbar spiegeln — sonst wundert sich der
|
||||
Benutzer, warum die Maschine nicht heizt. Ein laufender Bezug wird nie abgebrochen,
|
||||
`stopColdExtraction` schlägt dann fehl.
|
||||
|
||||
Die Parameter der kalten Extraktion (Schwelle, Vorbenetzung, Pulsperiode, Pumpenleistung,
|
||||
Zielgewicht, Timeout, Pumpenschutz) sind bewusst **nicht** über `saveBrew` erreichbar, sondern
|
||||
nur über die Web-Seite `/Brew-Control`. Das Display schaltet den Modus, konfiguriert ihn nicht.
|
||||
Die Parameter der kalten Extraktion sind ab S3 5.4.0 über `saveBrew` einstellbar (zusätzlich
|
||||
zur Web-Seite `/Cold-Extraction`). Zulässige Felder: `cxEnabled` (bool), `cxMaxTemp`,
|
||||
`cxPreInf`, `cxPreInfDuty`, `cxPulseMs`, `cxDuty`, `cxTarget`, `cxMaxSecs`, `cxPumpMaxRun`,
|
||||
`cxPumpRest`. Es werden nur die tatsächlich gesendeten Felder übernommen; Grenzwerte prüft
|
||||
die S3. Die aktuellen Werte stehen alle im `state`, damit das Display seine Eingabefelder
|
||||
vorbelegen kann.
|
||||
|
||||
**Persistente Toggles**
|
||||
|
||||
@@ -383,12 +395,36 @@ Aus `getTouchUartStatus()`. Für sprach-unabhängige UI-Logik/Icons auf dem P4 v
|
||||
| `cxEnabled` | bool | Funktion in der Web-UI freigeschaltet (sonst Bedienelement ausblenden) |
|
||||
| `cxActive` | bool | Modus scharf: Wasserkreis heizt nicht |
|
||||
| `cxShot` | bool | Der laufende Bezug ist eine kalte Extraktion |
|
||||
| `cxAllowed` | bool | Freigabe **jetzt** (Wasserkessel kalt genug, kein Standby/Wartung/Tuning) |
|
||||
| `cxAllowed` | bool | **Bezug** jetzt möglich (Wasserkessel kalt genug, kein Standby/Wartung/Tuning) |
|
||||
| `cxArmable` | bool | **Modus umschaltbar** — auch im Standby und bei warmem Kessel (ab S3 5.3.5) |
|
||||
| `cxResting` | bool | Zwangspause des Pumpenschutzes läuft (Bezug läuft weiter) |
|
||||
| `cxMaxTemp` | float | Freigabeschwelle in °C (für eigene Hinweistexte am Display) |
|
||||
| `cxTarget` | float | Zielgewicht in g |
|
||||
| `cxPreInf` | float | Vorbenetzung in s (auch für die Phasenleiste des kalten Bezugs) |
|
||||
| `cxPreInfDuty` | float | Pumpenleistung Vorbenetzung in % (ab S3 5.4.0) |
|
||||
| `cxDuty` | float | Pumpenleistung Hauptbezug in % (ab S3 5.4.0) |
|
||||
| `cxPulseMs` | uint16 | Pulsperiode in ms (ab S3 5.4.0) |
|
||||
| `cxPumpMaxRun` | float | Pumpenschutz: max. kumulierte Laufzeit in s (ab S3 5.4.0) |
|
||||
| `cxPumpRest` | float | Pumpenschutz: Zwangspause in s (ab S3 5.4.0) |
|
||||
| `cxMaxSecs` | float | Sicherheits-Timeout des Bezugs in s |
|
||||
| `cxMessage` | string | Sperr-/Abbruchmeldung, leer = keine (läuft nach ~6 s selbst ab) |
|
||||
| `cxBlock` | uint8 | Sperrgrund (siehe unten), `0` = frei |
|
||||
| `cxNotice` | uint8 | transiente Meldung, `0` = keine (läuft nach ~6 s selbst ab) |
|
||||
|
||||
`cxBlock`: `0` frei, `1` nicht freigeschaltet, `2` Standby, `3` Wartungsmodus,
|
||||
`4` Reinigungsassistent, `5` PID-Tuning, `6` Sensorfehler, `7` Wasserkessel zu warm.
|
||||
|
||||
`cxNotice`: `0` keine, `1` Start abgewiesen (Grund steht in `cxBlock`), `2` Bezug wegen
|
||||
fehlenden Zulaufs beendet, `3` Umschalten während eines Bezugs abgelehnt, `4` ohne Waage
|
||||
aktiviert (ab S3 5.3.4).
|
||||
|
||||
**Ohne Waage** (`scaleEnabled`/`scaleConnected` false) läuft die kalte Extraktion rein
|
||||
zeitgesteuert: `cxTarget` ist wirkungslos und die Stillstands-Erkennung ist inaktiv, es
|
||||
bleibt `cxMaxSecs` als Ende. Das ist Absicht (ein kurz abgemeldeter HX711 soll die Funktion
|
||||
nicht blockieren) und **kein** Sperrgrund — das Display sollte es aber dauerhaft anzeigen.
|
||||
|
||||
Bewusst **Codes statt Klartext**: Die State-Zeile muss unter dem Zeilenlimit des P4 bleiben
|
||||
(`PROTO_RX_LINE_MAX`; sie liegt real bereits bei ~2,1 KB), und die Texte gehören ins Display —
|
||||
dieselbe Trennung wie bei `statusKey`/`statusText`.
|
||||
|
||||
Während `cxShot` folgt die Phase weiterhin `piState`: `1` = Vorbenetzung, `3` = Hauptbezug
|
||||
(gepulst). Eine Pause-Phase (`2`) gibt es bei der kalten Extraktion nicht.
|
||||
|
||||
+391
-95
@@ -369,7 +369,7 @@ Adafruit_SH1106G display = Adafruit_SH1106G(128, 64, &Wire);
|
||||
* Firmware-Informationen
|
||||
************************************************************************************/
|
||||
|
||||
String version = "5.3.1";
|
||||
String version = "5.4.0";
|
||||
String versionHersteller = "Thomas Müller";
|
||||
String versionHerstellerMail =
|
||||
"<a href='mailto:thomas@mueller.black' class='info-link'>thomas@mueller.black</a>";
|
||||
@@ -782,9 +782,10 @@ bool flowGuardPumpPulseActive = false;
|
||||
************************************************************************************/
|
||||
bool coldExtractionEnabled = false; // Funktion in der Web-UI freigeschaltet
|
||||
float coldExtractionMaxTempC = 30.0f; // Freigabeschwelle Wasserkessel
|
||||
float coldExtractionPreInfusionSeconds = 30.0f; // Vorbenetzung (Pumpe laeuft ungepulst)
|
||||
float coldExtractionPreInfusionSeconds = 10.0f; // Vorbenetzung (gepulst, eigene Leistung)
|
||||
float coldExtractionPreInfDutyPercent = 10.0f; // Pumpenleistung waehrend der Vorbenetzung
|
||||
uint16_t coldExtractionPulsePeriodMs = 2000; // Pulsperiode der Pumpe im Hauptbezug
|
||||
float coldExtractionDutyPercent = 30.0f; // Pumpen-Duty im Hauptbezug
|
||||
float coldExtractionDutyPercent = 20.0f; // Pumpen-Duty im Hauptbezug
|
||||
float coldExtractionTargetGrams = 60.0f; // Zielgewicht (ca. 1:3 auf 18 g)
|
||||
float coldExtractionMaxSeconds = 300.0f; // Sicherheits-Timeout des Bezugs
|
||||
float coldExtractionPumpMaxRunSec = 60.0f; // kumulierte Pumpenlaufzeit bis zur Zwangspause
|
||||
@@ -792,9 +793,17 @@ float coldExtractionPumpRestSec = 20.0f; // Dauer der Zwangspause
|
||||
|
||||
const bool defaultColdExtractionEnabled = false;
|
||||
const float defaultColdExtractionMaxTempC = 30.0f;
|
||||
const float defaultColdExtractionPreInfusionSeconds = 30.0f;
|
||||
const float defaultColdExtractionPreInfusionSeconds = 10.0f;
|
||||
// Die Vorbenetzung laeuft bewusst SEHR sanft. Messung an der Maschine: heiss kommen nach
|
||||
// 7 s Vorbenetzung 1-2 Tropfen, kalt bei voller Pumpenleistung rund 10 g duenne Bruehe -
|
||||
// etwa zehnfacher Durchfluss trotz dreifacher Viskositaet. Kaltes Mehl quillt nicht und ist
|
||||
// schlecht benetzbar; volle Leistung auf den trockenen Puck legt sofort Kanaele an, die sich
|
||||
// - anders als heiss - nie wieder zudruecken. Der restliche Bezug laeuft dann daran vorbei.
|
||||
const float defaultColdExtractionPreInfDutyPercent = 10.0f;
|
||||
const uint16_t defaultColdExtractionPulsePeriodMs = 2000;
|
||||
const float defaultColdExtractionDutyPercent = 30.0f;
|
||||
// 20 % statt 30 %: Das kalte Kaffeebett ist deutlich durchlaessiger als ein heisses
|
||||
// (kein Quellen, keine Feinanteil-Wanderung, keine geloesten Feststoffe, die es verdichten).
|
||||
const float defaultColdExtractionDutyPercent = 20.0f;
|
||||
const float defaultColdExtractionTargetGrams = 60.0f;
|
||||
const float defaultColdExtractionMaxSeconds = 300.0f;
|
||||
const float defaultColdExtractionPumpMaxRunSec = 60.0f;
|
||||
@@ -832,11 +841,37 @@ unsigned long coldExtractionPumpSampleMs = 0;
|
||||
float coldExtractionStallLastWeight = NAN;
|
||||
unsigned long coldExtractionStallSinceMs = 0;
|
||||
bool lastShotWasColdExtraction = false; // fuer Anzeige/Log des letzten Bezugs
|
||||
// Sperrmeldung fuer OLED und Touch-Display, wenn ein kalter Bezug abgewiesen wurde
|
||||
// Sperrmeldung fuer das OLED, wenn ein kalter Bezug abgewiesen bzw. abgebrochen wurde.
|
||||
// Der Klartext bleibt S3-intern; ans Touch-Display gehen nur die Codes unten, damit die
|
||||
// State-Zeile kurz bleibt (der P4 hat ein Zeilenlimit) und das Display seine eigenen
|
||||
// Texte rendern kann - dieselbe Trennung wie bei statusKey/statusText.
|
||||
const unsigned long COLDEX_BLOCK_MESSAGE_MS = 6000UL;
|
||||
String coldExtractionBlockMessage = "";
|
||||
unsigned long coldExtractionBlockMessageUntilMs = 0;
|
||||
|
||||
// Sperrgrund (cxBlock): 0=frei, 1=nicht freigeschaltet, 2=Standby, 3=Wartung,
|
||||
// 4=Reinigungsassistent, 5=PID-Tuning, 6=Sensorfehler, 7=Wasserkessel zu warm
|
||||
enum ColdExtractionBlock : uint8_t {
|
||||
COLDEX_BLOCK_NONE = 0,
|
||||
COLDEX_BLOCK_NOT_ENABLED = 1,
|
||||
COLDEX_BLOCK_STANDBY = 2,
|
||||
COLDEX_BLOCK_MAINTENANCE = 3,
|
||||
COLDEX_BLOCK_CLEANING = 4,
|
||||
COLDEX_BLOCK_TUNING = 5,
|
||||
COLDEX_BLOCK_SENSOR = 6,
|
||||
COLDEX_BLOCK_TOO_WARM = 7
|
||||
};
|
||||
// Transiente Meldung (cxNotice): 0=keine, 1=Start abgewiesen, 2=Bezug wegen fehlenden
|
||||
// Zulaufs beendet, 3=Umschalten waehrend eines Bezugs abgelehnt, 4=ohne Waage aktiviert
|
||||
enum ColdExtractionNotice : uint8_t {
|
||||
COLDEX_NOTICE_NONE = 0,
|
||||
COLDEX_NOTICE_START_REJECTED = 1,
|
||||
COLDEX_NOTICE_NO_FLOW = 2,
|
||||
COLDEX_NOTICE_BUSY = 3,
|
||||
COLDEX_NOTICE_NO_SCALE = 4
|
||||
};
|
||||
uint8_t coldExtractionNotice = COLDEX_NOTICE_NONE;
|
||||
|
||||
/************************************************************************************
|
||||
* Standardwerte und Default-Einstellungen
|
||||
************************************************************************************/
|
||||
@@ -1037,7 +1072,8 @@ const int EEPROM_ADDR_COLDEX_MAX_SECONDS = 965; // 4 Bytes (float) -> Ende
|
||||
const int EEPROM_ADDR_COLDEX_PUMP_MAX_RUN = 969; // 4 Bytes (float) -> Ende 972
|
||||
const int EEPROM_ADDR_COLDEX_PUMP_REST = 973; // 4 Bytes (float) -> Ende 976
|
||||
const int EEPROM_ADDR_COLDEX_MODE_ACTIVE = 977; // 1 Byte (uint8_t) -> Ende 977
|
||||
// Naechste freie Adresse: 978 (Innerhalb EEPROM_SIZE=1024)
|
||||
const int EEPROM_ADDR_COLDEX_PREINF_DUTY = 978; // 4 Bytes (float) -> Ende 981
|
||||
// Naechste freie Adresse: 982 (Innerhalb EEPROM_SIZE=1024)
|
||||
|
||||
/************************************************************************************
|
||||
* Eco-Mode Variablen
|
||||
@@ -1993,6 +2029,7 @@ static const char commonNav[] PROGMEM = R"rawliteral(
|
||||
<a href="/Profile">Profile</a>
|
||||
<a href="/Timer">Timer</a>
|
||||
<a href="/Brew-Control">Brew Control</a>
|
||||
<a href="/Cold-Extraction">Cold Extraction</a>
|
||||
<a href="/Chart">Chart</a>
|
||||
<a href="/Sensoren">Sensoren</a>
|
||||
<a href="/Fast-Heat-Up">Fast-Heat-Up</a>
|
||||
@@ -3024,6 +3061,7 @@ void resetToDefaults() {
|
||||
EEPROM.put(EEPROM_ADDR_COLDEX_PREINF_SEC, defaultColdExtractionPreInfusionSeconds);
|
||||
EEPROM.put(EEPROM_ADDR_COLDEX_PULSE_PERIOD_MS, defaultColdExtractionPulsePeriodMs);
|
||||
EEPROM.put(EEPROM_ADDR_COLDEX_DUTY, defaultColdExtractionDutyPercent);
|
||||
EEPROM.put(EEPROM_ADDR_COLDEX_PREINF_DUTY, defaultColdExtractionPreInfDutyPercent);
|
||||
EEPROM.put(EEPROM_ADDR_COLDEX_TARGET_GRAMS, defaultColdExtractionTargetGrams);
|
||||
EEPROM.put(EEPROM_ADDR_COLDEX_MAX_SECONDS, defaultColdExtractionMaxSeconds);
|
||||
EEPROM.put(EEPROM_ADDR_COLDEX_PUMP_MAX_RUN, defaultColdExtractionPumpMaxRunSec);
|
||||
@@ -3112,6 +3150,7 @@ void resetToDefaults() {
|
||||
coldExtractionPreInfusionSeconds = defaultColdExtractionPreInfusionSeconds;
|
||||
coldExtractionPulsePeriodMs = defaultColdExtractionPulsePeriodMs;
|
||||
coldExtractionDutyPercent = defaultColdExtractionDutyPercent;
|
||||
coldExtractionPreInfDutyPercent = defaultColdExtractionPreInfDutyPercent;
|
||||
coldExtractionTargetGrams = defaultColdExtractionTargetGrams;
|
||||
coldExtractionMaxSeconds = defaultColdExtractionMaxSeconds;
|
||||
coldExtractionPumpMaxRunSec = defaultColdExtractionPumpMaxRunSec;
|
||||
@@ -4021,6 +4060,13 @@ bool coldExtractionTemperatureOk() {
|
||||
return (InputWasser < (double)limit);
|
||||
}
|
||||
|
||||
// Steht eine nutzbare Waage bereit? Ohne sie laeuft die kalte Extraktion rein zeitgesteuert:
|
||||
// Zielgewicht und Stillstands-Erkennung greifen nicht, es bleibt nur die maximale Bezugsdauer.
|
||||
// Bewusst kein Sperrgrund - ein kurz abgemeldeter HX711 soll die Funktion nicht blockieren.
|
||||
bool coldExtractionScaleUsable() {
|
||||
return scaleEnabled && scaleConnected;
|
||||
}
|
||||
|
||||
// Allokationsfreie Freigabepruefung - wird in den JSON-Pushes (2x/s) verwendet.
|
||||
bool coldExtractionConditionsOk() {
|
||||
return coldExtractionEnabled &&
|
||||
@@ -4032,6 +4078,19 @@ bool coldExtractionConditionsOk() {
|
||||
coldExtractionTemperatureOk();
|
||||
}
|
||||
|
||||
// Sperrgrund als Code fuer das Touch-Display (0 = frei). Gleiche Reihenfolge wie
|
||||
// coldExtractionBlockReason(), damit Text und Code immer dieselbe Ursache nennen.
|
||||
uint8_t coldExtractionBlockCode() {
|
||||
if (!coldExtractionEnabled) return COLDEX_BLOCK_NOT_ENABLED;
|
||||
if (standbyModeActive) return COLDEX_BLOCK_STANDBY;
|
||||
if (wartungsModusAktiv) return COLDEX_BLOCK_MAINTENANCE;
|
||||
if (cleaningAssistantActive) return COLDEX_BLOCK_CLEANING;
|
||||
if (autoTuneWasserActive || autoTuneDampfActive) return COLDEX_BLOCK_TUNING;
|
||||
if (wasserSensorError || wasserSafetyShutdown || !isfinite(InputWasser)) return COLDEX_BLOCK_SENSOR;
|
||||
if (!coldExtractionTemperatureOk()) return COLDEX_BLOCK_TOO_WARM;
|
||||
return COLDEX_BLOCK_NONE;
|
||||
}
|
||||
|
||||
// Klartext-Grund, warum gerade keine kalte Extraktion moeglich ist ("" = alles frei).
|
||||
String coldExtractionBlockReason() {
|
||||
if (!coldExtractionEnabled) {
|
||||
@@ -4069,7 +4128,7 @@ bool setColdExtractionMode(bool enable, String& message) {
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
String reason = coldExtractionBlockReason();
|
||||
String reason = coldExtractionArmBlockReason();
|
||||
if (reason.length() > 0) {
|
||||
message = reason;
|
||||
return false;
|
||||
@@ -4082,6 +4141,22 @@ bool setColdExtractionMode(bool enable, String& message) {
|
||||
resetColdExtractionRuntime();
|
||||
persistColdExtractionMode();
|
||||
message = "Cold Extraction aktiviert - Wasserkreis heizt nicht (bleibt auch nach Standby/Neustart aktiv).";
|
||||
if (standbyModeActive) {
|
||||
message += " Nach dem Aufwecken bleibt der Wasserkreis aus.";
|
||||
} else if (!coldExtractionTemperatureOk()) {
|
||||
// Scharfschalten bei warmem Kessel ist erlaubt (Heizung geht sofort aus), ein
|
||||
// Bezug aber erst, wenn der Kessel unter die Schwelle gefallen ist.
|
||||
message += " Der Kessel ist noch zu warm - er kuehlt jetzt ab, Bezuege sind bis dahin gesperrt.";
|
||||
}
|
||||
if (!coldExtractionScaleUsable()) {
|
||||
// Ohne Waage faellt die Dosierung auf die maximale Bezugsdauer zurueck - das
|
||||
// muss der Benutzer wissen, sonst wundert er sich ueber das Ergebnis.
|
||||
message += " Achtung: keine Waage - Zielgewicht und Stillstands-Erkennung greifen nicht,"
|
||||
" der Bezug endet erst nach der maximalen Bezugsdauer.";
|
||||
coldExtractionBlockMessage = "Keine Waage: Bezug endet nach Zeit, nicht nach Gewicht.";
|
||||
coldExtractionBlockMessageUntilMs = millis() + COLDEX_BLOCK_MESSAGE_MS;
|
||||
coldExtractionNotice = COLDEX_NOTICE_NO_SCALE;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4101,6 +4176,37 @@ bool coldExtractionShotAllowed() {
|
||||
return coldExtractionModeActive && coldExtractionConditionsOk();
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* Scharfschalten vs. Beziehen - bewusst zwei verschiedene Bedingungen
|
||||
************************************************************************************
|
||||
* Der Modus schaltet die Wasserheizung AB. Das an Standby oder an die Kesseltemperatur
|
||||
* zu koppeln waere falsch herum: Im Standby kaeme man gar nicht an den Schalter, und
|
||||
* nach dem Aufwecken heizt die Maschine sofort los - man muesste erst aufheizen lassen,
|
||||
* um danach auf das Abkuehlen zu warten. Genau der Fall, den die Funktion vermeiden soll.
|
||||
* Deshalb: Scharfschalten ist im Standby und bei warmem Kessel erlaubt; ueber den
|
||||
* einzelnen Bezug entscheidet weiterhin coldExtractionShotAllowed().
|
||||
************************************************************************************/
|
||||
bool coldExtractionArmable() {
|
||||
return coldExtractionEnabled && !wartungsModusAktiv && !cleaningAssistantActive &&
|
||||
!autoTuneWasserActive && !autoTuneDampfActive;
|
||||
}
|
||||
|
||||
String coldExtractionArmBlockReason() {
|
||||
if (!coldExtractionEnabled) {
|
||||
return "Cold Extraction ist nicht freigeschaltet.";
|
||||
}
|
||||
if (wartungsModusAktiv) {
|
||||
return "Cold Extraction nicht moeglich: Wartungsmodus aktiv.";
|
||||
}
|
||||
if (cleaningAssistantActive) {
|
||||
return "Cold Extraction nicht moeglich: Reinigungsassistent aktiv.";
|
||||
}
|
||||
if (autoTuneWasserActive || autoTuneDampfActive) {
|
||||
return "Cold Extraction nicht moeglich: PID-Tuning laeuft.";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// Pumpensteuerung des kalten Bezugs: Vorbenetzung ungepulst, danach Puls-Duty.
|
||||
// Zusaetzlich Pumpenschutz ueber die kumulierte Einschaltzeit (Zwangspause) - die Olab
|
||||
// hat zwar einen Thermoschutz, ein Auslösen mitten im Bezug wuerde aber den Shot
|
||||
@@ -4133,10 +4239,12 @@ void applyColdExtractionPumpControl(unsigned long currentShotTimeMillis) {
|
||||
bool pumpOn;
|
||||
if (coldExtractionPumpResting) {
|
||||
pumpOn = false;
|
||||
} else if (currentPreInfusionState == PI_PRE_BREW) {
|
||||
pumpOn = true; // Vorbenetzung: volle Pumpenleistung
|
||||
} else {
|
||||
float duty = coldExtractionDutyPercent / 100.0f;
|
||||
// Vorbenetzung und Hauptbezug pulsen beide - nur mit unterschiedlicher Leistung.
|
||||
// Volle Leistung auf den trockenen kalten Puck legt Kanaele an, die sich mangels
|
||||
// Quellung nie wieder schliessen (siehe Kommentar bei den Defaults).
|
||||
float duty = ((currentPreInfusionState == PI_PRE_BREW) ? coldExtractionPreInfDutyPercent
|
||||
: coldExtractionDutyPercent) / 100.0f;
|
||||
duty = constrain(duty, COLDEX_DUTY_MIN / 100.0f, 1.0f);
|
||||
uint16_t periodMs = coldExtractionPulsePeriodMs;
|
||||
if (periodMs < COLDEX_PULSE_PERIOD_MIN_MS || periodMs > COLDEX_PULSE_PERIOD_MAX_MS) {
|
||||
@@ -4164,8 +4272,12 @@ bool coldExtractionStallDetected(float netWeight) {
|
||||
coldExtractionStallSinceMs = 0;
|
||||
return false;
|
||||
}
|
||||
if (coldExtractionPumpResting) {
|
||||
coldExtractionStallSinceMs = 0; // Pause ist kein Stillstand
|
||||
// Waehrend der Vorbenetzung saettigt der Puck erst - da kommt naturgemaess nichts in
|
||||
// der Tasse an. Ohne diese Ausnahme wuerde die Erkennung jeden kalten Bezug abbrechen,
|
||||
// sobald die Vorbenetzung laenger als COLDEX_STALL_TIMEOUT_MS dauert. Der Zaehler
|
||||
// startet damit erst mit dem Hauptbezug.
|
||||
if (coldExtractionPumpResting || currentPreInfusionState == PI_PRE_BREW) {
|
||||
coldExtractionStallSinceMs = 0; // Pause/Vorbenetzung ist kein Stillstand
|
||||
coldExtractionStallLastWeight = netWeight;
|
||||
return false;
|
||||
}
|
||||
@@ -4597,6 +4709,7 @@ void setup() {
|
||||
EEPROM.get(EEPROM_ADDR_COLDEX_PREINF_SEC, coldExtractionPreInfusionSeconds);
|
||||
EEPROM.get(EEPROM_ADDR_COLDEX_PULSE_PERIOD_MS, coldExtractionPulsePeriodMs);
|
||||
EEPROM.get(EEPROM_ADDR_COLDEX_DUTY, coldExtractionDutyPercent);
|
||||
EEPROM.get(EEPROM_ADDR_COLDEX_PREINF_DUTY, coldExtractionPreInfDutyPercent);
|
||||
EEPROM.get(EEPROM_ADDR_COLDEX_TARGET_GRAMS, coldExtractionTargetGrams);
|
||||
EEPROM.get(EEPROM_ADDR_COLDEX_MAX_SECONDS, coldExtractionMaxSeconds);
|
||||
EEPROM.get(EEPROM_ADDR_COLDEX_PUMP_MAX_RUN, coldExtractionPumpMaxRunSec);
|
||||
@@ -4613,6 +4726,10 @@ void setup() {
|
||||
if (!isfinite(coldExtractionDutyPercent) || coldExtractionDutyPercent < COLDEX_DUTY_MIN || coldExtractionDutyPercent > COLDEX_DUTY_MAX) {
|
||||
coldExtractionDutyPercent = defaultColdExtractionDutyPercent;
|
||||
}
|
||||
// Beim Update aus <= 5.3.5 steht hier 0xFFFFFFFF (NaN) -> Default greift automatisch
|
||||
if (!isfinite(coldExtractionPreInfDutyPercent) || coldExtractionPreInfDutyPercent < COLDEX_DUTY_MIN || coldExtractionPreInfDutyPercent > COLDEX_DUTY_MAX) {
|
||||
coldExtractionPreInfDutyPercent = defaultColdExtractionPreInfDutyPercent;
|
||||
}
|
||||
if (!isfinite(coldExtractionTargetGrams) || coldExtractionTargetGrams < COLDEX_TARGET_GRAMS_MIN || coldExtractionTargetGrams > COLDEX_TARGET_GRAMS_MAX) {
|
||||
coldExtractionTargetGrams = defaultColdExtractionTargetGrams;
|
||||
}
|
||||
@@ -5059,6 +5176,8 @@ void setup() {
|
||||
// Routen für Brew Control
|
||||
asyncServer.on("/Brew-Control", HTTP_GET, handleBrewControl);
|
||||
asyncServer.on("/saveBrewControl", HTTP_POST, handleSaveBrewControl);
|
||||
asyncServer.on("/Cold-Extraction", HTTP_GET, handleColdExtraction);
|
||||
asyncServer.on("/saveColdExtraction", HTTP_POST, handleSaveColdExtraction);
|
||||
|
||||
dashboardWs.onEvent(onDashboardWsEvent);
|
||||
asyncServer.addHandler(&dashboardWs);
|
||||
@@ -5253,6 +5372,7 @@ void loop() {
|
||||
// kalten Bezug wieder abkuehlen zu muessen. Nur die Laufzeitdaten werden verworfen.
|
||||
resetColdExtractionRuntime();
|
||||
coldExtractionBlockMessage = "";
|
||||
coldExtractionNotice = COLDEX_NOTICE_NONE;
|
||||
} else if (lastStandbyModeActive) {
|
||||
startupTime = currentMillis;
|
||||
ecoForcedActive = false;
|
||||
@@ -5484,6 +5604,7 @@ void loop() {
|
||||
stopForTime = true;
|
||||
coldExtractionBlockMessage = "Cold Extraction beendet: kein Zulauf (Puck dicht oder Pumpenschutz?).";
|
||||
coldExtractionBlockMessageUntilMs = millis() + COLDEX_BLOCK_MESSAGE_MS;
|
||||
coldExtractionNotice = COLDEX_NOTICE_NO_FLOW;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5985,6 +6106,7 @@ void updateDisplay() {
|
||||
if (coldExtractionBlockMessage.length() > 0) {
|
||||
if ((long)(millis() - coldExtractionBlockMessageUntilMs) >= 0) {
|
||||
coldExtractionBlockMessage = "";
|
||||
coldExtractionNotice = COLDEX_NOTICE_NONE;
|
||||
} else if (!standbyModeActive) {
|
||||
display.clearDisplay();
|
||||
display.setTextSize(1);
|
||||
@@ -7097,34 +7219,70 @@ static const char brewControlPI_Fields[] PROGMEM = R"rawliteral(
|
||||
)rawliteral";
|
||||
|
||||
// --- Cold Extraction (CX) Chunks ---
|
||||
static const char brewControlCX_H3[] PROGMEM = R"rawliteral(<h3>Cold Extraction (kalte Extraktion)</h3>)rawliteral";
|
||||
// Cold Extraction hat eine eigene Seite (/Cold-Extraction); auf /Brew-Control steht nur der Verweis.
|
||||
static const char brewControlCX_Link[] PROGMEM = R"rawliteral(
|
||||
<h3>Cold Extraction (kalte Extraktion)</h3>
|
||||
Die Einstellungen der kalten Extraktion stehen auf einer <a href="/Cold-Extraction">eigenen Seite</a>.<br><br>
|
||||
)rawliteral";
|
||||
|
||||
static const char coldExHead[] PROGMEM = R"rawliteral(
|
||||
<!DOCTYPE html><html><head><title>Cold Extraction</title><meta name='theme-color' content='#000000'><meta name='viewport' content='width=device-width, initial-scale=1.0'>
|
||||
)rawliteral";
|
||||
static const char coldExHeadEnd[] PROGMEM = R"rawliteral(</head>)rawliteral";
|
||||
static const char coldExBodyStart[] PROGMEM = R"rawliteral(
|
||||
<body><h1>Cold Extraction</h1>
|
||||
<form action='/saveColdExtraction' method='POST'>
|
||||
Kalte Extraktion: Bezug mit kaltem Wasser, gepulster Pumpe und Bezugszeiten im Minutenbereich.<br>
|
||||
Die Maschine hat keinen Bypass um den Wasserkessel - kaltes Wasser kommt nur bei kaltem Kessel am Puck an.
|
||||
Deshalb ist die Funktion nur unterhalb der Freigabetemperatur beziehbar, praktisch also aus dem kalten
|
||||
Zustand heraus. Solange der Modus aktiv ist, heizt der Wasserkreis nicht; der Dampfkreis bleibt unberührt.<br>
|
||||
Ein- und ausgeschaltet wird der Modus auf dem Dashboard oder am Touch-Display - hier stehen nur die Parameter.<br><br>
|
||||
)rawliteral";
|
||||
static const char coldExCX_H3[] PROGMEM = R"rawliteral(<h3>Grundeinstellung</h3>)rawliteral";
|
||||
static const char brewControlCX_ToggleContainerStart[] PROGMEM = R"rawliteral(<div class="toggle-switch-container"><span class="toggle-switch-label-text">Freischalten:</span><label class="toggle-switch"><input type="checkbox" id="cxEnabled" name="cxEnabled" value="1")rawliteral";
|
||||
static const char brewControlCX_ToggleContainerEnd[] PROGMEM = R"rawliteral(><span class="toggle-slider"></span></label></div>)rawliteral";
|
||||
static const char coldExFormEnd[] PROGMEM = R"rawliteral(
|
||||
<input type='submit' value='Einstellungen speichern'>
|
||||
</form>
|
||||
</body></html>
|
||||
)rawliteral";
|
||||
static const char brewControlCX_Fields[] PROGMEM = R"rawliteral(
|
||||
<label for='cxMaxTemp'>Freigabe bis Wassertemperatur (°C):</label>
|
||||
<input type='number' min='10.0' max='40.0' step='0.5' id='cxMaxTemp' name='cxMaxTemp' value='{CX_MAX_TEMP}' required>
|
||||
<label for='cxPreInf'>Vorbenetzung (Sekunden):</label>
|
||||
<small class="toggle-description-input">(Oberhalb dieser Temperatur bleibt der Modus zwar schaltbar, Bezüge sind aber gesperrt.)</small>
|
||||
{CX_STATUS_MSG}
|
||||
|
||||
<h3>Vorbenetzung</h3>
|
||||
<label for='cxPreInf'>Dauer (Sekunden):</label>
|
||||
<input type='number' min='0.0' max='120.0' step='1.0' id='cxPreInf' name='cxPreInf' value='{CX_PREINF}' required>
|
||||
<label for='cxPreInfDuty'>Pumpenleistung (%):</label>
|
||||
<input type='number' min='5.0' max='100.0' step='1.0' id='cxPreInfDuty' name='cxPreInfDuty' value='{CX_PREINF_DUTY}' required>
|
||||
<small class="toggle-description-input">(Deutlich schwächer einstellen als den Hauptbezug: Kaltes Kaffeemehl quillt nicht und
|
||||
ist schlecht benetzbar. Volle Leistung auf den trockenen Puck legt sofort Kanäle an, die sich - anders als bei
|
||||
heißem Bezug - nie wieder schließen; der restliche Bezug läuft dann daran vorbei statt zu extrahieren.)</small>
|
||||
|
||||
<h3>Hauptbezug</h3>
|
||||
<label for='cxPulseMs'>Pulsperiode (ms):</label>
|
||||
<input type='number' min='200' max='5000' step='50' id='cxPulseMs' name='cxPulseMs' value='{CX_PULSE_MS}' required>
|
||||
<label for='cxDuty'>Pumpenleistung (%):</label>
|
||||
<input type='number' min='5.0' max='100.0' step='1.0' id='cxDuty' name='cxDuty' value='{CX_DUTY}' required>
|
||||
<label for='cxTarget'>Zielgewicht (Gramm):</label>
|
||||
<small class="toggle-description-input">(Das kalte Kaffeebett ist erheblich durchlässiger als ein heißes - niedrige Werte
|
||||
sind normal. Läuft der Bezug zu schnell durch: Leistung senken und feiner mahlen.)</small>
|
||||
|
||||
<h3>Bezugsende</h3>
|
||||
<label for='cxTarget'>Zielgewicht (Gramm, nur mit Waage wirksam):</label>
|
||||
<input type='number' min='10.0' max='300.0' step='1.0' id='cxTarget' name='cxTarget' value='{CX_TARGET}' required>
|
||||
<label for='cxMaxSecs'>Maximale Bezugsdauer (Sekunden):</label>
|
||||
<input type='number' min='30.0' max='900.0' step='5.0' id='cxMaxSecs' name='cxMaxSecs' value='{CX_MAX_SECS}' required>
|
||||
<label for='cxPumpMaxRun'>Pumpenschutz: max. Laufzeit (Sekunden):</label>
|
||||
<small class="toggle-description-input">(Ohne Waage ist das Zielgewicht wirkungslos und die maximale Bezugsdauer wird zur Dosierung.)</small>
|
||||
|
||||
<h3>Pumpenschutz</h3>
|
||||
<label for='cxPumpMaxRun'>Max. Laufzeit (Sekunden):</label>
|
||||
<input type='number' min='10.0' max='300.0' step='5.0' id='cxPumpMaxRun' name='cxPumpMaxRun' value='{CX_PUMP_MAX_RUN}' required>
|
||||
<label for='cxPumpRest'>Pumpenschutz: Zwangspause (Sekunden):</label>
|
||||
<label for='cxPumpRest'>Zwangspause (Sekunden):</label>
|
||||
<input type='number' min='0.0' max='120.0' step='1.0' id='cxPumpRest' name='cxPumpRest' value='{CX_PUMP_REST}' required>
|
||||
<small class="toggle-description-input">(Die Maschine hat keinen Bypass um den Wasserkessel: Kaltes Wasser kommt nur bei kaltem
|
||||
Kessel am Puck an. Deshalb ist die kalte Extraktion nur unterhalb der Freigabetemperatur möglich, praktisch also
|
||||
aus dem kalten Zustand heraus. Solange der Modus aktiv ist, heizt der Wasserkreis nicht - der Dampfkreis bleibt
|
||||
unberührt und darf weiter heizen. Die Pumpenlaufzeit wird kumuliert gezählt; nach der eingestellten
|
||||
Laufzeit legt die Steuerung eine Zwangspause ein. Der Modus selbst wird auf dem Dashboard bzw. am Touch-Display
|
||||
ein- und ausgeschaltet und bleibt über Standby und Neustart hinweg aktiv, bis er dort wieder ausgeschaltet
|
||||
wird - solange heizt der Wasserkreis nicht.)</small>
|
||||
{CX_STATUS_MSG}
|
||||
<small class="toggle-description-input">(Gezählt wird die kumulierte Einschaltzeit der Pumpe, nicht die Bezugsdauer. Nach Ablauf
|
||||
legt die Steuerung eine Zwangspause ein; der Bezug läuft dabei weiter.)</small>
|
||||
<br>
|
||||
)rawliteral";
|
||||
|
||||
@@ -7239,42 +7397,8 @@ void handleBrewControl(AsyncWebServerRequest *request) {
|
||||
response->print(piFieldsHtml);
|
||||
yield();
|
||||
|
||||
// --- Cold Extraction Sektion ---
|
||||
response->print(FPSTR(brewControlCX_H3));
|
||||
response->print(FPSTR(brewControlCX_ToggleContainerStart));
|
||||
if (coldExtractionEnabled) {
|
||||
response->print(F(" checked"));
|
||||
}
|
||||
response->print(FPSTR(brewControlCX_ToggleContainerEnd));
|
||||
|
||||
String cxFieldsHtml = FPSTR(brewControlCX_Fields);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionMaxTempC);
|
||||
cxFieldsHtml.replace("{CX_MAX_TEMP}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionPreInfusionSeconds);
|
||||
cxFieldsHtml.replace("{CX_PREINF}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%u", (unsigned int)coldExtractionPulsePeriodMs);
|
||||
cxFieldsHtml.replace("{CX_PULSE_MS}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionDutyPercent);
|
||||
cxFieldsHtml.replace("{CX_DUTY}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionTargetGrams);
|
||||
cxFieldsHtml.replace("{CX_TARGET}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionMaxSeconds);
|
||||
cxFieldsHtml.replace("{CX_MAX_SECS}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionPumpMaxRunSec);
|
||||
cxFieldsHtml.replace("{CX_PUMP_MAX_RUN}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionPumpRestSec);
|
||||
cxFieldsHtml.replace("{CX_PUMP_REST}", buffer);
|
||||
if (coldExtractionEnabled) {
|
||||
String cxStatus = coldExtractionBlockReason();
|
||||
if (cxStatus.length() > 0) {
|
||||
cxFieldsHtml.replace("{CX_STATUS_MSG}", "<br><b><small style='color: #FFCC00;'>" + cxStatus + "</small></b>");
|
||||
} else {
|
||||
cxFieldsHtml.replace("{CX_STATUS_MSG}", "<br><b><small style='color: #66CC66;'>Kalte Extraktion derzeit möglich.</small></b>");
|
||||
}
|
||||
} else {
|
||||
cxFieldsHtml.replace("{CX_STATUS_MSG}", "");
|
||||
}
|
||||
response->print(cxFieldsHtml);
|
||||
// Cold Extraction hat eine eigene Seite (/Cold-Extraction) - hier nur der Verweis
|
||||
response->print(FPSTR(brewControlCX_Link));
|
||||
yield();
|
||||
|
||||
// --- Dampf-Timer Sektion ---
|
||||
@@ -7345,6 +7469,8 @@ struct BrewControlUpdate {
|
||||
uint16_t cxPulseMs = 0;
|
||||
bool hasCXDuty = false;
|
||||
float cxDuty = 0.0f;
|
||||
bool hasCXPreInfDuty = false;
|
||||
float cxPreInfDuty = 0.0f;
|
||||
bool hasCXTarget = false;
|
||||
float cxTarget = 0.0f;
|
||||
bool hasCXMaxSecs = false;
|
||||
@@ -7510,6 +7636,14 @@ bool applyBrewControlUpdate(const BrewControlUpdate& update) {
|
||||
coldExtractionConfigChanged = true;
|
||||
}
|
||||
}
|
||||
if (update.hasCXPreInfDuty) {
|
||||
float v = update.cxPreInfDuty;
|
||||
if (isfinite(v) && v >= COLDEX_DUTY_MIN && v <= COLDEX_DUTY_MAX && fabs(v - coldExtractionPreInfDutyPercent) > 0.01f) {
|
||||
coldExtractionPreInfDutyPercent = v;
|
||||
EEPROM.put(EEPROM_ADDR_COLDEX_PREINF_DUTY, coldExtractionPreInfDutyPercent);
|
||||
coldExtractionConfigChanged = true;
|
||||
}
|
||||
}
|
||||
if (update.hasCXTarget) {
|
||||
float v = update.cxTarget;
|
||||
if (isfinite(v) && v >= COLDEX_TARGET_GRAMS_MIN && v <= COLDEX_TARGET_GRAMS_MAX && fabs(v - coldExtractionTargetGrams) > 0.01f) {
|
||||
@@ -7555,6 +7689,106 @@ bool applyBrewControlUpdate(const BrewControlUpdate& update) {
|
||||
return changed || flowGuardConfigChanged || coldExtractionConfigChanged;
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* Cold Extraction: eigene Seite (GET /Cold-Extraction, POST /saveColdExtraction)
|
||||
* Bewusst getrennt von /Brew-Control - die Parameter gehoeren logisch zusammen und die
|
||||
* Brew-Control-Seite war mit dem Block darunter unuebersichtlich geworden.
|
||||
************************************************************************************/
|
||||
void handleColdExtraction(AsyncWebServerRequest *request) {
|
||||
char buffer[16];
|
||||
AsyncResponseStream *response = request->beginResponseStream("text/html; charset=utf-8");
|
||||
|
||||
response->print(FPSTR(coldExHead));
|
||||
response->print(FPSTR(commonStyle));
|
||||
response->print(FPSTR(coldExHeadEnd));
|
||||
response->print(FPSTR(commonNav));
|
||||
response->print(FPSTR(coldExBodyStart));
|
||||
yield();
|
||||
|
||||
response->print(FPSTR(coldExCX_H3));
|
||||
response->print(FPSTR(brewControlCX_ToggleContainerStart));
|
||||
if (coldExtractionEnabled) {
|
||||
response->print(F(" checked"));
|
||||
}
|
||||
response->print(FPSTR(brewControlCX_ToggleContainerEnd));
|
||||
|
||||
String cxFieldsHtml = FPSTR(brewControlCX_Fields);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionMaxTempC);
|
||||
cxFieldsHtml.replace("{CX_MAX_TEMP}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionPreInfusionSeconds);
|
||||
cxFieldsHtml.replace("{CX_PREINF}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionPreInfDutyPercent);
|
||||
cxFieldsHtml.replace("{CX_PREINF_DUTY}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%u", (unsigned int)coldExtractionPulsePeriodMs);
|
||||
cxFieldsHtml.replace("{CX_PULSE_MS}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionDutyPercent);
|
||||
cxFieldsHtml.replace("{CX_DUTY}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionTargetGrams);
|
||||
cxFieldsHtml.replace("{CX_TARGET}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionMaxSeconds);
|
||||
cxFieldsHtml.replace("{CX_MAX_SECS}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionPumpMaxRunSec);
|
||||
cxFieldsHtml.replace("{CX_PUMP_MAX_RUN}", buffer);
|
||||
snprintf(buffer, sizeof(buffer), "%.1f", coldExtractionPumpRestSec);
|
||||
cxFieldsHtml.replace("{CX_PUMP_REST}", buffer);
|
||||
|
||||
if (coldExtractionEnabled) {
|
||||
String cxStatus;
|
||||
// Waagen-Hinweis zuerst: er gilt unabhaengig von der Temperatur-Freigabe und
|
||||
// erklaert, warum das Zielgewicht weiter unten wirkungslos ist.
|
||||
if (!coldExtractionScaleUsable()) {
|
||||
cxStatus += "<br><b><small style='color: #FFCC00;'>Keine Waage aktiv/verbunden: Zielgewicht und "
|
||||
"Stillstands-Erkennung greifen nicht. Der Bezug endet erst nach der maximalen "
|
||||
"Bezugsdauer - diesen Wert dann als Dosierung verstehen.</small></b>";
|
||||
}
|
||||
String reason = coldExtractionBlockReason();
|
||||
if (reason.length() > 0) {
|
||||
cxStatus += "<br><b><small style='color: #FFCC00;'>" + reason + "</small></b>";
|
||||
} else {
|
||||
cxStatus += "<br><b><small style='color: #66CC66;'>Kalte Extraktion derzeit möglich.</small></b>";
|
||||
}
|
||||
cxFieldsHtml.replace("{CX_STATUS_MSG}", cxStatus);
|
||||
} else {
|
||||
cxFieldsHtml.replace("{CX_STATUS_MSG}", "");
|
||||
}
|
||||
response->print(cxFieldsHtml);
|
||||
yield();
|
||||
|
||||
response->print(FPSTR(coldExFormEnd));
|
||||
request->send(response);
|
||||
}
|
||||
|
||||
void handleSaveColdExtraction(AsyncWebServerRequest *request) {
|
||||
BrewControlUpdate update; // nur die cx-Felder setzen, alles andere bleibt unangetastet
|
||||
|
||||
update.hasCXEnabled = true;
|
||||
update.cxEnabled = request->hasArg("cxEnabled");
|
||||
update.hasCXMaxTemp = request->hasArg("cxMaxTemp");
|
||||
if (update.hasCXMaxTemp) { update.cxMaxTemp = request->arg("cxMaxTemp").toFloat(); }
|
||||
update.hasCXPreInf = request->hasArg("cxPreInf");
|
||||
if (update.hasCXPreInf) { update.cxPreInf = request->arg("cxPreInf").toFloat(); }
|
||||
update.hasCXPreInfDuty = request->hasArg("cxPreInfDuty");
|
||||
if (update.hasCXPreInfDuty) { update.cxPreInfDuty = request->arg("cxPreInfDuty").toFloat(); }
|
||||
update.hasCXPulseMs = request->hasArg("cxPulseMs");
|
||||
if (update.hasCXPulseMs) { update.cxPulseMs = (uint16_t)request->arg("cxPulseMs").toInt(); }
|
||||
update.hasCXDuty = request->hasArg("cxDuty");
|
||||
if (update.hasCXDuty) { update.cxDuty = request->arg("cxDuty").toFloat(); }
|
||||
update.hasCXTarget = request->hasArg("cxTarget");
|
||||
if (update.hasCXTarget) { update.cxTarget = request->arg("cxTarget").toFloat(); }
|
||||
update.hasCXMaxSecs = request->hasArg("cxMaxSecs");
|
||||
if (update.hasCXMaxSecs) { update.cxMaxSecs = request->arg("cxMaxSecs").toFloat(); }
|
||||
update.hasCXPumpMaxRun = request->hasArg("cxPumpMaxRun");
|
||||
if (update.hasCXPumpMaxRun) { update.cxPumpMaxRun = request->arg("cxPumpMaxRun").toFloat(); }
|
||||
update.hasCXPumpRest = request->hasArg("cxPumpRest");
|
||||
if (update.hasCXPumpRest) { update.cxPumpRest = request->arg("cxPumpRest").toFloat(); }
|
||||
|
||||
applyBrewControlUpdate(update);
|
||||
|
||||
AsyncWebServerResponse *response = request->beginResponse(303);
|
||||
response->addHeader("Location", "/Cold-Extraction");
|
||||
request->send(response);
|
||||
}
|
||||
|
||||
void handleSaveBrewControl(AsyncWebServerRequest *request) {
|
||||
BrewControlUpdate update;
|
||||
|
||||
@@ -7590,25 +7824,9 @@ void handleSaveBrewControl(AsyncWebServerRequest *request) {
|
||||
update.hasSBTSecs = request->hasArg("sbtSecs");
|
||||
if (update.hasSBTSecs) { update.sbtSecs = request->arg("sbtSecs").toFloat(); }
|
||||
|
||||
update.hasCXEnabled = true;
|
||||
update.cxEnabled = request->hasArg("cxEnabled");
|
||||
update.hasCXMaxTemp = request->hasArg("cxMaxTemp");
|
||||
if (update.hasCXMaxTemp) { update.cxMaxTemp = request->arg("cxMaxTemp").toFloat(); }
|
||||
update.hasCXPreInf = request->hasArg("cxPreInf");
|
||||
if (update.hasCXPreInf) { update.cxPreInf = request->arg("cxPreInf").toFloat(); }
|
||||
update.hasCXPulseMs = request->hasArg("cxPulseMs");
|
||||
if (update.hasCXPulseMs) { update.cxPulseMs = (uint16_t)request->arg("cxPulseMs").toInt(); }
|
||||
update.hasCXDuty = request->hasArg("cxDuty");
|
||||
if (update.hasCXDuty) { update.cxDuty = request->arg("cxDuty").toFloat(); }
|
||||
update.hasCXTarget = request->hasArg("cxTarget");
|
||||
if (update.hasCXTarget) { update.cxTarget = request->arg("cxTarget").toFloat(); }
|
||||
update.hasCXMaxSecs = request->hasArg("cxMaxSecs");
|
||||
if (update.hasCXMaxSecs) { update.cxMaxSecs = request->arg("cxMaxSecs").toFloat(); }
|
||||
update.hasCXPumpMaxRun = request->hasArg("cxPumpMaxRun");
|
||||
if (update.hasCXPumpMaxRun) { update.cxPumpMaxRun = request->arg("cxPumpMaxRun").toFloat(); }
|
||||
update.hasCXPumpRest = request->hasArg("cxPumpRest");
|
||||
if (update.hasCXPumpRest) { update.cxPumpRest = request->arg("cxPumpRest").toFloat(); }
|
||||
|
||||
// Cold Extraction wird hier bewusst NICHT angefasst - die Felder stehen auf
|
||||
// /Cold-Extraction. Wuerde man sie hier weiter auswerten, wuerde ein Speichern auf
|
||||
// dieser Seite die Freischaltung abschalten (Checkbox fehlt im Formular = "aus").
|
||||
applyBrewControlUpdate(update);
|
||||
|
||||
AsyncWebServerResponse *response = request->beginResponse(303);
|
||||
@@ -14934,17 +15152,28 @@ static const char dashboardJavaScript[] PROGMEM = R"rawliteral(
|
||||
if (coldexRow) { coldexRow.style.display = (data.cxEnabled === true) ? '' : 'none'; }
|
||||
if (coldexToggleEl) {
|
||||
updateToggleState(coldexToggleEl, data.cxActive);
|
||||
coldexToggleEl.disabled = (data.cxEnabled !== true) || (data.cxActive !== true && data.cxAllowed !== true);
|
||||
// Umschalten haengt an cxArmable, NICHT an cxAllowed: Der Modus muss auch im
|
||||
// Standby und bei noch warmem Kessel scharf zu stellen sein.
|
||||
coldexToggleEl.disabled = (data.cxEnabled !== true) || (data.cxArmable !== true);
|
||||
}
|
||||
if (coldexHint) {
|
||||
let hintText = '';
|
||||
if (data.cxEnabled === true && data.cxAllowed !== true && data.cxActive !== true) {
|
||||
if (typeof data.tempW === 'number' && typeof data.cxMaxTemp === 'number' && data.tempW >= data.cxMaxTemp) {
|
||||
hintText = 'Wasserkessel zu warm (' + data.tempW.toFixed(1) + ' °C, benötigt < ' + data.cxMaxTemp.toFixed(1) + ' °C).';
|
||||
if (data.cxEnabled === true && data.cxAllowed !== true) {
|
||||
// Gilt auch bei aktivem Modus: dann ist er scharf, aber der Bezug noch gesperrt
|
||||
const prefix = (data.cxActive === true) ? 'Modus aktiv, Bezug noch gesperrt: ' : '';
|
||||
if (data.standbyActive === true) {
|
||||
hintText = prefix + 'Standby aktiv - Bezug erst nach dem Aufwecken.';
|
||||
} else if (typeof data.tempW === 'number' && typeof data.cxMaxTemp === 'number' && data.tempW >= data.cxMaxTemp) {
|
||||
hintText = prefix + 'Wasserkessel zu warm (' + data.tempW.toFixed(1) + ' °C, benötigt < ' + data.cxMaxTemp.toFixed(1) + ' °C).';
|
||||
} else {
|
||||
hintText = 'Cold Extraction derzeit nicht möglich.';
|
||||
hintText = prefix + 'Bezug derzeit nicht möglich.';
|
||||
}
|
||||
}
|
||||
// Waagen-Hinweis gilt zusätzlich und unabhängig von der Temperatur-Freigabe
|
||||
if (data.cxEnabled === true && (data.scaleEnabled !== true || data.scaleConnected !== true)) {
|
||||
if (hintText) { hintText += ' '; }
|
||||
hintText += 'Ohne Waage: Bezug endet nach Zeit, nicht nach Gewicht.';
|
||||
}
|
||||
coldexHint.textContent = hintText;
|
||||
coldexHint.style.display = hintText ? '' : 'none';
|
||||
}
|
||||
@@ -15491,6 +15720,8 @@ bool executeDashboardAction(const String& action, const String& value,
|
||||
if (!success) {
|
||||
coldExtractionBlockMessage = message;
|
||||
coldExtractionBlockMessageUntilMs = millis() + COLDEX_BLOCK_MESSAGE_MS;
|
||||
coldExtractionNotice = (shotActive || shotSoftwareActive) ? COLDEX_NOTICE_BUSY
|
||||
: COLDEX_NOTICE_START_REJECTED;
|
||||
}
|
||||
} else if (action == "startShot") {
|
||||
if (standbyModeActive) {
|
||||
@@ -15509,6 +15740,7 @@ bool executeDashboardAction(const String& action, const String& value,
|
||||
if (message.length() == 0) { message = "Cold Extraction derzeit nicht moeglich."; }
|
||||
coldExtractionBlockMessageUntilMs = millis() + COLDEX_BLOCK_MESSAGE_MS;
|
||||
coldExtractionBlockMessage = message;
|
||||
coldExtractionNotice = COLDEX_NOTICE_START_REJECTED;
|
||||
beepShort();
|
||||
success = false;
|
||||
} else {
|
||||
@@ -15987,7 +16219,9 @@ void buildDashboardJson(char *buffer, size_t bufferSize) {
|
||||
}
|
||||
statusKey = "brewing";
|
||||
} else if (coldExtractionModeActive) {
|
||||
statusText = "Cold Extraction bereit (Wasserkreis heizt nicht)";
|
||||
statusText = coldExtractionScaleUsable()
|
||||
? "Cold Extraction bereit (Wasserkreis heizt nicht)"
|
||||
: "Cold Extraction bereit (ohne Waage: Zeitsteuerung)";
|
||||
statusKey = "coldextraction";
|
||||
} else if (ecoModeAktiv && ecoSwitchActive) {
|
||||
statusText = dynamicEcoActive ? "Eco+ Modus aktiv (Schalter)" : "Eco Modus aktiv (Schalter)";
|
||||
@@ -16104,6 +16338,8 @@ void buildDashboardJson(char *buffer, size_t bufferSize) {
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxEnabled\":%s,", coldExtractionEnabled ? "true" : "false");
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxActive\":%s,", coldExtractionModeActive ? "true" : "false");
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxAllowed\":%s,", coldExtractionConditionsOk() ? "true" : "false");
|
||||
// cxArmable = Modus umschaltbar (auch im Standby und bei warmem Kessel); cxAllowed = Bezug moeglich
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxArmable\":%s,", coldExtractionArmable() ? "true" : "false");
|
||||
dtostrf(coldExtractionMaxTempC, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxMaxTemp\":%s,", floatBuf);
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"scaleModeActive\":%s,", scaleModeActive ? "true" : "false");
|
||||
dtostrf(brewByTimeTargetSeconds, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"bbtSecs\":%s,", floatBuf);
|
||||
@@ -16234,7 +16470,8 @@ static void getTouchUartStatus(String& statusText, String& statusKey) {
|
||||
}
|
||||
statusKey = "brewing";
|
||||
} else if (coldExtractionModeActive) {
|
||||
statusText = "Cold Extraction bereit";
|
||||
statusText = coldExtractionScaleUsable() ? "Cold Extraction bereit"
|
||||
: "Cold Extraction bereit (Zeitsteuerung)";
|
||||
statusKey = "coldextraction";
|
||||
} else if (ecoModeAktiv) {
|
||||
statusText = dynamicEcoActive ? "Eco+ Modus aktiv" : "Eco Modus aktiv";
|
||||
@@ -16429,18 +16666,32 @@ static void buildTouchUartStateJson(char *buffer, size_t bufferSize) {
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxActive\":%s,", coldExtractionModeActive ? "true" : "false");
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxShot\":%s,", coldExtractionShotActive ? "true" : "false");
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxAllowed\":%s,", coldExtractionConditionsOk() ? "true" : "false");
|
||||
// cxArmable = Modus umschaltbar (auch im Standby und bei warmem Kessel); cxAllowed = Bezug moeglich
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxArmable\":%s,", coldExtractionArmable() ? "true" : "false");
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxResting\":%s,", coldExtractionPumpResting ? "true" : "false");
|
||||
dtostrf(coldExtractionMaxTempC, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxMaxTemp\":%s,", floatBuf);
|
||||
dtostrf(coldExtractionTargetGrams, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxTarget\":%s,", floatBuf);
|
||||
dtostrf(coldExtractionPreInfusionSeconds, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxPreInf\":%s,", floatBuf);
|
||||
// Restliche Parameter fuer die Einstellseite am Display (seit S3 5.4.0)
|
||||
dtostrf(coldExtractionPreInfDutyPercent, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxPreInfDuty\":%s,", floatBuf);
|
||||
dtostrf(coldExtractionDutyPercent, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxDuty\":%s,", floatBuf);
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxPulseMs\":%u,", (unsigned int)coldExtractionPulsePeriodMs);
|
||||
dtostrf(coldExtractionPumpMaxRunSec, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxPumpMaxRun\":%s,", floatBuf);
|
||||
dtostrf(coldExtractionPumpRestSec, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxPumpRest\":%s,", floatBuf);
|
||||
dtostrf(coldExtractionMaxSeconds, 5, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"cxMaxSecs\":%s,", floatBuf);
|
||||
// Sperrmeldung nach abgewiesenem Start (leer = keine); laeuft nach COLDEX_BLOCK_MESSAGE_MS ab.
|
||||
// Die Texte stammen ausschliesslich aus dieser Firmware und enthalten keine JSON-Sonderzeichen.
|
||||
// Sperrgrund + transiente Meldung als Codes (kein Freitext - die State-Zeile muss kurz
|
||||
// bleiben, der P4 begrenzt eingehende Zeilen; Texte rendert das Display selbst).
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxBlock\":%u,", (unsigned int)coldExtractionBlockCode());
|
||||
{
|
||||
const char* cxMsg = "";
|
||||
if (coldExtractionBlockMessage.length() > 0 && (long)(millis() - coldExtractionBlockMessageUntilMs) < 0) {
|
||||
cxMsg = coldExtractionBlockMessage.c_str();
|
||||
uint8_t notice = COLDEX_NOTICE_NONE;
|
||||
if (coldExtractionNotice != COLDEX_NOTICE_NONE) {
|
||||
if ((long)(millis() - coldExtractionBlockMessageUntilMs) < 0) {
|
||||
notice = coldExtractionNotice;
|
||||
} else {
|
||||
coldExtractionNotice = COLDEX_NOTICE_NONE;
|
||||
}
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxMessage\":\"%s\",", cxMsg);
|
||||
}
|
||||
offset += snprintf(buffer + offset, bufferSize - offset, "\"cxNotice\":%u,", (unsigned int)notice);
|
||||
}
|
||||
dtostrf(brewByWeightTargetGrams, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"bbwTarget\":%s,", floatBuf);
|
||||
dtostrf(brewByWeightOffsetGrams, 4, 1, floatBuf); offset += snprintf(buffer + offset, bufferSize - offset, "\"bbwOffset\":%s,", floatBuf);
|
||||
@@ -17108,9 +17359,54 @@ static bool touchUartHandleCommandLine(const String& line) {
|
||||
update.sbtSecs = floatVal;
|
||||
}
|
||||
|
||||
// --- Cold Extraction (seit S3 5.4.0 auch ueber saveBrew einstellbar) ---
|
||||
if (jsonGetBoolValue(line, "cxEnabled", boolVal)) {
|
||||
update.hasCXEnabled = true;
|
||||
update.cxEnabled = boolVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxMaxTemp", floatVal)) {
|
||||
update.hasCXMaxTemp = true;
|
||||
update.cxMaxTemp = floatVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxPreInf", floatVal)) {
|
||||
update.hasCXPreInf = true;
|
||||
update.cxPreInf = floatVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxPreInfDuty", floatVal)) {
|
||||
update.hasCXPreInfDuty = true;
|
||||
update.cxPreInfDuty = floatVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxPulseMs", floatVal)) {
|
||||
update.hasCXPulseMs = true;
|
||||
update.cxPulseMs = (uint16_t)floatVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxDuty", floatVal)) {
|
||||
update.hasCXDuty = true;
|
||||
update.cxDuty = floatVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxTarget", floatVal)) {
|
||||
update.hasCXTarget = true;
|
||||
update.cxTarget = floatVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxMaxSecs", floatVal)) {
|
||||
update.hasCXMaxSecs = true;
|
||||
update.cxMaxSecs = floatVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxPumpMaxRun", floatVal)) {
|
||||
update.hasCXPumpMaxRun = true;
|
||||
update.cxPumpMaxRun = floatVal;
|
||||
}
|
||||
if (jsonGetFloatValue(line, "cxPumpRest", floatVal)) {
|
||||
update.hasCXPumpRest = true;
|
||||
update.cxPumpRest = floatVal;
|
||||
}
|
||||
|
||||
if (!update.hasBBTEnabled && !update.hasBBTSecs && !update.hasBBWEnabled && !update.hasBBWTarget &&
|
||||
!update.hasBBWOffset && !update.hasPIEnabled && !update.hasPIDurSecs && !update.hasPIPauseSecs &&
|
||||
!update.hasSBTEnabled && !update.hasSBTSecs) {
|
||||
!update.hasSBTEnabled && !update.hasSBTSecs &&
|
||||
!update.hasCXEnabled && !update.hasCXMaxTemp && !update.hasCXPreInf && !update.hasCXPreInfDuty &&
|
||||
!update.hasCXPulseMs && !update.hasCXDuty && !update.hasCXTarget && !update.hasCXMaxSecs &&
|
||||
!update.hasCXPumpMaxRun && !update.hasCXPumpRest) {
|
||||
touchUartSendError(id, "Keine Brew-Felder");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,82 @@
|
||||
Version 1.2.0:
|
||||
- Neue Seite „Cold Extraction" mit eigenem Menüeintrag (braucht S3-Firmware ab 5.4.0). Dort stehen jetzt
|
||||
alle Parameter der kalten Extraktion und lassen sich direkt am Display ändern: Freigabetemperatur,
|
||||
Vorbenetzung (Dauer + Pumpenleistung), Hauptbezug (Pulsperiode + Pumpenleistung), Zielgewicht,
|
||||
maximale Bezugsdauer sowie der Pumpenschutz. Gespeichert wird über das erweiterte saveBrew-Kommando.
|
||||
- Der Modus-Schalter ist von der Temperatur-Seite auf die neue Seite umgezogen (eine Stelle statt zwei).
|
||||
Der Knopf „Aufwecken mit Cold Extraction" im Standby-Dialog bleibt unverändert.
|
||||
- Brew-Control-Seite neu gegliedert: Statt einer durchlaufenden Liste unter Zwischenüberschriften liegt
|
||||
jede Funktion (Pre-Infusion, Brew-by-Time, Brew-by-Weight, Dampf-Timer) jetzt in einer eigenen Karte
|
||||
mit Titel und einer Zeile, die erklärt, was sie tut. Die neue Cold-Extraction-Seite nutzt dieselbe
|
||||
Gliederung.
|
||||
- Eingabefelder werden nur beim Öffnen der Seite aus dem Zustand gefüllt, damit laufende State-Pushes
|
||||
eine begonnene Eingabe nicht überschreiben (gleiches Verhalten wie auf der Brew-Control-Seite).
|
||||
|
||||
Version 1.1.3:
|
||||
- Aufweck-Dialog hat einen dritten Knopf: „Aufwecken mit Cold Extraction" (braucht S3 ab 5.3.5).
|
||||
Er stellt den Modus scharf und beendet erst danach den Standby - in dieser Reihenfolge, damit
|
||||
der Wasserkreis gar nicht erst anheizt. Ohne diesen Weg musste man normal aufwecken (Maschine
|
||||
heizt an) und den Modus danach umschalten. Der Knopf erscheint nur, wenn die Funktion
|
||||
freigeschaltet und umschaltbar ist und der Modus nicht ohnehin schon läuft.
|
||||
- Der Schalter „Cold Extraction" auf der Temperatur-Seite hängt jetzt am neuen State-Feld
|
||||
cxArmable statt an cxAllowed: umschaltbar auch im Standby und bei warmem Kessel, gesperrt nur
|
||||
während eines laufenden kalten Bezugs. Bei älterer S3-Firmware fällt das Feld auf cxEnabled
|
||||
zurück, der Schalter bleibt also bedienbar.
|
||||
- Erklärzeile im Standby: „Nach dem Aufwecken bleibt der Wasserkreis aus."
|
||||
|
||||
Version 1.1.2:
|
||||
- Cold Extraction: Fehlt eine nutzbare Waage, weist das Display jetzt dauerhaft darauf hin.
|
||||
Ohne Waage greifen weder Zielgewicht noch Stillstands-Erkennung, der Bezug endet erst nach der
|
||||
maximalen Bezugsdauer (braucht S3-Firmware ab 5.3.4).
|
||||
- Statuszeile: „Cold Extraction aktiv - ohne Waage, Ende nach Zeit" (gelb) statt des blauen
|
||||
Normalhinweises; beim Aktivieren zusätzlich kurz die Meldung zum neuen cxNotice-Code 4.
|
||||
- Erklärzeile unter dem Schalter und die Parameter-Anzeige auf der Brew-Seite ergänzen den
|
||||
Hinweis; bei aktivem Modus ohne Waage nennt die Zeile die Zeit statt des Zielgewichts.
|
||||
|
||||
Version 1.1.1:
|
||||
- Compiler-Warnungen des P4-Builds aufgeräumt (rein technisch, keine Funktionsänderung):
|
||||
- „LV_FS_DEFAULT_DRIVE_LETTER is deprecated": Die Option heißt ab LVGL 9.3
|
||||
LV_FS_DEFAULT_DRIVER_LETTER. Der alte Name funktionierte zwar noch, löste aber in
|
||||
lv_api_map_v9_1.h ein #warning aus - und zwar in JEDER Übersetzungseinheit, die lvgl.h
|
||||
einbindet. Das allein waren rund 60 Warnungen pro Build, die alles andere zugedeckt haben.
|
||||
In lv_conf.h umbenannt.
|
||||
- „bitwise operation between different enumeration types is deprecated": LV_PART_* und
|
||||
LV_STATE_* sind in LVGL 9 zwei verschiedene Enum-Typen; sie direkt mit | zu verknüpfen ist
|
||||
in C++20 abgekündigt. Neues Makro TH_SEL(part, state) in theme.h castet beide auf
|
||||
lv_style_selector_t (ohnehin uint32_t). Betraf 5 Stellen in ui.cpp und theme.h.
|
||||
- Bug-Fix: Der Puffer für die Cold-Extraction-Infozeile auf der Brew-Seite war mit 192 Bytes
|
||||
zu klein - der Text ist rund 205 Zeichen lang (das „°" zählt als zwei Bytes), die letzte
|
||||
Zeile wurde also abgeschnitten. Jetzt 256 Bytes.
|
||||
|
||||
Version 1.1.0:
|
||||
- Cold Extraction am Display bedienbar (braucht S3-Firmware ab 5.3.2):
|
||||
- Neuer Schalter „Cold Extraction" auf der Seite „Temperaturen" unter „Modi", darunter eine
|
||||
Erklärzeile mit dem aktuellen Zustand bzw. dem Sperrgrund. Schalter und Zeile bleiben
|
||||
unsichtbar, solange die S3 die Funktion nicht freigeschaltet meldet (auch bei älterer
|
||||
S3-Firmware, die die Felder gar nicht sendet).
|
||||
- Einschalten ist nur bei erteilter Freigabe möglich (Wasserkessel kalt genug, kein Standby /
|
||||
Wartung / Tuning); ausschalten immer, außer während eines laufenden kalten Bezugs. Gesendet
|
||||
wird gezielt startColdExtraction/stopColdExtraction statt eines Toggles, damit ein
|
||||
abgewiesener Befehl den Schalter nicht in einen nie bestätigten Zustand bringt.
|
||||
- Statuszeile: eigener Slot direkt hinter der Sicherheitsmeldung. Zeigt dauerhaft
|
||||
„Cold Extraction aktiv - Wasserkreis heizt nicht", bei fehlender Freigabe den Grund,
|
||||
während der Pumpen-Zwangspause den Pumpenschutz und transient einen abgewiesenen Start
|
||||
bzw. einen Abbruch wegen fehlenden Zulaufs.
|
||||
- Wasser-Kachel im Dashboard zeigt bei aktivem Modus „Cold Extraction - Heizen aus" statt
|
||||
eines Sollwerts, der nicht erreicht wird; der Aufheiz-Countdown ist dann unterdrückt.
|
||||
- Phasenleiste und Live-Bezugsschirm benennen die erste Phase eines kalten Bezugs
|
||||
„Vorbenetzung" (keine Pause-Phase) und zeigen die Pumpenpause an.
|
||||
- Brew-Seite: Cold-Extraction-Parameter als Anzeige (Freigabeschwelle, Vorbenetzung,
|
||||
Zielgewicht, Timeout) mit Hinweis, dass sie in der Web-UI eingestellt werden.
|
||||
- Statistik-Seite: kalte Bezüge sind mit „(kalt)" markiert und gehen nicht in die mittlere
|
||||
Bezugsdauer ein - gleiche Regel wie in der S3-Statistik.
|
||||
- Bug-Fix: Das Limit für eingehende UART-Zeilen (PROTO_RX_LINE_MAX) lag bei 2048 Bytes, während
|
||||
die State-Zeile der S3 bereits rund 2,1 KB erreicht - mit langem Status-, Profil- oder
|
||||
SSID-Text konnte sie darüber liegen. In dem Fall wurde die GANZE Zeile verworfen und das
|
||||
Display fror auf dem letzten Stand ein, ohne dass die Verbindung als tot erkannt wurde.
|
||||
Das Limit ist jetzt 4096 Bytes; der RX-Puffer selbst bleibt bei 2 KB reserviert, weil der
|
||||
interne RAM knapp ist und eine Arduino-String nicht ins PSRAM alloziert werden kann.
|
||||
|
||||
Version 1.0.13:
|
||||
- Profil-Schnellwahl + Anzeige des aktiven Profils (braucht S3-Firmware ab 5.1.1):
|
||||
- Neuer Profil-Chip im Header (auf allen Seiten sichtbar): zeigt das zuletzt geladene bzw.
|
||||
|
||||
@@ -65,13 +65,16 @@
|
||||
// -------------------------------------------------------------------------------------
|
||||
// Firmware
|
||||
// -------------------------------------------------------------------------------------
|
||||
#define DISPLAY_FW_VERSION "1.0.13" // Firmware-Stand der P4-Display-Steuerung (Info-Seite)
|
||||
#define DISPLAY_FW_VERSION "1.2.0" // Firmware-Stand der P4-Display-Steuerung (Info-Seite)
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// Protokoll
|
||||
// -------------------------------------------------------------------------------------
|
||||
#define PROTO_EXPECTED_VERSION 2 // muss zur S3-Firmware passen (TOUCH_UART_PROTOCOL_VERSION)
|
||||
#define PROTO_RX_LINE_MAX 2048 // max. eingehende Zeilenlaenge (Bytes)
|
||||
// Die State-Zeile der S3 kann mit langem Status-/Profil-/SSID-Text ueber 2 KB gehen. Wird
|
||||
// das Limit erreicht, verwirft der Client die GANZE Zeile und das Display friert auf dem
|
||||
// letzten Stand ein -> Reserve deutlich groesser als der reale Bedarf (~2,3 KB).
|
||||
#define PROTO_RX_LINE_MAX 4096 // max. eingehende Zeilenlaenge (Bytes)
|
||||
#define PROTO_HEARTBEAT_MS 5000 // Intervall fuer 'ping' (S3-Timeout = 15 s)
|
||||
#define PROTO_HELLO_RETRY_MS 2000 // erneuter 'hello'-Versuch, solange nicht verbunden
|
||||
#define PROTO_LINK_TIMEOUT_MS 8000 // ohne empfangene Nachricht -> Verbindung gilt als tot
|
||||
|
||||
@@ -727,7 +727,10 @@
|
||||
/*File system interfaces for common APIs */
|
||||
|
||||
/*Setting a default driver letter allows skipping the driver prefix in filepaths*/
|
||||
#define LV_FS_DEFAULT_DRIVE_LETTER '\0'
|
||||
/* Ab LVGL 9.3 heisst die Option LV_FS_DEFAULT_DRIVER_LETTER. Der alte Name wird zwar noch
|
||||
uebersetzt, loest aber in lv_api_map_v9_1.h ein #warning aus - und zwar in JEDER
|
||||
Uebersetzungseinheit, die lvgl.h einbindet (~60 Warnungen pro Build). */
|
||||
#define LV_FS_DEFAULT_DRIVER_LETTER '\0'
|
||||
|
||||
/*API for fopen, fread, etc*/
|
||||
#define LV_USE_FS_STDIO 0
|
||||
|
||||
@@ -68,6 +68,30 @@ struct MachineState {
|
||||
float bbwTarget = 0, bbwOffset = 0;
|
||||
uint8_t piState = 0; // Pre-Infusion-Phase (0=inaktiv,1=Pre-Infusion,2=Pause,3=Hauptbezug; seit S3 5.0.12)
|
||||
|
||||
// --- Cold Extraction (kalte Extraktion; seit S3 5.3.0) ---
|
||||
bool cxEnabled = false; // Funktion auf der S3 freigeschaltet (sonst Bedienelement ausblenden)
|
||||
bool cxActive = false; // Modus scharf: Wasserkreis heizt nicht (persistent, seit S3 5.3.1)
|
||||
bool cxShot = false; // der laufende Bezug ist eine kalte Extraktion
|
||||
bool cxAllowed = false; // Bezug jetzt moeglich (Wasserkessel kalt genug, kein Standby/Wartung/Tuning)
|
||||
bool cxArmable = false; // Modus umschaltbar - auch im Standby und bei warmem Kessel (seit S3 5.3.5)
|
||||
bool cxResting = false; // Zwangspause des Pumpenschutzes laeuft (Bezug laeuft weiter)
|
||||
float cxMaxTemp = 0; // Freigabeschwelle in C
|
||||
float cxTarget = 0; // Zielgewicht in g
|
||||
float cxPreInfSec = 0; // Vorbenetzung in s (fuer die Phasenleiste des kalten Bezugs)
|
||||
// Restliche Parameter fuer die Einstellseite am Display (seit S3 5.4.0)
|
||||
float cxPreInfDuty = 0; // Pumpenleistung Vorbenetzung in %
|
||||
float cxDuty = 0; // Pumpenleistung Hauptbezug in %
|
||||
uint16_t cxPulseMs = 0; // Pulsperiode in ms
|
||||
float cxPumpMaxRun = 0; // Pumpenschutz: max. kumulierte Laufzeit in s
|
||||
float cxPumpRest = 0; // Pumpenschutz: Zwangspause in s
|
||||
float cxMaxSecs = 0; // Sicherheits-Timeout des Bezugs in s
|
||||
// Sperrgrund: 0=frei, 1=nicht freigeschaltet, 2=Standby, 3=Wartung, 4=Reinigungsassistent,
|
||||
// 5=PID-Tuning, 6=Sensorfehler, 7=Wasserkessel zu warm
|
||||
uint8_t cxBlock = 0;
|
||||
// Transiente Meldung: 0=keine, 1=Start abgewiesen, 2=Bezug ohne Zulauf beendet,
|
||||
// 3=Umschalten waehrend eines Bezugs abgelehnt
|
||||
uint8_t cxNotice = 0;
|
||||
|
||||
// --- Gehaeusesensor ---
|
||||
bool caseSensorEnabled = false;
|
||||
bool caseTempDashboard = false;
|
||||
|
||||
@@ -16,6 +16,10 @@ void ProtocolClient::begin() {
|
||||
DISPLAY_UART_PORT.setRxBufferSize(2048);
|
||||
DISPLAY_UART_PORT.begin(DISPLAY_UART_BAUDRATE, SERIAL_8N1,
|
||||
DISPLAY_UART_RX_PIN, DISPLAY_UART_TX_PIN);
|
||||
// Bewusst NICHT auf PROTO_RX_LINE_MAX (4 KB) reserviert: Der interne RAM ist knapp
|
||||
// (statisch ~98 %), und eine Arduino-String kann nicht ins PSRAM alloziert werden.
|
||||
// 2 KB deckt die reale State-Zeile (~2,1 KB) fast vollstaendig ab; der Rest waechst
|
||||
// in kleinen Schritten nach. Das Limit dient nur als Obergrenze gegen Muell/Overflow.
|
||||
_rxBuf.reserve(2048);
|
||||
_lastHelloMs = 0;
|
||||
_lastHeartbeatMs = 0;
|
||||
@@ -216,6 +220,26 @@ void ProtocolClient::applyState(const String& json) {
|
||||
s.bbwTarget = doc["bbwTarget"] | s.bbwTarget;
|
||||
s.bbwOffset = doc["bbwOffset"] | s.bbwOffset;
|
||||
|
||||
// Cold Extraction (fehlt bei S3-FW < 5.3.0 -> cxEnabled bleibt false, UI blendet alles aus)
|
||||
s.cxEnabled = doc["cxEnabled"] | false;
|
||||
s.cxActive = doc["cxActive"] | false;
|
||||
s.cxShot = doc["cxShot"] | false;
|
||||
s.cxAllowed = doc["cxAllowed"] | false;
|
||||
// Fehlt bei S3-FW < 5.3.5 -> auf cxEnabled zurueckfallen, sonst waere der Schalter tot
|
||||
s.cxArmable = doc["cxArmable"] | (doc["cxEnabled"] | false);
|
||||
s.cxResting = doc["cxResting"] | false;
|
||||
s.cxMaxTemp = doc["cxMaxTemp"] | s.cxMaxTemp;
|
||||
s.cxTarget = doc["cxTarget"] | s.cxTarget;
|
||||
s.cxPreInfSec= doc["cxPreInf"] | s.cxPreInfSec;
|
||||
s.cxPreInfDuty = doc["cxPreInfDuty"] | s.cxPreInfDuty;
|
||||
s.cxDuty = doc["cxDuty"] | s.cxDuty;
|
||||
s.cxPulseMs = doc["cxPulseMs"] | s.cxPulseMs;
|
||||
s.cxPumpMaxRun = doc["cxPumpMaxRun"] | s.cxPumpMaxRun;
|
||||
s.cxPumpRest = doc["cxPumpRest"] | s.cxPumpRest;
|
||||
s.cxMaxSecs = doc["cxMaxSecs"] | s.cxMaxSecs;
|
||||
s.cxBlock = doc["cxBlock"] | (uint8_t)0;
|
||||
s.cxNotice = doc["cxNotice"] | (uint8_t)0;
|
||||
|
||||
s.caseSensorEnabled = doc["caseSensorEnabled"] | false;
|
||||
s.caseTempDashboard = doc["caseTempDashboard"] | false;
|
||||
s.caseSensorType = doc["caseSensorType"] | 0;
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
#define COL_BORDER lv_color_hex(0x555555)
|
||||
#define COL_INPUT_BG lv_color_hex(0x101010)
|
||||
|
||||
// Style-Selektor aus Part + State. LV_PART_* und LV_STATE_* sind in LVGL 9 zwei
|
||||
// verschiedene Enum-Typen; sie direkt mit | zu verknuepfen ist in C++20 deprecated
|
||||
// (-Wdeprecated-enum-enum-conversion). Der Zieltyp ist ohnehin uint32_t.
|
||||
#define TH_SEL(part, state) ((lv_style_selector_t)(part) | (lv_style_selector_t)(state))
|
||||
|
||||
// ---- Karte (dunkel, abgerundet) ----
|
||||
static inline lv_obj_t* th_card(lv_obj_t* parent) {
|
||||
lv_obj_t* c = lv_obj_create(parent);
|
||||
@@ -61,7 +66,7 @@ static inline lv_obj_t* th_textarea(lv_obj_t* parent, bool oneLine) {
|
||||
lv_textarea_set_one_line(ta, oneLine);
|
||||
lv_obj_set_style_bg_color(ta, COL_INPUT_BG, 0);
|
||||
lv_obj_set_style_border_color(ta, COL_BORDER, 0);
|
||||
lv_obj_set_style_border_color(ta, COL_ACCENT, LV_PART_MAIN | LV_STATE_FOCUSED);
|
||||
lv_obj_set_style_border_color(ta, COL_ACCENT, TH_SEL(LV_PART_MAIN, LV_STATE_FOCUSED));
|
||||
lv_obj_set_style_border_width(ta, 1, 0);
|
||||
lv_obj_set_style_radius(ta, 8, 0);
|
||||
lv_obj_set_style_text_color(ta, COL_TEXT, 0);
|
||||
|
||||
+346
-26
@@ -38,6 +38,7 @@ static lv_timer_t* g_toastTimer = nullptr;
|
||||
static lv_obj_t* g_standbyScreen = nullptr; // Vollbild-Overlay im Standby (Uhr)
|
||||
static lv_obj_t* g_standbyClock = nullptr;
|
||||
static lv_obj_t* g_wakeConfirm = nullptr; // Bestaetigungsdialog "Aus dem Standby aufwecken?"
|
||||
static lv_obj_t* g_wakeColdBtn = nullptr; // "Aufwecken mit Cold Extraction" (nur wenn freigeschaltet)
|
||||
static bool g_wakeDialogOpen = false; // Dialog sichtbar -> Display hell schalten (lesbar)
|
||||
static bool g_standbyShown = false; // Standby-Uhr-Overlay zuletzt als sichtbar geschaltet (fuer Ein-/Ausblend-Uebergang)
|
||||
|
||||
@@ -49,8 +50,8 @@ static lv_obj_t* g_otaStatus = nullptr;
|
||||
static lv_obj_t* g_otaBytes = nullptr;
|
||||
|
||||
// Navigation
|
||||
enum { PG_DASH = 0, PG_CHART, PG_STATS, PG_TEMP, PG_BREW, PG_SERVICE, PG_PROFILE, PG_LIGHT, PG_WIFI, PG_INFO, PG_COUNT };
|
||||
static const char* PAGE_NAMES[PG_COUNT] = { "Dashboard", "Verlauf", "Statistik", "Temperatur", "Brew-Control", "Reinigung/Wartung", "Profile", "Licht", "WiFi", "Info" };
|
||||
enum { PG_DASH = 0, PG_CHART, PG_STATS, PG_TEMP, PG_BREW, PG_COLDEX, PG_SERVICE, PG_PROFILE, PG_LIGHT, PG_WIFI, PG_INFO, PG_COUNT };
|
||||
static const char* PAGE_NAMES[PG_COUNT] = { "Dashboard", "Verlauf", "Statistik", "Temperatur", "Brew-Control", "Cold Extraction", "Reinigung/Wartung", "Profile", "Licht", "WiFi", "Info" };
|
||||
static lv_obj_t* g_content = nullptr;
|
||||
static lv_obj_t* g_pages[PG_COUNT] = { nullptr };
|
||||
static lv_obj_t* g_drawer = nullptr;
|
||||
@@ -65,7 +66,9 @@ static lv_obj_t* g_errIcon = nullptr; // Fehlersymbol im Header (rot, auf
|
||||
// Konsolidierte Statuszeile: EINE feste einzeilige Meldung statt gestapelter Einzelbanner.
|
||||
// Jeder Hinweis belegt einen Slot (Reihenfolge = Prioritaet, Rot vor Gelb vor Blau);
|
||||
// mehrere aktive Meldungen rotieren alle 4 s weich durch (siehe status_line_tick).
|
||||
enum StatusSlot { ST_SAFETY = 0, ST_DAMPF, ST_CLEAN, ST_TUNE, ST_MAINT, ST_HEAT, ST_COUNT };
|
||||
// ST_COLDEX steht direkt hinter der Sicherheitsmeldung: Solange der Modus laeuft, heizt der
|
||||
// Wasserkreis nicht - das muss der Benutzer sehen, sonst wartet er auf Temperatur, die nicht kommt.
|
||||
enum StatusSlot { ST_SAFETY = 0, ST_COLDEX, ST_DAMPF, ST_CLEAN, ST_TUNE, ST_MAINT, ST_HEAT, ST_COUNT };
|
||||
struct StatusMsg {
|
||||
bool active = false;
|
||||
char text[120] = "";
|
||||
@@ -205,6 +208,7 @@ static lv_obj_t* g_piRow = nullptr; // Containe
|
||||
static lv_obj_t* g_piChip[3] = { nullptr, nullptr, nullptr }; // Chip je Schritt
|
||||
static lv_obj_t* g_piChipLbl[3] = { nullptr, nullptr, nullptr };
|
||||
static bool g_piShotMode = false; // laufender Bezug nutzt Pre-Infusion
|
||||
static bool g_piColdMode = false; // laufender Bezug ist eine kalte Extraktion (andere Phasennamen)
|
||||
static uint8_t g_piStateS3 = 0; // Phasenstatus der S3 (0=inaktiv,1=PI,2=Pause,3=Extraktion)
|
||||
static uint32_t g_piDurMs = 0, g_piPauseMs = 0; // beim Bezug gelatchte Phasendauern
|
||||
static int g_piLastPhase = -1; // zuletzt gestylte Phase (Styles nur bei Wechsel anfassen)
|
||||
@@ -219,6 +223,8 @@ static float g_sbtTarget = 0.0f; // Dampf-Zielzeit (s)
|
||||
|
||||
// Temperatur
|
||||
static lv_obj_t* lblTargW; static lv_obj_t* lblTargD; static lv_obj_t* swEco; static lv_obj_t* swMaint;
|
||||
static lv_obj_t* swColdEx = nullptr; // Cold Extraction (nur bei S3-FW >= 5.3.0 sichtbar)
|
||||
static lv_obj_t* lblColdExHint = nullptr; // Erklaerung/Sperrgrund unter dem Schalter
|
||||
static float g_targW = 0, g_targD = 0; static unsigned long g_targEditMs = 0;
|
||||
static lv_obj_t* lblHeatUp = nullptr; static int g_heatUp = 0; static unsigned long g_heatUpEditMs = 0;
|
||||
static bool g_heatUpDirty = false; // ungesendete Aufheizzeit-Aenderung (entprellt senden)
|
||||
@@ -245,6 +251,15 @@ static lv_obj_t* swPI; static lv_obj_t* taPiDur; static lv_obj_t* taPiPause;
|
||||
static lv_obj_t* swBBT; static lv_obj_t* taBbtSecs;
|
||||
static lv_obj_t* swBBW; static lv_obj_t* taBbwTarget; static lv_obj_t* taBbwOffset;
|
||||
static lv_obj_t* swSBT; static lv_obj_t* taSbtSecs;
|
||||
// Cold-Extraction-Seite (eigener Menuepunkt)
|
||||
static lv_obj_t* taCxMaxTemp = nullptr; static lv_obj_t* taCxPreInf = nullptr;
|
||||
static lv_obj_t* taCxPreInfDuty = nullptr; static lv_obj_t* taCxPulseMs = nullptr;
|
||||
static lv_obj_t* taCxDuty = nullptr; static lv_obj_t* taCxTarget = nullptr;
|
||||
static lv_obj_t* taCxMaxSecs = nullptr; static lv_obj_t* taCxPumpMaxRun = nullptr;
|
||||
static lv_obj_t* taCxPumpRest = nullptr;
|
||||
static lv_obj_t* swCxEnabled = nullptr; // Freischaltung (entspricht dem Web-Toggle)
|
||||
static lv_obj_t* lblCxPageHint = nullptr;
|
||||
static uint32_t g_cxEditMs = 0; // waehrend der Eingabe die Felder nicht ueberschreiben
|
||||
|
||||
// WiFi
|
||||
static lv_obj_t* wifiStatusLbl; static lv_obj_t* wifiHintLbl; static lv_obj_t* wifiList;
|
||||
@@ -383,7 +398,7 @@ static lv_obj_t* row(lv_obj_t* parent, const char* label) {
|
||||
static lv_obj_t* add_switch(lv_obj_t* parent, const char* label) {
|
||||
lv_obj_t* r = row(parent, label);
|
||||
lv_obj_t* sw = lv_switch_create(r);
|
||||
lv_obj_set_style_bg_color(sw, COL_ACCENT, LV_PART_INDICATOR | LV_STATE_CHECKED);
|
||||
lv_obj_set_style_bg_color(sw, COL_ACCENT, TH_SEL(LV_PART_INDICATOR, LV_STATE_CHECKED));
|
||||
return sw;
|
||||
}
|
||||
static lv_obj_t* add_num(lv_obj_t* parent, const char* label) {
|
||||
@@ -393,6 +408,29 @@ static lv_obj_t* add_num(lv_obj_t* parent, const char* label) {
|
||||
attach_kb(ta, false);
|
||||
return ta;
|
||||
}
|
||||
// Gruppen-Karte: abgesetzter Block mit Titel, in den Zeilen (row/add_switch/add_num)
|
||||
// gelegt werden. Deutlich uebersichtlicher als eine lange Liste gleich aussehender
|
||||
// Zeilen unter Zwischenueberschriften.
|
||||
static lv_obj_t* group_card(lv_obj_t* parent, const char* title, const char* subtitle = nullptr) {
|
||||
lv_obj_t* c = th_card(parent);
|
||||
lv_obj_set_width(c, LV_PCT(100));
|
||||
lv_obj_set_height(c, LV_SIZE_CONTENT);
|
||||
lv_obj_set_flex_flow(c, LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_style_pad_row(c, 2, 0);
|
||||
lv_obj_clear_flag(c, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_t* t = lv_label_create(c);
|
||||
lv_label_set_text(t, title);
|
||||
lv_obj_set_style_text_color(t, COL_ACCENT, 0);
|
||||
lv_obj_set_style_text_font(t, &lv_font_maven_pro_18, 0);
|
||||
if (subtitle) {
|
||||
lv_obj_t* s = lv_label_create(c);
|
||||
lv_label_set_long_mode(s, LV_LABEL_LONG_WRAP);
|
||||
lv_obj_set_width(s, LV_PCT(100));
|
||||
lv_label_set_text(s, subtitle);
|
||||
lv_obj_set_style_text_color(s, COL_TEXT_MUT, 0);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static lv_obj_t* section_title(lv_obj_t* parent, const char* txt) {
|
||||
lv_obj_t* l = lv_label_create(parent);
|
||||
lv_label_set_text(l, txt);
|
||||
@@ -423,6 +461,7 @@ static lv_obj_t* make_page(lv_obj_t* parent) {
|
||||
// =====================================================================================
|
||||
// Brew-Control-Felder einmalig aus dem Zustand fuellen (nur beim Oeffnen der Seite,
|
||||
// damit laufende State-Pushes die Eingaben nicht vor dem Speichern ueberschreiben).
|
||||
static void populate_coldex(const MachineState& st); // Definition auf der Cold-Extraction-Seite
|
||||
static void populate_brew(const MachineState& st) {
|
||||
if (!swPI) return;
|
||||
sw_set(swPI, st.piEnabled); ta_setf(taPiDur, st.piDurSecs, 1); ta_setf(taPiPause, st.piPauseSecs, 1);
|
||||
@@ -456,6 +495,7 @@ static void show_page(int idx) {
|
||||
if (idx == PG_PROFILE && g_client) g_client->sendListProfiles();
|
||||
if (idx == PG_STATS) stats_request(); // Nutzungsstatistik beim Oeffnen frisch anfordern
|
||||
if (idx == PG_BREW) populate_brew(g_state); // Felder beim Oeffnen frisch laden
|
||||
if (idx == PG_COLDEX) populate_coldex(g_state);
|
||||
if (idx == PG_SERVICE) populate_service(g_state);
|
||||
}
|
||||
static void drawer_open() { if (g_drawer) { lv_obj_remove_flag(g_drawer, LV_OBJ_FLAG_HIDDEN); lv_obj_move_foreground(g_drawer); } }
|
||||
@@ -566,6 +606,17 @@ static void wake_yes_cb(lv_event_t*) { // Aufwecken -> hell lassen, S3 bee
|
||||
// das Display in der Uebergangsphase kurz auf Standby-Helligkeit abdunkeln.
|
||||
if (g_client) { g_client->sendAction("deactivateStandby"); showToast("Maschine wird aufgeweckt...", false); }
|
||||
}
|
||||
// Aufwecken direkt in die kalte Extraktion. Reihenfolge ist wichtig: erst den Modus scharf
|
||||
// stellen, dann den Standby beenden - sonst heizt der Wasserkreis in der Zwischenzeit an,
|
||||
// und genau das soll die Funktion ja verhindern.
|
||||
static void wake_cold_cb(lv_event_t*) {
|
||||
wake_confirm_hide();
|
||||
if (g_client) {
|
||||
g_client->sendAction("startColdExtraction");
|
||||
g_client->sendAction("deactivateStandby");
|
||||
showToast("Aufwecken mit Cold Extraction...", false);
|
||||
}
|
||||
}
|
||||
bool ui_wake_dialog_open() { return g_wakeDialogOpen; } // fuer die Helligkeitssteuerung in onState
|
||||
|
||||
// =====================================================================================
|
||||
@@ -1195,6 +1246,32 @@ static lv_obj_t* build_temp_arc(lv_obj_t* parent, const char* title, lv_color_t
|
||||
|
||||
static void eco_cb(lv_event_t* e) { if (g_client) g_client->sendAction(sw_get((lv_obj_t*)lv_event_get_target(e)) ? "startEco" : "stopEco"); }
|
||||
static void maint_cb(lv_event_t* e) { if (g_client) g_client->sendAction("toggleMaintenance", sw_get((lv_obj_t*)lv_event_get_target(e)) ? "true" : "false"); }
|
||||
// Sperrgrund-Code der S3 (cxBlock) in Klartext. Die S3 sendet bewusst nur den Code, damit
|
||||
// die State-Zeile kurz bleibt - die Texte gehoeren ins Display (analog statusKey).
|
||||
static String coldex_block_text(uint8_t code, float maxTemp, float tempW) {
|
||||
switch (code) {
|
||||
case 1: return "nicht freigeschaltet";
|
||||
case 2: return "Standby aktiv";
|
||||
case 3: return "Wartungsmodus aktiv";
|
||||
case 4: return "Reinigungsassistent aktiv";
|
||||
case 5: return "PID-Tuning läuft";
|
||||
case 6: return "Wasser-Sensor liefert keinen gültigen Wert";
|
||||
case 7: {
|
||||
char b[72];
|
||||
snprintf(b, sizeof(b), "Wasserkessel zu warm (%.1f °C, benötigt < %.1f °C)",
|
||||
(double)tempW, (double)maxTemp);
|
||||
return String(b);
|
||||
}
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
// Cold Extraction: gezielt start/stop senden (nicht toggle), damit ein abgewiesener Befehl
|
||||
// den Schalter nicht in einen Zustand bringt, den die S3 nie bestaetigt.
|
||||
static void coldex_cb(lv_event_t* e) {
|
||||
bool want = sw_get((lv_obj_t*)lv_event_get_target(e));
|
||||
if (g_client) g_client->sendAction(want ? "startColdExtraction" : "stopColdExtraction");
|
||||
}
|
||||
|
||||
// Stepper-Zeile: Beschriftung | [-] Wert [+]
|
||||
static lv_obj_t* build_stepper(lv_obj_t* parent, const char* label, lv_event_cb_t minus, lv_event_cb_t plus, int dec) {
|
||||
@@ -1283,6 +1360,7 @@ static void build_temp(lv_obj_t* p) {
|
||||
lv_obj_add_event_cb(swEco, eco_cb, LV_EVENT_VALUE_CHANGED, nullptr);
|
||||
swMaint = add_switch(p, "Wartungsmodus");
|
||||
lv_obj_add_event_cb(swMaint, maint_cb, LV_EVENT_VALUE_CHANGED, nullptr);
|
||||
// Cold Extraction hat eine eigene Seite (PG_COLDEX) - Schalter und Parameter stehen dort.
|
||||
}
|
||||
|
||||
// =====================================================================================
|
||||
@@ -1607,7 +1685,10 @@ static void chart_sample_cb(lv_timer_t*) {
|
||||
// Countdown voll bis zum eingestellten Wert durch - auch wenn das Wasser dabei >40 Grad wird.
|
||||
{
|
||||
long rs = g_state.heatUpRemainSec;
|
||||
if (g_state.standbyActive || rs <= 0) g_heatUpLatched = false; // Ende/Standby -> zuruecksetzen
|
||||
// Bei aktiver Cold Extraction heizt der Wasserkreis nicht - ein Aufheiz-Countdown
|
||||
// waere schlicht falsch (er liefe ab, ohne dass die Maschine warm wird).
|
||||
if (g_state.cxActive) g_heatUpLatched = false;
|
||||
else if (g_state.standbyActive || rs <= 0) g_heatUpLatched = false; // Ende/Standby -> zuruecksetzen
|
||||
else if (g_state.tempW < 40.0f) g_heatUpLatched = true; // Kaltstart erkannt -> ganzen Countdown zeigen
|
||||
if (g_heatUpLatched) {
|
||||
char b[56];
|
||||
@@ -1761,8 +1842,11 @@ static void brew_live_tick() {
|
||||
if (phase <= 2) {
|
||||
uint32_t endMs = (phase == 1) ? g_piDurMs : (g_piDurMs + g_piPauseMs);
|
||||
uint32_t remainMs = (g_shotFrozenMs < endMs) ? (endMs - g_shotFrozenMs) : 0;
|
||||
snprintf(b, sizeof(b), "%s - noch %.1f s",
|
||||
(phase == 1) ? "Pre-Infusion" : "Pause", remainMs / 1000.0f);
|
||||
const char* pname = (phase == 1) ? (g_piColdMode ? "Vorbenetzung" : "Pre-Infusion")
|
||||
: "Pause";
|
||||
snprintf(b, sizeof(b), "%s - noch %.1f s", pname, remainMs / 1000.0f);
|
||||
} else if (g_piColdMode && g_state.cxResting) {
|
||||
snprintf(b, sizeof(b), "Extraktion - Pumpenpause");
|
||||
} else {
|
||||
snprintf(b, sizeof(b), "Extraktion");
|
||||
}
|
||||
@@ -1950,21 +2034,111 @@ static void send_save_brew(lv_event_t*) {
|
||||
showToast("Speichere Brühen...", false);
|
||||
}
|
||||
static void build_brew(lv_obj_t* p) {
|
||||
section_title(p, "Pre-Infusion");
|
||||
swPI = add_switch(p, "Aktiv");
|
||||
taPiDur = add_num(p, "Dauer (s)");
|
||||
taPiPause = add_num(p, "Pause (s)");
|
||||
section_title(p, "Brew-by-Time / Weight / Steam-by-Time");
|
||||
swBBT = add_switch(p, "Brew-by-Time aktiv");
|
||||
taBbtSecs = add_num(p, "Zielzeit (s)");
|
||||
swBBW = add_switch(p, "Brew-by-Weight aktiv");
|
||||
taBbwTarget= add_num(p, "Zielgewicht (g)");
|
||||
taBbwOffset= add_num(p, "Offset (g)");
|
||||
swSBT = add_switch(p, "Steam-by-Time aktiv");
|
||||
taSbtSecs = add_num(p, "Dampf-Zielzeit (s)");
|
||||
// Jede Funktion in einer eigenen Karte - vorher standen alle Zeilen unter blossen
|
||||
// Zwischenueberschriften untereinander und waren kaum auseinanderzuhalten.
|
||||
lv_obj_t* cPI = group_card(p, "Pre-Infusion", "Pumpe an - aus - an, vor dem eigentlichen Bezug");
|
||||
swPI = add_switch(cPI, "Aktiv");
|
||||
taPiDur = add_num(cPI, "Dauer (s)");
|
||||
taPiPause = add_num(cPI, "Pause (s)");
|
||||
|
||||
lv_obj_t* cBBT = group_card(p, "Brew-by-Time", "Beendet den Bezug nach der Zielzeit");
|
||||
swBBT = add_switch(cBBT, "Aktiv");
|
||||
taBbtSecs = add_num(cBBT, "Zielzeit (s)");
|
||||
|
||||
lv_obj_t* cBBW = group_card(p, "Brew-by-Weight", "Beendet den Bezug beim Zielgewicht (braucht Waage)");
|
||||
swBBW = add_switch(cBBW, "Aktiv");
|
||||
taBbwTarget= add_num(cBBW, "Zielgewicht (g)");
|
||||
taBbwOffset= add_num(cBBW, "Offset (g)");
|
||||
|
||||
lv_obj_t* cSBT = group_card(p, "Dampf-Timer", "Beendet den Dampfbezug automatisch");
|
||||
swSBT = add_switch(cSBT, "Aktiv");
|
||||
taSbtSecs = add_num(cSBT, "Zielzeit (s)");
|
||||
|
||||
add_save_button(p, "Brühen speichern", send_save_brew);
|
||||
}
|
||||
|
||||
// =====================================================================================
|
||||
// Cold Extraction (eigene Seite)
|
||||
// =====================================================================================
|
||||
static void send_save_coldex(lv_event_t*) {
|
||||
if (!g_client) return;
|
||||
String f;
|
||||
f += "\"cxEnabled\":"; f += boolStr(sw_get(swCxEnabled)); f += ",";
|
||||
f += "\"cxMaxTemp\":"; f += String(ta_f(taCxMaxTemp), 1); f += ",";
|
||||
f += "\"cxPreInf\":"; f += String(ta_f(taCxPreInf), 1); f += ",";
|
||||
f += "\"cxPreInfDuty\":"; f += String(ta_f(taCxPreInfDuty), 1); f += ",";
|
||||
f += "\"cxPulseMs\":"; f += String((int)ta_f(taCxPulseMs)); f += ",";
|
||||
f += "\"cxDuty\":"; f += String(ta_f(taCxDuty), 1); f += ",";
|
||||
f += "\"cxTarget\":"; f += String(ta_f(taCxTarget), 1); f += ",";
|
||||
f += "\"cxMaxSecs\":"; f += String(ta_f(taCxMaxSecs), 1); f += ",";
|
||||
f += "\"cxPumpMaxRun\":"; f += String(ta_f(taCxPumpMaxRun), 1); f += ",";
|
||||
f += "\"cxPumpRest\":"; f += String(ta_f(taCxPumpRest), 1);
|
||||
g_client->sendCommand("saveBrew", f);
|
||||
g_cxEditMs = millis();
|
||||
showToast("Speichere Cold Extraction...", false);
|
||||
}
|
||||
static void build_coldex(lv_obj_t* p) {
|
||||
lv_obj_t* cMode = group_card(p, "Modus",
|
||||
"Schaltet die Wasserheizung ab. Auch im Standby und bei warmem Kessel schaltbar; "
|
||||
"bezogen werden kann erst unterhalb der Freigabetemperatur.");
|
||||
swColdEx = add_switch(cMode, "Cold Extraction aktiv");
|
||||
lv_obj_add_event_cb(swColdEx, coldex_cb, LV_EVENT_VALUE_CHANGED, nullptr);
|
||||
lblColdExHint = lv_label_create(cMode);
|
||||
lv_label_set_long_mode(lblColdExHint, LV_LABEL_LONG_WRAP);
|
||||
lv_obj_set_width(lblColdExHint, LV_PCT(100));
|
||||
lv_obj_set_style_text_color(lblColdExHint, COL_TEXT_DIM, 0);
|
||||
lv_label_set_text(lblColdExHint, "");
|
||||
|
||||
lv_obj_t* cBase = group_card(p, "Grundeinstellung");
|
||||
swCxEnabled = add_switch(cBase, "Funktion freigeschaltet");
|
||||
taCxMaxTemp = add_num(cBase, "Freigabe bis (°C)");
|
||||
|
||||
lv_obj_t* cPre = group_card(p, "Vorbenetzung",
|
||||
"Deutlich schwächer als der Hauptbezug: Kaltes Mehl quillt nicht, volle Leistung legt "
|
||||
"Kanäle an, die sich nie wieder schließen.");
|
||||
taCxPreInf = add_num(cPre, "Dauer (s)");
|
||||
taCxPreInfDuty = add_num(cPre, "Pumpenleistung (%)");
|
||||
|
||||
lv_obj_t* cMain = group_card(p, "Hauptbezug",
|
||||
"Das kalte Kaffeebett ist viel durchlässiger als ein heißes - niedrige Werte sind normal.");
|
||||
taCxPulseMs = add_num(cMain, "Pulsperiode (ms)");
|
||||
taCxDuty = add_num(cMain, "Pumpenleistung (%)");
|
||||
|
||||
lv_obj_t* cEnd = group_card(p, "Bezugsende",
|
||||
"Ohne Waage ist das Zielgewicht wirkungslos, dann zählt die maximale Dauer.");
|
||||
taCxTarget = add_num(cEnd, "Zielgewicht (g)");
|
||||
taCxMaxSecs = add_num(cEnd, "Max. Dauer (s)");
|
||||
|
||||
lv_obj_t* cPump = group_card(p, "Pumpenschutz",
|
||||
"Gezählt wird die kumulierte Einschaltzeit der Pumpe, nicht die Bezugsdauer.");
|
||||
taCxPumpMaxRun = add_num(cPump, "Max. Laufzeit (s)");
|
||||
taCxPumpRest = add_num(cPump, "Zwangspause (s)");
|
||||
|
||||
lblCxPageHint = lv_label_create(p);
|
||||
lv_label_set_long_mode(lblCxPageHint, LV_LABEL_LONG_WRAP);
|
||||
lv_obj_set_width(lblCxPageHint, LV_PCT(100));
|
||||
lv_obj_set_style_text_color(lblCxPageHint, COL_WARN, 0);
|
||||
lv_label_set_text(lblCxPageHint, "");
|
||||
lv_obj_add_flag(lblCxPageHint, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
add_save_button(p, "Cold Extraction speichern", send_save_coldex);
|
||||
}
|
||||
// Felder nur beim Oeffnen der Seite fuellen - laufende State-Pushes duerfen eine
|
||||
// begonnene Eingabe nicht ueberschreiben (gleiches Muster wie populate_brew).
|
||||
static void populate_coldex(const MachineState& st) {
|
||||
if (!taCxMaxTemp) return;
|
||||
sw_set(swCxEnabled, st.cxEnabled);
|
||||
ta_setf(taCxMaxTemp, st.cxMaxTemp, 1);
|
||||
ta_setf(taCxPreInf, st.cxPreInfSec, 0);
|
||||
ta_setf(taCxPreInfDuty, st.cxPreInfDuty, 0);
|
||||
ta_setf(taCxPulseMs, (float)st.cxPulseMs, 0);
|
||||
ta_setf(taCxDuty, st.cxDuty, 0);
|
||||
ta_setf(taCxTarget, st.cxTarget, 0);
|
||||
ta_setf(taCxMaxSecs, st.cxMaxSecs, 0);
|
||||
ta_setf(taCxPumpMaxRun, st.cxPumpMaxRun, 0);
|
||||
ta_setf(taCxPumpRest, st.cxPumpRest, 0);
|
||||
}
|
||||
|
||||
// =====================================================================================
|
||||
// Reinigungsassistent (Sub-Screen, geoeffnet ueber die Reinigung/Wartung-Seite)
|
||||
// =====================================================================================
|
||||
@@ -2291,7 +2465,7 @@ static void build_wifi(lv_obj_t* p) {
|
||||
// Aktionszeile: Scan + gewaehltes Netz
|
||||
lv_obj_t* ar = row(p, nullptr);
|
||||
g_btnScan = th_accent_button(ar, LV_SYMBOL_REFRESH " Netzwerke suchen");
|
||||
lv_obj_set_style_bg_opa(g_btnScan, LV_OPA_40, LV_PART_MAIN | LV_STATE_DISABLED);
|
||||
lv_obj_set_style_bg_opa(g_btnScan, LV_OPA_40, TH_SEL(LV_PART_MAIN, LV_STATE_DISABLED));
|
||||
lv_obj_add_event_cb(g_btnScan, wifi_scan_cb, LV_EVENT_CLICKED, nullptr);
|
||||
lblWifiSel = lv_label_create(ar);
|
||||
lv_label_set_text(lblWifiSel, "Netz: -");
|
||||
@@ -2528,13 +2702,13 @@ static void build_profiles(lv_obj_t* p) {
|
||||
lv_obj_set_style_text_color(profDetailLbl, COL_TEXT_DIM, 0);
|
||||
profLoadBtn = th_accent_button(dcard, "Profil laden");
|
||||
lv_obj_set_width(profLoadBtn, LV_PCT(100));
|
||||
lv_obj_set_style_bg_opa(profLoadBtn, LV_OPA_40, LV_PART_MAIN | LV_STATE_DISABLED);
|
||||
lv_obj_set_style_bg_opa(profLoadBtn, LV_OPA_40, TH_SEL(LV_PART_MAIN, LV_STATE_DISABLED));
|
||||
lv_obj_add_state(profLoadBtn, LV_STATE_DISABLED);
|
||||
lv_obj_add_event_cb(profLoadBtn, prof_do_load_cb, LV_EVENT_CLICKED, nullptr);
|
||||
|
||||
profDelBtn = th_button(dcard, "Profil löschen", COL_DANGER, COL_TEXT);
|
||||
lv_obj_set_width(profDelBtn, LV_PCT(100));
|
||||
lv_obj_set_style_bg_opa(profDelBtn, LV_OPA_40, LV_PART_MAIN | LV_STATE_DISABLED);
|
||||
lv_obj_set_style_bg_opa(profDelBtn, LV_OPA_40, TH_SEL(LV_PART_MAIN, LV_STATE_DISABLED));
|
||||
lv_obj_add_state(profDelBtn, LV_STATE_DISABLED);
|
||||
lv_obj_add_event_cb(profDelBtn, prof_delete_cb, LV_EVENT_CLICKED, nullptr);
|
||||
}
|
||||
@@ -2761,7 +2935,9 @@ static void pi_bar_update() {
|
||||
}
|
||||
|
||||
// Texte: erledigte Schritte mit Haken, aktive zeitgesteuerte Phase mit Restzeit
|
||||
static const char* piNames[3] = { "Pre-Infusion", "Pause", "Extraktion" };
|
||||
static const char* piNamesHot[3] = { "Pre-Infusion", "Pause", "Extraktion" };
|
||||
static const char* piNamesCold[3] = { "Vorbenetzung", "Pause", "Extraktion" };
|
||||
const char** piNames = g_piColdMode ? piNamesCold : piNamesHot;
|
||||
char pbuf[40];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (!g_piChipLbl[i]) continue;
|
||||
@@ -3041,6 +3217,7 @@ void ui_init(ProtocolClient* client) {
|
||||
g_pages[PG_TEMP] = make_page(g_content); build_temp(g_pages[PG_TEMP]);
|
||||
g_pages[PG_LIGHT] = make_page(g_content); build_light(g_pages[PG_LIGHT]);
|
||||
g_pages[PG_BREW] = make_page(g_content); build_brew(g_pages[PG_BREW]);
|
||||
g_pages[PG_COLDEX] = make_page(g_content); build_coldex(g_pages[PG_COLDEX]);
|
||||
g_pages[PG_SERVICE] = make_page(g_content); build_service(g_pages[PG_SERVICE]);
|
||||
g_pages[PG_WIFI] = make_page(g_content); build_wifi(g_pages[PG_WIFI]);
|
||||
g_pages[PG_PROFILE] = make_page(g_content); build_profiles(g_pages[PG_PROFILE]);
|
||||
@@ -3165,6 +3342,13 @@ void ui_init(ProtocolClient* client) {
|
||||
lv_obj_t* wakeYes = th_accent_button(wakeBtns, "Aufwecken");
|
||||
lv_obj_set_width(wakeYes, 150);
|
||||
lv_obj_add_event_cb(wakeYes, wake_yes_cb, LV_EVENT_CLICKED, nullptr);
|
||||
// Zweite Zeile: direkt in die kalte Extraktion aufwecken. Ohne diesen Weg muesste man
|
||||
// erst normal aufwecken (Maschine heizt an) und den Modus danach umschalten.
|
||||
// Nur sichtbar, wenn die S3 die Funktion freigeschaltet meldet (siehe ui_update).
|
||||
g_wakeColdBtn = th_button(wakeCard, "Aufwecken mit Cold Extraction", COL_CARD2, COL_ACCENT);
|
||||
lv_obj_set_width(g_wakeColdBtn, LV_PCT(100));
|
||||
lv_obj_add_event_cb(g_wakeColdBtn, wake_cold_cb, LV_EVENT_CLICKED, nullptr);
|
||||
lv_obj_add_flag(g_wakeColdBtn, LV_OBJ_FLAG_HIDDEN);
|
||||
lv_obj_add_flag(g_wakeConfirm, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
// OTA-Overlay (Vollbild, waehrend Firmware-Update)
|
||||
@@ -3385,6 +3569,49 @@ void ui_update(const MachineState& st) {
|
||||
status_set(ST_SAFETY, false);
|
||||
}
|
||||
|
||||
// Cold-Extraction-Hinweis: erklaert dauerhaft, warum der Wasserkreis nicht heizt.
|
||||
// Transiente Meldung (abgewiesener Start / Abbruch) hat Vorrang vor dem Dauerzustand.
|
||||
// Ohne nutzbare Waage laeuft die kalte Extraktion rein zeitgesteuert (Zielgewicht und
|
||||
// Stillstands-Erkennung greifen nicht) - das wird dauerhaft mit angezeigt.
|
||||
const bool cxScaleOk = st.scaleEnabled && st.scaleConnected;
|
||||
// "Aufwecken mit Cold Extraction" nur anbieten, wenn die Funktion freigeschaltet und
|
||||
// umschaltbar ist und der Modus nicht ohnehin schon laeuft.
|
||||
if (g_wakeColdBtn) {
|
||||
if (st.cxEnabled && st.cxArmable && !st.cxActive) lv_obj_remove_flag(g_wakeColdBtn, LV_OBJ_FLAG_HIDDEN);
|
||||
else lv_obj_add_flag(g_wakeColdBtn, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
if (st.cxNotice == 2) {
|
||||
status_set(ST_COLDEX, true, LV_SYMBOL_WARNING " Cold Extraction beendet: kein Zulauf",
|
||||
COL_WARN, lv_color_hex(0x000000));
|
||||
} else if (st.cxNotice == 3) {
|
||||
status_set(ST_COLDEX, true, "Cold Extraction: erst nach dem Bezug umschaltbar",
|
||||
COL_WARN, lv_color_hex(0x000000));
|
||||
} else if (st.cxNotice == 1) {
|
||||
String t = "Cold Extraction nicht möglich - ";
|
||||
t += coldex_block_text(st.cxBlock, st.cxMaxTemp, st.tempW);
|
||||
status_set(ST_COLDEX, true, t.c_str(), COL_WARN, lv_color_hex(0x000000));
|
||||
} else if (st.cxNotice == 4) {
|
||||
status_set(ST_COLDEX, true, LV_SYMBOL_WARNING " Cold Extraction ohne Waage: Bezug endet nach Zeit",
|
||||
COL_WARN, lv_color_hex(0x000000));
|
||||
} else if (st.cxActive && st.cxResting) {
|
||||
status_set(ST_COLDEX, true, "Cold Extraction: Pumpenpause (Pumpenschutz)",
|
||||
COL_ACCENT, lv_color_hex(0x000000));
|
||||
} else if (st.cxActive && !st.cxAllowed) {
|
||||
String t = "Cold Extraction aktiv, Bezug gesperrt - ";
|
||||
t += coldex_block_text(st.cxBlock, st.cxMaxTemp, st.tempW);
|
||||
status_set(ST_COLDEX, true, t.c_str(), COL_WARN, lv_color_hex(0x000000));
|
||||
} else if (st.cxActive && !cxScaleOk) {
|
||||
// Dauerhinweis, solange ohne Waage gefahren wird: das Zielgewicht greift nicht,
|
||||
// der Bezug endet erst nach der maximalen Bezugsdauer.
|
||||
status_set(ST_COLDEX, true, "Cold Extraction aktiv - ohne Waage, Ende nach Zeit",
|
||||
COL_WARN, lv_color_hex(0x000000));
|
||||
} else if (st.cxActive) {
|
||||
status_set(ST_COLDEX, true, "Cold Extraction aktiv - Wasserkreis heizt nicht",
|
||||
lv_color_hex(0x1976d2), COL_TEXT);
|
||||
} else {
|
||||
status_set(ST_COLDEX, false);
|
||||
}
|
||||
|
||||
// Dampf-Hinweis (Heizen aus hat Vorrang vor Startverzoegerung)
|
||||
if (st.steamHeatDisabled) {
|
||||
status_set(ST_DAMPF, true, "Dampf: Heizen deaktiviert", COL_DANGER, COL_TEXT);
|
||||
@@ -3523,6 +3750,14 @@ void ui_update(const MachineState& st) {
|
||||
temp_progress_set(barDutyW, arcTempW, bulbTempW, 0, COL_DANGER);
|
||||
} else {
|
||||
lv_label_set_text(lblTempW, tempStr(st.tempW, 1).c_str());
|
||||
if (st.cxActive) {
|
||||
// Cold Extraction: der Sollwert ist bedeutungslos, es wird nicht geheizt.
|
||||
// Statt eines Zielbands, das nie erreicht wird, den Grund anzeigen.
|
||||
lv_obj_set_style_text_color(lblTempW, lv_color_hex(0x1976d2), 0);
|
||||
label_set_if_changed(lblSetW, "Cold Extraction - Heizen aus");
|
||||
lv_obj_set_style_text_color(lblSetW, lv_color_hex(0x1976d2), 0);
|
||||
temp_progress_set(barDutyW, arcTempW, bulbTempW, 0, lv_color_hex(0x1976d2));
|
||||
} else {
|
||||
// Ist-Wert faerbt sich weich Richtung Soll (Blau -> Gold -> Gruen im Zielband)
|
||||
lv_color_t colW = temp_state_color(st.tempW, st.setW);
|
||||
lv_obj_set_style_text_color(lblTempW, colW, 0);
|
||||
@@ -3532,6 +3767,7 @@ void ui_update(const MachineState& st) {
|
||||
int pctW = (st.setW > 0.0f) ? (int)(st.tempW / st.setW * 100.0f + 0.5f) : 0;
|
||||
temp_progress_set(barDutyW, arcTempW, bulbTempW, pctW, colW);
|
||||
}
|
||||
}
|
||||
if (st.dampfSafetyShutdown || st.dampfSensorError) {
|
||||
lv_label_set_text(lblTempD, LV_SYMBOL_WARNING);
|
||||
lv_obj_set_style_text_color(lblTempD, COL_DANGER, 0);
|
||||
@@ -3596,10 +3832,19 @@ void ui_update(const MachineState& st) {
|
||||
g_shotBbtMode = st.bbtEnabled && st.bbtSecs > 0.0f; // Bezug mit Brew-by-Time?
|
||||
if (g_shotBbtMode) g_bbtTarget = st.bbtSecs;
|
||||
// Pre-Infusion-Phasenleiste: Modus, S3-Phase und Phasendauern latchen (pi_bar_update)
|
||||
// Ein kalter Bezug hat seine eigene Phasenfolge (Vorbenetzung -> Extraktion, keine
|
||||
// Pause) und ignoriert die Pre-Infusion-Einstellungen komplett.
|
||||
g_piColdMode = st.cxShot;
|
||||
if (g_piColdMode) {
|
||||
g_piShotMode = (st.cxPreInfSec > 0.0f);
|
||||
g_piDurMs = (uint32_t)(st.cxPreInfSec * 1000.0f);
|
||||
g_piPauseMs = 0;
|
||||
} else {
|
||||
g_piShotMode = st.piEnabled;
|
||||
g_piStateS3 = st.piState;
|
||||
g_piDurMs = (uint32_t)(st.piDurSecs * 1000.0f);
|
||||
g_piPauseMs = (uint32_t)(st.piPauseSecs * 1000.0f);
|
||||
}
|
||||
g_piStateS3 = st.piState;
|
||||
// Live-Bezugsschirm einblenden (nur echte Bezuege; nicht im Reinigungsassistenten,
|
||||
// nicht im Standby und nicht, wenn der Nutzer ihn fuer diesen Bezug weggetippt hat)
|
||||
if (g_brewLiveEnabled && !g_brewLiveClosed && !g_brewLiveShown &&
|
||||
@@ -3623,6 +3868,7 @@ void ui_update(const MachineState& st) {
|
||||
}
|
||||
g_shotActive = false;
|
||||
g_piShotMode = false; // Phasenleiste ausblenden (pi_bar_update)
|
||||
g_piColdMode = false;
|
||||
g_piStateS3 = 0;
|
||||
brew_live_hide(); // Bezug vorbei -> Overlay weich ausblenden
|
||||
g_brewLiveClosed = false; // Wegtipp-Sperre gilt nur fuer den laufenden Bezug
|
||||
@@ -3725,6 +3971,72 @@ void ui_update(const MachineState& st) {
|
||||
if (swEco) sw_set(swEco, st.ecoActive);
|
||||
if (swMaint) sw_set(swMaint, st.maintenanceActive);
|
||||
if (swMaint2) sw_set(swMaint2, st.maintenanceActive);
|
||||
if (swColdEx) {
|
||||
// Zeile nur zeigen, wenn die S3 die Funktion freigeschaltet meldet (und sie kennt)
|
||||
lv_obj_t* rowCx = lv_obj_get_parent(swColdEx);
|
||||
if (st.cxEnabled) {
|
||||
lv_obj_remove_flag(rowCx, LV_OBJ_FLAG_HIDDEN);
|
||||
if (lblColdExHint) lv_obj_remove_flag(lblColdExHint, LV_OBJ_FLAG_HIDDEN);
|
||||
} else {
|
||||
lv_obj_add_flag(rowCx, LV_OBJ_FLAG_HIDDEN);
|
||||
if (lblColdExHint) lv_obj_add_flag(lblColdExHint, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
sw_set(swColdEx, st.cxActive);
|
||||
// Umschalten haengt an cxArmable, NICHT an cxAllowed: Der Modus muss auch im Standby
|
||||
// und bei warmem Kessel scharf zu stellen sein. Waehrend eines kalten Bezugs gesperrt.
|
||||
bool usable = st.cxEnabled && st.cxArmable && !(st.cxActive && st.cxShot);
|
||||
if (usable) lv_obj_remove_state(swColdEx, LV_STATE_DISABLED);
|
||||
else lv_obj_add_state(swColdEx, LV_STATE_DISABLED);
|
||||
if (lblColdExHint && st.cxEnabled) {
|
||||
const bool scaleOk = st.scaleEnabled && st.scaleConnected;
|
||||
String hint;
|
||||
if (st.cxActive) {
|
||||
hint = "Wasserkreis heizt nicht (bleibt über Standby und Neustart aktiv). ";
|
||||
if (st.standbyActive) {
|
||||
hint += "Nach dem Aufwecken bleibt der Wasserkreis aus.";
|
||||
} else if (st.cxAllowed) {
|
||||
char b[96];
|
||||
if (scaleOk) {
|
||||
snprintf(b, sizeof(b), "Bezug regulär starten - Ziel %.0f g, max %.0f s.",
|
||||
(double)st.cxTarget, (double)st.cxMaxSecs);
|
||||
} else {
|
||||
snprintf(b, sizeof(b), "Bezug regulär starten - Ende nach %.0f s.",
|
||||
(double)st.cxMaxSecs);
|
||||
}
|
||||
hint += b;
|
||||
} else {
|
||||
hint += coldex_block_text(st.cxBlock, st.cxMaxTemp, st.tempW);
|
||||
}
|
||||
} else if (!st.cxAllowed) {
|
||||
hint = coldex_block_text(st.cxBlock, st.cxMaxTemp, st.tempW);
|
||||
} else {
|
||||
char b[112];
|
||||
snprintf(b, sizeof(b), "Kalte Extraktion möglich (Wasser %.1f °C < %.1f °C). "
|
||||
"Solange aktiv, heizt der Wasserkreis nicht.",
|
||||
(double)st.tempW, (double)st.cxMaxTemp);
|
||||
hint = b;
|
||||
}
|
||||
if (!scaleOk) {
|
||||
hint += " Ohne Waage: Zielgewicht und Stillstands-Erkennung greifen nicht, "
|
||||
"der Bezug endet erst nach der maximalen Bezugsdauer.";
|
||||
}
|
||||
label_set_if_changed(lblColdExHint, hint.c_str());
|
||||
}
|
||||
}
|
||||
if (lblCxPageHint) {
|
||||
// Warnhinweis auf der Cold-Extraction-Seite (Waage fehlt bzw. Funktion gesperrt)
|
||||
String h;
|
||||
if (st.cxEnabled && !cxScaleOk) {
|
||||
h = "Keine Waage aktiv/verbunden: Zielgewicht und Stillstands-Erkennung greifen nicht, "
|
||||
"der Bezug endet erst nach der maximalen Dauer.";
|
||||
}
|
||||
if (h.length() > 0) {
|
||||
label_set_if_changed(lblCxPageHint, h.c_str());
|
||||
lv_obj_remove_flag(lblCxPageHint, LV_OBJ_FLAG_HIDDEN);
|
||||
} else {
|
||||
lv_obj_add_flag(lblCxPageHint, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
}
|
||||
|
||||
// Licht-Button spiegeln (gold = an)
|
||||
if (btnLight) {
|
||||
@@ -3857,14 +4169,19 @@ void ui_set_usage_stats(const String& json) {
|
||||
String l;
|
||||
int n = 0;
|
||||
float durSum = 0.0f;
|
||||
int nDur = 0; // Anzahl der Bezuege, die in den Mittelwert eingehen (ohne kalte)
|
||||
for (JsonVariant v : doc["shots"].as<JsonArray>()) {
|
||||
const char* dt = v["dt"] | "";
|
||||
float d = v["d"] | 0.0f;
|
||||
float w = v["w"] | -1.0f;
|
||||
bool cold = v["cx"] | false; // kalte Extraktion (fehlt bei S3-FW < 5.3.0)
|
||||
if (n > 0) l += "\n";
|
||||
l += String(dt) + " " + String(d, 1) + " s";
|
||||
if (w >= 0.0f) l += " " + String(w, 1) + " g";
|
||||
durSum += d;
|
||||
if (cold) l += " (kalt)";
|
||||
// Minutenlange kalte Bezuege wuerden den Mittelwert unbrauchbar machen -> raus
|
||||
// (gleiche Regel wie in der S3-Statistik)
|
||||
if (!cold) { durSum += d; nDur++; }
|
||||
n++;
|
||||
}
|
||||
|
||||
@@ -3873,7 +4190,10 @@ void ui_set_usage_stats(const String& json) {
|
||||
s += "Diese Woche: " + String(week) + "\n";
|
||||
// total ist exakt, solange die ganze Datei ins Fenster passte (sonst Fenster-Untergrenze)
|
||||
s += "Gesamt: " + (partial ? String("min. ") : String("")) + String(total) + " Bezüge";
|
||||
if (n > 0) s += "\nMittl. Dauer (letzte " + String(n) + "): " + String(durSum / n, 1) + " s";
|
||||
if (nDur > 0) {
|
||||
s += "\nMittl. Dauer (letzte " + String(nDur) + "): " + String(durSum / nDur, 1) + " s";
|
||||
if (nDur < n) s += " (ohne kalte)";
|
||||
}
|
||||
label_set_if_changed(g_statSummary, s.c_str());
|
||||
|
||||
if (g_statList) {
|
||||
|
||||
Reference in New Issue
Block a user