With the boiler controllable and temperature data stored, I could start automatically adjusting the house temperature.
La chaudière étant pilotable et les données de température stockées, je pouvais commencer à ajuster automatiquement la température de la maison.
Temperature schedule
Programme de température
A schedule file with time ranges and target temperatures. The living room is the main room; the bedroom acts as a safety cap.
Un fichier de programme avec des plages horaires et des températures cibles. Le salon est la pièce principale ; la chambre sert de régulateur de sécurité.
$ranges = Array(
Array("start"=>"00:00","end"=>"06:00","target"=>18.5,"bedroommax"=>21.5,"bedroommin"=>19),
Array("start"=>"06:00","end"=>"07:30","target"=>21, "bedroommax"=>21.5,"bedroommin"=>19),
Array("start"=>"07:30","end"=>"16:00","target"=>20.5,"bedroommax"=>21.5,"bedroommin"=>19),
Array("start"=>"16:00","end"=>"17:30","target"=>21, "bedroommax"=>21.5,"bedroommin"=>19),
Array("start"=>"17:30","end"=>"23:59","target"=>18.5,"bedroommax"=>21.5,"bedroommin"=>19),
);
$maxdeviation = 0.5;Decision logic (simplified)
Logique de décision (simplifiée)
// Si temp < cible (avec tolérance) ET chambre OK → allumer
if ($living < ($range["target"] - $maxdeviation)
&& $bedroom < $range["bedroommax"] && $status == "off") {
wemoon(); // allumer la chaudière
}
// Si temp >= cible OU chambre trop chaude → éteindre
elseif ($living >= $range["target"]
&& $bedroom > $range["bedroommin"] && $status == "on") {
wemooff(); // éteindre la chaudière
}By creating a file /tmp/donothing.lock you disable the controller. Useful when temperatures are volatile (open windows in winter). A reminder email is sent every ~10 minutes while the lock is active.
En créant le fichier /tmp/donothing.lock, on désactive le contrôleur. Utile quand les températures sont erratiques (fenêtres ouvertes en hiver). Un email de rappel est envoyé toutes les ~10 minutes tant que le verrou est actif.