Automatiken: Rahmen am Vorabend fuer den folgenden Tag

Neuer Schalter "Am Vorabend" im Wann-Band (Spalte next_day). Wochentage,
Ferien und Feiertage gelten dann fuer morgen: "Kinderrollos zu, wenn morgen
Schule ist" ist Mo-Fr, Ferien nie, Feiertage nie - wie der Wecker. Mit dem
heutigen Tag ging das am letzten Ferientag, am Abend vor einem Feiertag und
am Abend eines Feiertags daneben.

Editor-Satz, Kurzfassung und Uebersicht nennen den Vorabend vorne, damit
auch "nicht an Feiertagen" als Folgetag gelesen wird. Die Spalte legt
vorabend.sql im SolarManager an, ausgewertet wird sie im Runner.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 09:33:59 +02:00
co-authored by Claude Opus 5
parent deb81045d5
commit 59d2a4a55e
4 changed files with 41 additions and 11 deletions
+15 -10
View File
@@ -803,6 +803,7 @@ function emptyAutomation($floor)
"weekdays" => 127,
"on_vacation" => 1,
"on_holiday" => 1,
"next_day" => false,
"force_once" => false,
"once_per_day" => false,
"lockout_secs" => 60,
@@ -835,6 +836,9 @@ function loadAutomation($id)
"weekdays" => intval($row["weekdays"]),
"on_vacation" => intval($row["on_vacation"]),
"on_holiday" => intval($row["on_holiday"]),
// Vorabend: der Rahmen gilt fuer morgen. Siehe vorabend.sql im
// SolarManager; ?? 0 wie bei once_per_day, falls die Spalte fehlt.
"next_day" => (bool)($row["next_day"] ?? 0),
"force_once" => (bool)$row["force_once"],
// ?? 0, damit der Editor auch vor der Migration noch aufgeht:
// rahmen_erweitern.sql legt die Spalte erst an.
@@ -925,6 +929,7 @@ function saveAutomation($data)
$weekdays = intval($data["weekdays"] ?? 127) & 127;
$onVacation = kalendertagWert($data["on_vacation"] ?? 1);
$onHoliday = kalendertagWert($data["on_holiday"] ?? 1);
$nextDay = !empty($data["next_day"]) ? 1 : 0;
$forceOnce = !empty($data["force_once"]) ? 1 : 0;
$oncePerDay = !empty($data["once_per_day"]) ? 1 : 0;
// Nur die angebotenen Stufen, sonst die Vorgabe. Eine krumme Zahl kaeme
@@ -957,12 +962,12 @@ function saveAutomation($data)
// Zeitstempel, dass er sein Regelwerk neu laden muss.
$stmt = $db->prepare("UPDATE automations SET name = ?, floor = ?, enabled = ?,
window_from = ?, window_to = ?, weekdays = ?,
on_vacation = ?, on_holiday = ?, force_once = ?,
on_vacation = ?, on_holiday = ?, next_day = ?, force_once = ?,
once_per_day = ?, lockout_secs = ?, changed = NOW()
WHERE id = ?");
$stmt->bind_param("ssissiiiiiii", $name, $floor, $enabled, $windowFrom, $windowTo,
$weekdays, $onVacation, $onHoliday, $forceOnce, $oncePerDay,
$lockout, $id);
$stmt->bind_param("ssissiiiiiiii", $name, $floor, $enabled, $windowFrom, $windowTo,
$weekdays, $onVacation, $onHoliday, $nextDay, $forceOnce,
$oncePerDay, $lockout, $id);
$stmt->execute();
$stmt->close();
$db->query("DELETE FROM automation_conditions WHERE automation_id = " . $id);
@@ -970,12 +975,12 @@ function saveAutomation($data)
} else {
$stmt = $db->prepare("INSERT INTO automations
(name, floor, enabled, window_from, window_to, weekdays,
on_vacation, on_holiday, force_once, once_per_day,
lockout_secs)
VALUES (?,?,?,?,?,?,?,?,?,?,?)");
$stmt->bind_param("ssissiiiiii", $name, $floor, $enabled, $windowFrom, $windowTo,
$weekdays, $onVacation, $onHoliday, $forceOnce, $oncePerDay,
$lockout);
on_vacation, on_holiday, next_day, force_once,
once_per_day, lockout_secs)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");
$stmt->bind_param("ssissiiiiiii", $name, $floor, $enabled, $windowFrom, $windowTo,
$weekdays, $onVacation, $onHoliday, $nextDay, $forceOnce,
$oncePerDay, $lockout);
$stmt->execute();
$id = $db->insert_id;
$stmt->close();